Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
chainscripttest: withDegree (#28)
Browse files Browse the repository at this point in the history
* chainscripttest: withDegree
* outDegree: add error for append failures
  • Loading branch information
t-bast authored Sep 18, 2018
1 parent 88d0029 commit 6cacc3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chainscripttest/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func (lb *LinkBuilder) WithData(t *testing.T, data interface{}) *LinkBuilder {
return lb
}

// WithDegree sets the link's out degree.
func (lb *LinkBuilder) WithDegree(d int) *LinkBuilder {
lb.Link.Meta.OutDegree = int32(d)
return lb
}

// WithInvalidFields makes the link invalid by setting some fields to invalid
// values.
func (lb *LinkBuilder) WithInvalidFields() *LinkBuilder {
Expand Down
1 change: 1 addition & 0 deletions link.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const (
// Link errors.
var (
ErrMissingVersion = errors.New("version is missing")
ErrOutDegree = errors.New("cannot create link: parent has too many children")
ErrUnknownLinkVersion = errors.New("unknown link version")
ErrUnknownClientID = errors.New("link was created with a unknown client: can't deserialize it")
)
Expand Down

0 comments on commit 6cacc3d

Please sign in to comment.