accounts/abi: add another unpack interface

This commit is contained in:
Martin Holst Swende
2017-12-28 11:17:45 +01:00
parent 5603715c06
commit 1ede68355d
5 changed files with 395 additions and 14 deletions

View File

@ -689,7 +689,11 @@ func TestABI_MethodById(t *testing.T) {
}
for name, m := range abi.Methods {
a := fmt.Sprintf("%v", m)
b := fmt.Sprintf("%v", abi.MethodById(m.Id()))
m2,err := abi.MethodById(m.Id())
if err != nil {
t.Fatal(err)
}
b := fmt.Sprintf("%v", m2)
if a != b {
t.Errorf("Method %v (id %v) not 'findable' by id in ABI", name, common.ToHex(m.Id()))
}