File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,14 @@ func (rp RowProof) Validate(root []byte) error {
34
34
if len (rp .Proofs ) != len (rp .RowRoots ) {
35
35
return fmt .Errorf ("the number of proofs %d must equal the number of row roots %d" , len (rp .Proofs ), len (rp .RowRoots ))
36
36
}
37
- if len (rp .Proofs ) != 0 &&
38
- (int64 (rp .StartRow ) != rp .Proofs [0 ].Index ||
39
- int64 (rp .EndRow ) != rp .Proofs [len (rp .Proofs )- 1 ].Index ) {
40
- return fmt .Errorf ("invalid start/end row" )
37
+ if len (rp .Proofs ) == 0 {
38
+ return fmt .Errorf ("empty proofs" )
39
+ }
40
+ if int64 (rp .StartRow ) != rp .Proofs [0 ].Index {
41
+ return fmt .Errorf ("invalid start row" )
42
+ }
43
+ if int64 (rp .EndRow ) != rp .Proofs [len (rp .Proofs )- 1 ].Index {
44
+ return fmt .Errorf ("invalid end row" )
41
45
}
42
46
if ! rp .VerifyProof (root ) {
43
47
return errors .New ("row proof failed to verify" )
You can’t perform that action at this time.
0 commit comments