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

feat: simulate via tenderly #17

Merged
merged 12 commits into from
Sep 25, 2024
Merged

feat: simulate via tenderly #17

merged 12 commits into from
Sep 25, 2024

Conversation

dohaki
Copy link
Collaborator

@dohaki dohaki commented Sep 24, 2024

Sorry about the size of the PR.. If it's too big, I can try to chunk it up. Just let me know.

Closes ACX-2788

This PR introduces a new custom error object SimulationError which contains custom properties simulationId and simulationUrl. E.g.

SimulationError: deposit simulation failed: The contract function "depositV3" reverted with the following reason:
Dai/insufficient-balance
    at _AcrossClient.simulateDepositTx (/Users/dh.kim/Projects/across/toolkit/packages/sdk/dist/index.mjs:2190:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/Users/dh.kim/Projects/across/toolkit/apps/example/scripts/sdk.ts:264:5) {
  simulationId: '2c1b8806-b59a-49d5-9c8c-d7c8ae4163b6',
  simulationUrl: 'https://www.tdly.co/shared/simulation/2c1b8806-b59a-49d5-9c8c-d7c8ae4163b6'
}

This error gets thrown if the consumer provides Tenderly credentials and opts to use this debugging feature by setting tenderlySimOnError: true.

Copy link

linear bot commented Sep 24, 2024

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
toolkit-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:16pm

@dohaki dohaki requested a review from gsteenkamp89 September 24, 2024 16:36
Copy link
Collaborator

@gsteenkamp89 gsteenkamp89 left a comment

Choose a reason for hiding this comment

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

This is awesome! 👏

packages/sdk/src/client.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@pxrl pxrl left a comment

Choose a reason for hiding this comment

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

This is 👌

apps/example/scripts/sdk.ts Show resolved Hide resolved
apps/example/scripts/sdk.ts Show resolved Hide resolved
packages/sdk/src/actions/getSuggestedFees.ts Outdated Show resolved Hide resolved
packages/sdk/src/actions/simulateDepositTx.ts Show resolved Hide resolved
packages/sdk/src/client.ts Show resolved Hide resolved
@dohaki dohaki merged commit 769f7f7 into master Sep 25, 2024
3 checks passed
@dohaki dohaki deleted the simulate-via-tenderly branch September 25, 2024 15:18
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.

3 participants