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

Refine view of popup for reverted tx #4626

Merged
merged 1 commit into from
Sep 15, 2021
Merged

Conversation

nikitosing
Copy link
Member

@nikitosing nikitosing commented Sep 9, 2021

Close #4506

Changelog

Enhancements

  • Cut error message in case of reverted tx
  • Change title of popup message

image

Checklist for your Pull Request (PR)

@nikitosing nikitosing force-pushed the np-refine-view-error-tx branch 2 times, most recently from 23cc0d1 to f1b4399 Compare September 9, 2021 21:23
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

I suggest displaying the value of error property in the message and text after Error: and before { in the title of the popup.

In case of this response:

Error: Transaction has been reverted by the EVM:
{
  "transactionHash": "0x9a692646d37e4ae600110ee417350e0a5f9ceda27baa8cd57985f15f52f3025c",
  "transactionIndex": 0,
  "blockHash": "0x20d379795ecd7aa58df04699ba9b9047fda96cdfd2aacffd08f1e948abef48dc",
  "blockNumber": 22684317,
  "cumulativeGasUsed": 21925,
  "gasUsed": 21925,
  "effectiveGasPrice": "0x4a817c800",
  "from": "0xf36045454f66c7318adcddf3b801e3bf8cfbc6a1",
  "to": "0x0def93bcd70dab8932447275c5f2b8fcba0c005e",
  "contractAddress": null,
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "error": "Reverted 0x50289a9f0000000000000000000000000def93bcd70dab8932447275c5f2b8fcba0c005e0000000000000000000000000000000000000000000000000000000000000002",
  "type": "0x0",
  "events": {}
}
  • title would be Transaction has been reverted by the EVM
  • message would be Reverted 0x50289a9f0000000000000000000000000def93bcd70dab8932447275c5f2b8fcba0c005e0000000000000000000000000000000000000000000000000000000000000002.

Ideally, we should decode the error. But probably, it is better to implement in a separate PR.

@nikitosing nikitosing force-pushed the np-refine-view-error-tx branch 2 times, most recently from 6a5857a to bf031f2 Compare September 13, 2021 05:54
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

I am getting this error in Chrome Developer tools console if I'm rejecting transaction and popup never appears.

Screenshot 2021-09-13 at 12 29 09

@nikitosing nikitosing force-pushed the np-refine-view-error-tx branch 3 times, most recently from 23033c6 to 049b55a Compare September 14, 2021 12:08
@vbaranov vbaranov merged commit 6de856e into master Sep 15, 2021
@vbaranov vbaranov deleted the np-refine-view-error-tx branch September 15, 2021 08:04
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.

Refine view of popup for reverted tx
2 participants