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
I was running the debug_traceBlock rpc, when I noticed the errors were not displaying properly.
"error": {}
Actual behaviour
When I expected to see something like
"error": "out of gas"
After some digging, it seems the issue is with the fact that "Error" is an error interface in
type StructLogRes struct {
Pc uint64 `json:"pc"`
Op string `json:"op"`
Gas uint64 `json:"gas"`
GasCost uint64 `json:"gasCost"`
Depth int `json:"depth"`
Error error `json:"error,omitempty"`
Stack *[]string `json:"stack,omitempty"`
Memory *[]string `json:"memory,omitempty"`
Storage *map[string]string `json:"storage,omitempty"`
}
Instead of something more marshallable like a string.
Since this struct is only used to marshal to json, maybe setting Error to be of type string, and setting it to Error.Error() could work?
Steps to reproduce the behaviour
Trace any block that has an error in a smart contract.
The text was updated successfully, but these errors were encountered:
System information
Geth version: master?
OS & Version: Windows/Linux/OSX
Commit hash : 2faf796
Expected behaviour
I was running the debug_traceBlock rpc, when I noticed the errors were not displaying properly.
Actual behaviour
When I expected to see something like
After some digging, it seems the issue is with the fact that "Error" is an error interface in
Instead of something more marshallable like a string.
Since this struct is only used to marshal to json, maybe setting Error to be of type string, and setting it to Error.Error() could work?
Steps to reproduce the behaviour
Trace any block that has an error in a smart contract.
The text was updated successfully, but these errors were encountered: