Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add decoded revert reason to response message #224

Merged

Conversation

tgmichel
Copy link
Contributor

@tgmichel tgmichel commented Nov 30, 2020

Rel #218

  • Change the message on ExitError::Revert to VM Exception while processing transaction: revert
  • Tries to decode the UTF8 message data contained in the evm return value and append it as part of a reverted response error.

let message_len = data[36..68].iter().sum::<u8>();
let body: &[u8] = &data[68..68 + message_len as usize];
if let Ok(reason) = std::str::from_utf8(body) {
message = format!("{} {}", message, reason.to_string());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers!

@sorpaas sorpaas merged commit 761bda0 into polkadot-evm:master Nov 30, 2020
@tgmichel tgmichel deleted the tgmichel-revert-reason branch April 1, 2022 09:56
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
* Add decoded revert reason to response message

* Fix checker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants