From 6ab9f0a19fbf548a78d08a526f522f41d8175a4e Mon Sep 17 00:00:00 2001 From: Ricardo Domingos Date: Wed, 4 Apr 2018 13:42:36 +0200 Subject: accounts/abi: improve test coverage (#16044) --- accounts/abi/unpack_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'accounts/abi/unpack_test.go') 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 @@ -56,6 +56,23 @@ var unpackTests = []unpackTest{ enc: "0000000000000000000000000000000000000000000000000000000000000001", 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", -- cgit v1.2.3