You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensured struct definitions match ABI specifications.
Question:
Can anyone identify why this decoding fails in Go, or is there a known issue with decoding such complex tuple arrays with go-ethereum? Any suggestions or fixes would be greatly appreciated.
I've used this same approach for decoding calldata hundreds of times, first time facing this issue
Additional Info:
go-ethereum version: 1.22
Go version: v1.14.12
any help would be hugely appreciated
The text was updated successfully, but these errors were encountered:
For contract methods, the unpack methods decode the provided data against the specified output of the given method, not the input. This is the source of your error.
To do what you want, you'd want something like the following:
func UnpackMethoInputIntoInterface(abi ABI, outp interface{}, name string, data []byte) error {
var (
args Arguments
err error
)
method := abi.Methods[name]
args = method.Inputs
unpacked, err := args.Unpack(data)
if err != nil {
return err
}
return args.Copy(outp, unpacked)
}
I'm encountering an issue with decoding ABI data using go-ethereum's abi.Unpack or UnpackIntoInterface method. Here are the details:
Go Code Attempt:
Error Received:
Steps Taken:
Question:
Can anyone identify why this decoding fails in Go, or is there a known issue with decoding such complex tuple arrays with go-ethereum? Any suggestions or fixes would be greatly appreciated.
I've used this same approach for decoding calldata hundreds of times, first time facing this issue
Additional Info:
go-ethereum version: 1.22
Go version: v1.14.12
any help would be hugely appreciated
The text was updated successfully, but these errors were encountered: