mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
accounts/abi: add error-checks (#26914)
This commit is contained in:
parent
ba053a5468
commit
1a07b9bb49
1 changed files with 4 additions and 1 deletions
|
|
@ -246,7 +246,10 @@ func UnpackRevert(data []byte) (string, error) {
|
||||||
if !bytes.Equal(data[:4], revertSelector) {
|
if !bytes.Equal(data[:4], revertSelector) {
|
||||||
return "", errors.New("invalid data for unpacking")
|
return "", errors.New("invalid data for unpacking")
|
||||||
}
|
}
|
||||||
typ, _ := NewType("string", "", nil)
|
typ, err := NewType("string", "", nil)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
|
unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue