From 822890ca07ae13005d5b5b0c9d62424fbcef3829 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 8 May 2020 09:51:39 +0200 Subject: [PATCH] accounts/abi: removed superfluous test cases This commit removes two test cases. The first one is trivially invalid as we have the same test cases as passing in packing_test.go L375. The second one passes now, because we don't need the mapArgNamesToStructFields in unpack_atomic anymore. Checking for purely underscored arg names generally should not be something we do as the abi/contract is generally out of the control of the user. --- accounts/abi/unpack_test.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 4270d480d9..babe1cb73a 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -117,32 +117,12 @@ var unpackTests = []unpackTest{ want: int16(0), err: "abi: cannot unmarshal *big.Int in to int16", }, - /* - TODO (MariusVanDerWijden) check validity of test - { - def: `[{"type": "bytes"}]`, - enc: "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000", - want: [32]byte{}, - err: "abi: cannot unmarshal []uint8 in to [32]uint8", - },*/ { def: `[{"type": "bytes32"}]`, enc: "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000", want: []byte(nil), err: "abi: cannot unmarshal [32]uint8 in to []uint8", }, - /* - TODO (MariusVanDerWijden) check validity of test - { - def: `[{"name":"___","type":"int256"}]`, - enc: "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002", - want: struct { - IntOne *big.Int - Intone *big.Int - }{}, - err: "abi: purely underscored output cannot unpack to struct", - }, - */ { def: `[{"name":"int_one","type":"int256"},{"name":"IntOne","type":"int256"}]`, enc: "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002",