js icon indicating copy to clipboard operation
js copied to clipboard

[WIP] Fix custom chain not used

Open MananTank opened this issue 1 year ago • 6 comments

PR-Codex overview

This PR focuses on fixing the issue where the custom chain was not being used in the wallet connections.

Detailed summary

  • Added chain property to wallet connection functions
  • Updated handling of last connected chain
  • Improved chain selection logic in various wallet modules

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

MananTank avatar Apr 12 '24 15:04 MananTank

🦋 Changeset detected

Latest commit: 99fd12fb745ddb3a080a9bf77c359a0ae3fbaf4f

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

This PR includes changesets to release 10 packages
Name Type
thirdweb Patch
@thirdweb-dev/sdk Patch
@thirdweb-dev/cli Patch
@thirdweb-dev/react-core Patch
@thirdweb-dev/react-native Patch
@thirdweb-dev/react Patch
@thirdweb-dev/unity-js-bridge Patch
@thirdweb-dev/wallets Patch
@thirdweb-dev/auth Patch
@thirdweb-dev/react-native-compat 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

changeset-bot[bot] avatar Apr 12 '24 15:04 changeset-bot[bot]

Doing a quick PR to get a dev version - need to test this properly

MananTank avatar Apr 12 '24 15:04 MananTank

/release-pr

MananTank avatar Apr 12 '24 15:04 MananTank

CodSpeed Performance Report

Merging #2768 will not alter performance

Comparing mnn/fix-custom-chain (99fd12f) with main (d7e6671)

Summary

✅ 9 untouched benchmarks

codspeed-hq[bot] avatar Apr 12 '24 15:04 codspeed-hq[bot]

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 38.54 KB (0%) 771 ms (0%) 298 ms (+36.58% 🔺) 1.1 s
thirdweb (cjs) 85.95 KB (0%) 1.8 s (0%) 560 ms (-24.18% 🔽) 2.3 s
thirdweb (minimal + tree-shaking) 4.7 KB (0%) 95 ms (0%) 76 ms (+636.28% 🔺) 170 ms
thirdweb/chains (tree-shaking) 387 B (0%) 10 ms (0%) 24 ms (+320.65% 🔺) 34 ms
thirdweb/react (minimal + tree-shaking) 9.99 KB (+0.38% 🔺) 200 ms (+0.38% 🔺) 49 ms (+198.56% 🔺) 248 ms

github-actions[bot] avatar Apr 12 '24 15:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 76.99%. Comparing base (d7e6671) to head (99fd12f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2768      +/-   ##
==========================================
- Coverage   77.00%   76.99%   -0.02%     
==========================================
  Files         560      560              
  Lines       32425    32431       +6     
  Branches     2833     2833              
==========================================
+ Hits        24968    24969       +1     
- Misses       6793     6798       +5     
  Partials      664      664              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.66% <ø> (ø) Carriedforward from 1c4c94a
packages 82.76% <14.28%> (-0.02%) :arrow_down:

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

Files Coverage Δ
packages/thirdweb/src/wallets/create-wallet.ts 26.17% <14.28%> (-0.11%) :arrow_down:

codecov[bot] avatar Apr 12 '24 15:04 codecov[bot]

@MananTank does this take care of the bug in #2843

jnsdls avatar Apr 23 '24 23:04 jnsdls

Hey @MananTank looking at this now, I think you also need to pass props.chain to <AutoConnect> inside the connect wallet button

gregfromstl avatar Apr 23 '24 23:04 gregfromstl

Hey @MananTank looking at this now, I think you also need to pass props.chain to <AutoConnect> inside the connect wallet button

I'm getting the chain from storage instead ( because props.chain may not be the last connected chain )

MananTank avatar Apr 23 '24 23:04 MananTank