Skip to content

[SDK] Fix: Use transaction-specified chain in smart account #5865

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

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Dec 31, 2024

PR-Codex overview

This PR focuses on fixing chain switching in smart account transactions, allowing transactions to be executed on different chains. It also adds tests to ensure this functionality works as expected.

Detailed summary

  • Updated accountContract to accountContractForTransaction for chain-specific transactions.
  • Introduced a new test to verify sending transactions on another chain in smart-wallet-integration.test.ts.
  • Added a similar test in smart-wallet-integration-v07.test.ts for consistency.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@gregfromstl gregfromstl requested review from a team as code owners December 31, 2024 22:18
Copy link

linear bot commented Dec 31, 2024

Copy link

vercel bot commented Dec 31, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 1:45am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 1:45am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 1:45am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 1:45am

Copy link

changeset-bot bot commented Dec 31, 2024

🦋 Changeset detected

Latest commit: a9547c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

graphite-app bot commented Dec 31, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 31, 2024
Copy link
Contributor

github-actions bot commented Dec 31, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.09 KB (0%) 902 ms (0%) 321 ms (+22.34% 🔺) 1.3 s
thirdweb (cjs) 110.84 KB (0%) 2.3 s (0%) 545 ms (+15.48% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 137 ms (+299.96% 🔺) 249 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 49 ms (+103.54% 🔺) 59 ms
thirdweb/react (minimal + tree-shaking) 19.12 KB (0%) 383 ms (0%) 149 ms (+184.97% 🔺) 531 ms

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.19%. Comparing base (6c5594b) to head (a9547c5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5865   +/-   ##
=======================================
  Coverage   55.18%   55.19%           
=======================================
  Files        1123     1123           
  Lines       59611    59622   +11     
  Branches     5031     5029    -2     
=======================================
+ Hits        32895    32906   +11     
  Misses      25996    25996           
  Partials      720      720           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 6c5594b
packages 52.84% <100.00%> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/thirdweb/src/wallets/smart/index.ts 57.54% <100.00%> (+1.22%) ⬆️

Copy link
Member Author

gregfromstl commented Jan 2, 2025

Merge activity

  • Jan 1, 8:35 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 1, 8:35 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 1, 8:45 PM EST: A user merged this pull request with the Graphite merge queue.

<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on fixing chain switching in smart account transactions within the `thirdweb` SDK and adding tests for sending transactions across different chains.

### Detailed summary
- Updated the logic for `accountContract` in `packages/thirdweb/src/wallets/smart/index.ts` to handle chain switching.
- Added a new test in `packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts` to verify sending transactions on another chain.
- Introduced similar test functionality in `packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@gregfromstl gregfromstl force-pushed the greg/tool-2888-sdk-switch-to-correct-chain-for-smart-account-transaction branch from 76ca41d to a9547c5 Compare January 2, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants