mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Update accounts/abi/error.go
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This commit is contained in:
parent
6f9663653a
commit
f549c17e32
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ func (e Error) String() string {
|
||||||
|
|
||||||
func (e *Error) Unpack(data []byte) (interface{}, error) {
|
func (e *Error) Unpack(data []byte) (interface{}, error) {
|
||||||
if len(data) < 4 {
|
if len(data) < 4 {
|
||||||
return "", errors.New("invalid data for unpacking, length is less than 4")
|
return "", fmt.Errorf("invalid data length for unpacking: got %v, want 4", len(data))
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data[:4], e.ID[:4]) {
|
if !bytes.Equal(data[:4], e.ID[:4]) {
|
||||||
return "", errors.New("invalid data for unpacking, first four bytes are not equal with error's signature")
|
return "", errors.New("invalid data for unpacking, first four bytes are not equal with error's signature")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue