From 1ed66b1ef3ba507ff1751e7c0179e0e142b28a27 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Fri, 4 Nov 2022 16:52:28 -0400 Subject: [PATCH 1/2] abi: Format data as hex-string instead of string(data) --- accounts/abi/abi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 81bbee2f2b4a..03b0e19d7c2b 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -87,7 +87,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) { var args Arguments if method, ok := abi.Methods[name]; ok { if len(data)%32 != 0 { - return nil, fmt.Errorf("abi: improperly formatted output: %s - Bytes: [%+v]", string(data), data) + return nil, fmt.Errorf("abi: improperly formatted output: %x", data) } args = method.Outputs } From a6214da2abc320f3a1124509311f31181669cd37 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Sat, 5 Nov 2022 11:04:20 +0100 Subject: [PATCH 2/2] Update accounts/abi/abi.go --- accounts/abi/abi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 03b0e19d7c2b..841d3c6cb676 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -87,7 +87,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) { var args Arguments if method, ok := abi.Methods[name]; ok { if len(data)%32 != 0 { - return nil, fmt.Errorf("abi: improperly formatted output: %x", data) + return nil, fmt.Errorf("abi: improperly formatted output: %q - Bytes: %+v", data, data) } args = method.Outputs }