Closed utdrmac closed 3 years ago
Found the issue https://github.com/goat-systems/go-tezos/blob/6fecc940c49c88c9f7e7f600d3417f74e31b2252/rpc/block.go#L464 ^^This should be of type []ResultError
There seem to be two "OperationResults" type structs: https://github.com/goat-systems/go-tezos/blob/6fecc940c49c88c9f7e7f600d3417f74e31b2252/rpc/block.go#L211 https://github.com/goat-systems/go-tezos/blob/6fecc940c49c88c9f7e7f600d3417f74e31b2252/rpc/block.go#L456
They appear to be 99% the same, but are different with the 'Errors' member types.
These two structs probably need to be merged?
Actually, I think I found the more correct issue. There exists type Errors []Error
in client.go, but many of the structs in block.go use []Errors
which is a slice of slices. By changing every struct in block.go to use []Error
the above operation is parsing correctly now.
@utdrmac Yeah this was a problem with no using the ResultErrors struct. It will be fixed when I merge v4. Thanks for reporting!
Testing on carthagenet and came across this one. https://carthagenet.tzstats.com/BMess41PKzQXeJ3tt6NQVz4TG7hgF2JtgYWzmmF8ecLjKME3jVC
For some reason, the operation errors are being interpreted as rpc.Errors but should be parsed as ResultError. I'm trying to figure out why this is.
In an effort to start debugging the issue, I stripped down the block to basic components plus the operation with the errors. Just using a simple parse to work out the issue, if I can:
Here's the contents of bad_parse.json: