mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
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.
This commit is contained in:
parent
eef65b20fc
commit
329508c900
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
// we need to decide whether we're calling a method or an event
|
||||||
if method, ok := abi.Methods[name]; ok {
|
if method, ok := abi.Methods[name]; ok {
|
||||||
if len(output)%32 != 0 {
|
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)
|
return method.Outputs.Unpack(v, output)
|
||||||
} else if event, ok := abi.Events[name]; ok {
|
} else if event, ok := abi.Events[name]; ok {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue