Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

ContractError::Revert excludes message and error code #2186

Open
mattsse opened this issue Feb 24, 2023 · 0 comments
Open

ContractError::Revert excludes message and error code #2186

mattsse opened this issue Feb 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mattsse
Copy link
Collaborator

mattsse commented Feb 24, 2023

opening this to track

#2172 introduced ContractError::Revert,

the from_middleware_err functions only extracts the data:

if let Some(data) = e.as_error_response().and_then(JsonRpcError::as_revert_data) {

but the message and error code can contain additional context besides "reverted".

Suggestion:

  • add RevertErr(JsonRpcError) new type that is used by the Revert
  • custom impl Display for RevertErr with attempt to decode revert data

@prestwich

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant