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

Handle error states for when txn simulation is not yet supported for a network #1795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jinchung
Copy link
Member

@jinchung jinchung commented Dec 21, 2024

Fixes BX-1733

What changed (plus any additional context for devs)

  • This is a non-urgent PR but good to have for future networks we want to support that might not have transaction simulation support. In this scenario, the simulation response does not return the data that we expect, and we were trying to index into nonexistent simulation data. Updated for both transaction and message simulation paths.
  • You won't be able to test this out as of now, as we've turned on transaction simulation support for Ink, so you'll only see the success state. Locally, I tested with a "fake" bad response that was the same as what we were previously getting before Ink support was turned on.

Screen recordings / screenshots

Screen recordings for the resolved state can be seen on the associated Linear ticket.

Copy link

linear bot commented Dec 21, 2024

@@ -125,6 +125,9 @@ export const useSimulateTransaction = ({
domain,
},
)) as TransactionSimulationResponse;

if (!response?.simulateTransactions?.[0]) throw 'UNSUPPORTED';
Copy link
Member Author

Choose a reason for hiding this comment

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

throwing the TransactionSimulationError type of UNSUPPORTED so that the response behaves as expected with the simulation overview etc (having an error but not a simulation response)

@jinchung jinchung changed the title @jin/dapp gas error Handle error states for when txn simulation is not yet supported for a network Dec 21, 2024
Copy link
Contributor

@greg-schrammel greg-schrammel left a comment

Choose a reason for hiding this comment

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

nice! I assume we correctly handle 'UNSUPPORTED' elsewhere

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