EVM/Node: improve the propagation of unsuccessful calls
Context
The UX of the node is a bit broken when there is an error during a simulation: since there is no results in the storage, the insight is null and then the simulation doesn't parse it correctly.
This change simply takes into account the status field to infer that the call failed and propagates it up to the response, with a correct JSONRPC error instead of the cryptic message "Couldn't parse insights".
It also rewrites the encodings of insights to be a proper type instead of a list (see my comment on the change).
Manually testing the MR
This is purely a refactoring, as such the CI shouldn't break. You can witness the change if you have access to a rollup node with the current instance of Etherlink and run it with the node before and after this patch, using this:
npm exec -- eth repl --network https://node-ore.ghostnet.etherlink.com erc20@0x48B42844aa097fa36baD7461925E875d6dA7F3FB
> https://node-ore.ghostnet.etherlink.com> erc20.methods.transferFrom("0x299bf4974Ee76DCFa8Ee0DFcAcC8FD7CDBcB1046", "0x48B42844aa097fa36baD7461925E875d6dA7F3FB", 1000000000000).call()
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR