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

SwitchNetwork now part of IThirdwebWallet #111

Merged
merged 3 commits into from
Dec 25, 2024

Conversation

0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Dec 25, 2024

SmartWallet.SwitchNetwork now also switches underlying wallet network. Also adds SmartWallet.ActiveChain property.


PR-Codex overview

This PR primarily introduces the SwitchNetwork method to several classes, enabling the functionality to change the active network based on a specified chainId. It also includes adjustments to ensure that the active chain ID is consistently handled across different components.

Detailed summary

  • Added SwitchNetwork(BigInteger chainId) method to PrivateKeyWallet and EcosystemWallet.
  • Updated _rpcUrl in ThirdwebRPC to include ClientId.
  • Introduced ActiveChainId property in SmartWallet and replaced instances of _chainId with ActiveChainId.
  • Enhanced SwitchNetwork logic in SmartWallet to handle network switching and related contract updates.
  • Implemented tests for SwitchNetwork functionality in Thirdweb.Wallets.Tests.
  • Commented out existing tests for gasless transactions in ZkSmartWallet.Tests.

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

`SmartWallet.SwitchNetwork` now also switches underlying wallet network.
Also adds `SmartWallet.ActiveChain` property.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 76.11940% with 16 lines in your changes missing coverage. Please review.

Project coverage is 78.07%. Comparing base (3025488) to head (3412a6c).

Files with missing lines Patch % Lines
...irdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs 74.60% 7 Missing and 9 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #111   +/-   ##
=======================================
  Coverage   78.07%   78.07%           
=======================================
  Files          28       28           
  Lines        4684     4698   +14     
  Branches      639      639           
=======================================
+ Hits         3657     3668   +11     
- Misses        853      856    +3     
  Partials      174      174           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@0xFirekeeper 0xFirekeeper merged commit 79f6f92 into main Dec 25, 2024
1 check passed
@0xFirekeeper 0xFirekeeper deleted the firekeeper/switch-network branch December 25, 2024 18:17
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