Skip to content

Commit

Permalink
update error message and add tests (#8166)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner authored Dec 14, 2020
1 parent e4e3923 commit ed5f120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion baseapp/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func ValidateEvidenceParams(i interface{}) error {
}

if v.MaxBytes < 0 {
return fmt.Errorf("maximum evidence bytes must be positive: %v", v.MaxBytes)
return fmt.Errorf("maximum evidence bytes must be non-negative: %v", v.MaxBytes)
}

return nil
Expand Down
3 changes: 3 additions & 0 deletions baseapp/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func TestValidateEvidenceParams(t *testing.T) {
{&tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxBytes: 5000000}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: -1, MaxBytes: 5000000}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: -1}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 5000000}, false},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 0}, false},
}

for _, tc := range testCases {
Expand Down

0 comments on commit ed5f120

Please sign in to comment.