diff options
author | zer0to0ne <36526113+zer0to0ne@users.noreply.github.com> | 2019-07-01 22:51:21 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2019-07-01 22:51:21 +0800 |
commit | 0b26a826e988ba2493d89f00383d110fb1566ff2 (patch) | |
tree | 9d5a43b25ecd019e6cb9d6c1018219c62c6853e9 /accounts/abi/bind/base_test.go | |
parent | f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9 (diff) | |
download | go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar.gz go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar.bz2 go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar.lz go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar.xz go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.tar.zst go-tangerine-0b26a826e988ba2493d89f00383d110fb1566ff2.zip |
accounts/abi: Fix method overwritten by same name methods. (#17099)
* accounts/abi: Fix method overwritten by same name methods.
* accounts/abi: Fix method overwritten by same name methods.
* accounts/abi: avoid possible name conflict
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Diffstat (limited to 'accounts/abi/bind/base_test.go')
-rw-r--r-- | accounts/abi/bind/base_test.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index f65c9e9b4..3ae685e00 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -345,29 +345,3 @@ func TestUnpackIndexedBytesTyLogIntoMap(t *testing.T) { t.Error("unpacked map does not match expected map") } } - -func TestUnpackIntoMapNamingConflict(t *testing.T) { - hash := crypto.Keccak256Hash([]byte("testName")) - mockLog := types.Log{ - Address: common.HexToAddress("0x0"), - Topics: []common.Hash{ - common.HexToHash("0x0"), - hash, - }, - Data: hexutil.MustDecode(hexData), - BlockNumber: uint64(26), - TxHash: common.HexToHash("0x0"), - TxIndex: 111, - BlockHash: common.BytesToHash([]byte{1, 2, 3, 4, 5}), - Index: 7, - Removed: false, - } - - abiString := `[{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"string"},{"indexed":false,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"memo","type":"bytes"}],"name":"received","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"}],"name":"received","type":"event"}]` - parsedAbi, _ := abi.JSON(strings.NewReader(abiString)) - bc := bind.NewBoundContract(common.HexToAddress("0x0"), parsedAbi, nil, nil, nil) - receivedMap := make(map[string]interface{}) - if err := bc.UnpackLogIntoMap(receivedMap, "received", mockLog); err == nil { - t.Error("naming conflict between two events; error expected") - } -} |