aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/unpack_test.go
diff options
context:
space:
mode:
authorRicardo Domingos <ricardohsd@gmail.com>2018-04-04 19:42:36 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-04 19:42:36 +0800
commit6ab9f0a19fbf548a78d08a526f522f41d8175a4e (patch)
tree49f515b8cf0550ec70f3a3daa3989a3499243aa5 /accounts/abi/unpack_test.go
parent7aad81f8815084c8ed032705fbaf6d3710e518cf (diff)
downloadgo-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar.gz
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar.bz2
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar.lz
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar.xz
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.tar.zst
go-tangerine-6ab9f0a19fbf548a78d08a526f522f41d8175a4e.zip
accounts/abi: improve test coverage (#16044)
Diffstat (limited to 'accounts/abi/unpack_test.go')
-rw-r--r--accounts/abi/unpack_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go
index ee6256709..bdbab10b4 100644
--- a/accounts/abi/unpack_test.go
+++ b/accounts/abi/unpack_test.go
@@ -57,6 +57,23 @@ var unpackTests = []unpackTest{
want: true,
},
{
+ def: `[{ "type": "bool" }]`,
+ enc: "0000000000000000000000000000000000000000000000000000000000000000",
+ want: false,
+ },
+ {
+ def: `[{ "type": "bool" }]`,
+ enc: "0000000000000000000000000000000000000000000000000001000000000001",
+ want: false,
+ err: "abi: improperly encoded boolean value",
+ },
+ {
+ def: `[{ "type": "bool" }]`,
+ enc: "0000000000000000000000000000000000000000000000000000000000000003",
+ want: false,
+ err: "abi: improperly encoded boolean value",
+ },
+ {
def: `[{"type": "uint32"}]`,
enc: "0000000000000000000000000000000000000000000000000000000000000001",
want: uint32(1),