Skip to content

Commit

Permalink
test: ValidateClaimWindowCloseOffsetBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed May 31, 2024
1 parent 3da28ab commit f906bdb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions x/shared/types/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,33 @@ func TestParams_ValidateClaimWindowOpenOffsetBlocks(t *testing.T) {
})
}
}

func TestParams_ValidateClaimWindowCloseOffsetBlocks(t *testing.T) {
tests := []struct {
desc string
claimWindowCloseOffsetBlocks any
err error
}{
{
desc: "invalid type",
claimWindowCloseOffsetBlocks: "invalid",
err: ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", "invalid"),
},
{
desc: "valid ClaimWindowCloseOffsetBlocks",
claimWindowCloseOffsetBlocks: uint64(4),
},
}

for _, tt := range tests {
t.Run(tt.desc, func(t *testing.T) {
err := ValidateClaimWindowCloseOffsetBlocks(tt.claimWindowCloseOffsetBlocks)
if tt.err != nil {
require.Error(t, err)
require.Contains(t, err.Error(), tt.err.Error())
} else {
require.NoError(t, err)
}
})
}
}

0 comments on commit f906bdb

Please sign in to comment.