diff options
author | Bob Glickstein <bobg@users.noreply.github.com> | 2017-12-21 17:59:14 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-12-21 17:59:14 +0800 |
commit | e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea (patch) | |
tree | 192aa0dde579e1f49497363fffb717dd18648b2f /accounts/abi/unpack.go | |
parent | 9f1007e554e223b12354d3c91ae7fb040cf8b865 (diff) | |
download | dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar.gz dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar.bz2 dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar.lz dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar.xz dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.tar.zst dexon-e21aa0fda3b9d0b101d60d03e98a0bdd4d415dea.zip |
accounts/abi: remove check for len%32==0 when unpacking events (#15670)
This change inlines the logic of bytesAreProper at its sole
callsite, ABI.Unpack, and applies the multiple-of-32 test only in
the case of unpacking methods. Event data is not required to be a
multiple of 32 bytes long.
Diffstat (limited to 'accounts/abi/unpack.go')
-rw-r--r-- | accounts/abi/unpack.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go index 57732797b..051fc1916 100644 --- a/accounts/abi/unpack.go +++ b/accounts/abi/unpack.go @@ -203,14 +203,3 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err //fmt.Printf("LENGTH PREFIX INFO: \nsize: %v\noffset: %v\nstart: %v\n", length, offset, start) return } - -// checks for proper formatting of byte output -func bytesAreProper(output []byte) error { - if len(output) == 0 { - return fmt.Errorf("abi: unmarshalling empty output") - } else if len(output)%32 != 0 { - return fmt.Errorf("abi: improperly formatted output") - } else { - return nil - } -} |