|
|
|
@ -21,6 +21,7 @@ import ( |
|
|
|
|
"fmt" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
@ -46,6 +47,10 @@ var ( |
|
|
|
|
errUnexpectedNode = errors.New("unexpected node") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func newUnexpectedNodeError(loc string, expHash common.Hash, gotHash common.Hash, owner common.Hash, path []byte) error { |
|
|
|
|
return fmt.Errorf("%w, loc: %s, node: (%x %v), %x!=%x", errUnexpectedNode, loc, owner, path, expHash, gotHash) |
|
|
|
|
func newUnexpectedNodeError(loc string, expHash common.Hash, gotHash common.Hash, owner common.Hash, path []byte, blob []byte) error { |
|
|
|
|
blobHex := "nil" |
|
|
|
|
if len(blob) > 0 { |
|
|
|
|
blobHex = hexutil.Encode(blob) |
|
|
|
|
} |
|
|
|
|
return fmt.Errorf("%w, loc: %s, node: (%x %v), %x!=%x, blob: %s", errUnexpectedNode, loc, owner, path, expHash, gotHash, blobHex) |
|
|
|
|
} |
|
|
|
|