accounts/abi: brings out the msg defined at require statement in SC function (#17328)

This commit is contained in:
Daniel Liu 2025-01-14 10:56:07 +08:00
parent 16e444c4f8
commit bb54f11c13

View file

@ -85,7 +85,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 errors.New("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 {