trie, accounts/abi: add error-checks (#26914)

This commit is contained in:
Darioush Jalali
2023-03-17 06:19:51 -04:00
committed by GitHub
parent f733657383
commit b7bfbc1e64
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -246,7 +246,10 @@ func UnpackRevert(data []byte) (string, error) {
if !bytes.Equal(data[:4], revertSelector) {
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:])
if err != nil {
return "", err