update error message and add tests (#8166)
This commit is contained in:
parent
e4e39234c8
commit
ed5f120232
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue