From 329508c9007e4d9cd7809e65475af600f1c42ace Mon Sep 17 00:00:00 2001 From: Jeff Prestes Date: Mon, 6 Aug 2018 15:40:05 -0300 Subject: [PATCH] abi: Brings out the msg defined at require statement in SC function This small change will help developers that use ABI to test their Smart Contract to bring out the message defined at Solidity require statement to their Go's contract proxy. Receiving the error (or Solidity function's requirement) clearly they can easily and faster adjust their tests and/or Go's source. --- 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 254b1f7fb4..2c58c213d7 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -82,7 +82,7 @@ func (abi ABI) Unpack(v interface{}, name string, output []byte) (err error) { // we need to decide whether we're calling a method or an event if method, ok := abi.Methods[name]; ok { if len(output)%32 != 0 { - return fmt.Errorf("abi: improperly formatted output") + return fmt.Errorf("abi: improperly formatted output: %s - Bytes: [%+v]", string(output), output) } return method.Outputs.Unpack(v, output) } else if event, ok := abi.Events[name]; ok {