(expected, found []byte)
| 37 | } |
| 38 | |
| 39 | func CompareCommits(expected, found []byte) error { |
| 40 | if len(expected) < HashSizeInContract { |
| 41 | return &CommitMismatchError{ |
| 42 | message: fmt.Sprintf("invalid length of commit %x: %d", expected, len(expected)), |
| 43 | } |
| 44 | } |
| 45 | if len(found) < HashSizeInContract { |
| 46 | return &CommitMismatchError{ |
| 47 | message: fmt.Sprintf("invalid length of commit %x: %d", found, len(found)), |
| 48 | } |
| 49 | } |
| 50 | if bytes.Equal(expected[0:HashSizeInContract], found[0:HashSizeInContract]) { |
| 51 | return nil |
| 52 | } |
| 53 | return &CommitMismatchError{ |
| 54 | expected: expected[0:HashSizeInContract], |
| 55 | found: found[0:HashSizeInContract], |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | type FetchBlobFunc func(kvIndex uint64, hash common.Hash) ([]byte, error) |
| 60 |
no outgoing calls
no test coverage detected