-
Notifications
You must be signed in to change notification settings - Fork 57
feat(rn_cli_wallet): migrate ethers v5 → v6 #561
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ad1d93f
feat(rn_cli_wallet): migrate ethers v5 -> v6
ignaciosantise ea00983
chore(rn_cli_wallet): pin ethers to 6.13.5
ignaciosantise 9fcfaf2
fix(rn_cli_wallet): use ?? for v6 bigint fee fields; update AGENTS.md…
ignaciosantise 7c8b6da
Merge branch 'main' into feat/rn_cli_wallet-ethers6-migration
ignaciosantise 9c081f8
fix(rn_cli_wallet): use explicit null checks for bigint fees in build…
ignaciosantise b90a9dd
Merge branch 'main' into feat/rn_cli_wallet-ethers6-migration
ignaciosantise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file removed
BIN
-10.3 KB
wallets/rn_cli_wallet/.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // Regression test for the ethers v6 + valtio interaction: setWallet() must | ||
| // ref() the wallet, else valtio's proxy corrupts ethers v6's private | ||
| // #signingKey and breaks signing from the shared eip155Wallets instance. | ||
|
|
||
| // SettingsStore transitively pulls in react-native-mmkv (native). Stub it. | ||
| jest.mock('react-native-mmkv', () => ({ | ||
| MMKV: class { | ||
| getString() { | ||
| return undefined; | ||
| } | ||
| set() {} | ||
| delete() {} | ||
| getAllKeys() { | ||
| return []; | ||
| } | ||
| }, | ||
| })); | ||
|
|
||
| import EIP155Lib from '../src/lib/EIP155Lib'; | ||
| import SettingsStore from '../src/store/SettingsStore'; | ||
|
|
||
| const TYPED_DATA = { | ||
| domain: { | ||
| name: 'Test', | ||
| version: '1', | ||
| chainId: 1, | ||
| verifyingContract: '0x0000000000000000000000000000000000000001', | ||
| }, | ||
| types: { Msg: [{ name: 'value', type: 'string' }] }, | ||
| message: { value: 'hello' }, | ||
| }; | ||
|
|
||
| describe('SettingsStore wallet storage (ethers v6 + valtio)', () => { | ||
| it('keeps the EVM wallet usable for signing after setWallet()', async () => { | ||
| const lib = EIP155Lib.init({}); | ||
|
|
||
| // Mirrors useInitializeWalletKit: the same instance lives in the | ||
| // eip155Wallets map AND is stored in SettingsStore. | ||
| SettingsStore.setWallet(lib); | ||
|
|
||
| // PaymentStore signs using the instance from the raw map. Without ref() | ||
| // this throws "Cannot read private member #signingKey". | ||
| const signature = await lib._signTypedData( | ||
| TYPED_DATA.domain, | ||
| TYPED_DATA.types, | ||
| TYPED_DATA.message, | ||
| ); | ||
|
|
||
| expect(signature).toMatch(/^0x[0-9a-fA-F]+$/); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.