-
Notifications
You must be signed in to change notification settings - Fork 199
feat: bump ethers to v6 #6224
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
feat: bump ethers to v6 #6224
Changes from 62 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
7536f77
[skip ci] wip: bump ethers to v6
gomesalexandre 6704547
feat: fragments bs
gomesalexandre 4c1223f
feat: almost there
gomesalexandre f87a43d
feat: almost there
gomesalexandre a992e5e
fix: all types
gomesalexandre d646d52
feat: start migrating unchained-client to v6
gomesalexandre 0674d03
feat: enforce unchained-client to workspace version
gomesalexandre 6d0c7d3
feat: more resolutions enforcement
gomesalexandre 2a0036c
fix: derp mocks
gomesalexandre 450e971
fix: many tests
gomesalexandre 8162f43
fix: most tests
gomesalexandre ddfae0e
fix: all tests
gomesalexandre 20ee753
feat: yarn v5 aliased node_module
gomesalexandre 2563e79
feat: don't install ethers as direct dep in unchained-client
gomesalexandre 6d576d0
feat: cleanup package.json monkey patch
gomesalexandre 8c0af33
feat: bring back v6 resolution in unchained-client
gomesalexandre 566db58
feat: default export shenanigans
gomesalexandre dc47e9c
fix: uni-v2 DeFi opportunities resolver
gomesalexandre 4531a5f
feat: revert console log
gomesalexandre b8d75f6
fix: ci
gomesalexandre 8588b38
fix: derp
gomesalexandre dae0541
fix: investor-foxy access .target vs. .address
gomesalexandre 7543a79
feat: more BigInt / bignumber.js shenanigans
gomesalexandre 69e599f
feat: everything is saner with types
gomesalexandre d877645
fix: tests
gomesalexandre e19e201
Merge remote-tracking branch 'origin/develop' into feat_ethers_v6
gomesalexandre db30dd5
feat: temporarily exclude tests
gomesalexandre c057be8
Merge branch 'develop' into feat_ethers_v6
gomesalexandre e711535
feat: import zeroAddress from viem
gomesalexandre ee8e6c3
feat: viem getAddress
gomesalexandre efc5f1b
feat: viem isHex
gomesalexandre 6d83357
feat: viem isAddress
gomesalexandre a526412
feat: viem toHex
gomesalexandre 5ed9d65
feat: viem hexlify -> toHex
gomesalexandre 57bcfca
feat: viem stringToBytes
gomesalexandre 604bf05
feat: viem keccak256
gomesalexandre 214c676
feat: cleanup
gomesalexandre c28d394
Merge remote-tracking branch 'origin/develop' into feat_ethers_v6
gomesalexandre b8919ab
fix tests and remove mock
kaladinlight 89dab36
utils.ts @ethersproject -> ethers
kaladinlight 37884a5
feat: viem stringToBytes
gomesalexandre 7e2f644
feat: viem keccak256
gomesalexandre 24becf9
feat: cleanup
gomesalexandre 807ce48
fix: use correct account id for matching buy account (#6263)
kaladinlight b50b749
Merge branch 'main' into develop (#6271)
0xApotheosis 0882ccb
feat: enable chain selection for assets (#6176)
woodenfurniture 5e87fd1
chore: add 'remove liquidity' fees (#6175)
0xApotheosis 4fa2c10
chore: wire remove liquidity confirm page (#6266)
0xApotheosis f7add3a
fix: merge
gomesalexandre 5fb8d20
Merge remote-tracking branch 'origin/develop' into feat_ethers_v6
gomesalexandre 043cbbf
remove remaining copy pasta mocks
kaladinlight 27e1d9f
Merge branch 'feat_ethers_v6' of github.com:shapeshift/web into feat_…
kaladinlight ceca8eb
unchained-client cleanup
kaladinlight 486af28
use v5 alias for yearn
kaladinlight fcfde46
remove extra getAddress calls
kaladinlight dfc9511
static provider
kaladinlight ba37703
mock works now
kaladinlight 1ed5765
use viem cleanup
kaladinlight 772b1ad
final ethers -> viem updates
kaladinlight e40efe1
update yarn lock
kaladinlight 1cb3680
Merge branch 'develop' into feat_ethers_v6
kaladinlight 965f432
Merge branch 'develop' into feat_ethers_v6
gomesalexandre 009a04a
feat: toHex from string without intermediary bytes
gomesalexandre fbb0f62
feat: big brain no-useless-cast
gomesalexandre 4832335
feat: 0n shorthand without BigInt constructor
gomesalexandre 576b69a
feat: no-useless-getAddress on zeroAddress
gomesalexandre c5010e1
fix: lint
gomesalexandre bc842a4
Merge branch 'develop' into feat_ethers_v6
gomesalexandre 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
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 |
|---|---|---|
| @@ -1,72 +1,54 @@ | ||
| import { | ||
| BigNumber, | ||
| Bytes, | ||
| BytesLike, | ||
| ethers, | ||
| providers, | ||
| Signature, | ||
| Signer, | ||
| UnsignedTransaction, | ||
| utils, | ||
| } from 'ethers' | ||
| import { ethers } from 'ethers' | ||
| import { vi } from 'vitest' | ||
|
|
||
| const Contract = vi.fn().mockImplementation(address => ({ | ||
| decimals: () => { | ||
| switch (address as string) { | ||
| case '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': | ||
| return 6 | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 18 | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 18 | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 18 | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| name: () => { | ||
| switch (address as string) { | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 'FOX' | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 'Uniswap V2' | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 'Wrapped Ether' | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| symbol: () => { | ||
| switch (address as string) { | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 'FOX' | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 'UNI-V2' | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 'WETH' | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| })) | ||
|
|
||
| const JsonRpcProvider = vi.fn() | ||
|
|
||
| const ethersMock = { | ||
| ...ethers, | ||
| providers: { | ||
| JsonRpcProvider: vi.fn(), | ||
| StaticJsonRpcProvider: vi.fn(), | ||
| }, | ||
| Contract: vi.fn().mockImplementation(address => ({ | ||
| decimals: () => { | ||
| switch (address as string) { | ||
| case '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': | ||
| return 6 | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 18 | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 18 | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 18 | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| name: () => { | ||
| switch (address as string) { | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 'FOX' | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 'Uniswap V2' | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 'Wrapped Ether' | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| symbol: () => { | ||
| switch (address as string) { | ||
| case '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d': | ||
| return 'FOX' | ||
| case '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c': | ||
| return 'UNI-V2' | ||
| case '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': | ||
| return 'WETH' | ||
| default: | ||
| throw new Error(`no decimals mock for address: ${address}`) | ||
| } | ||
| }, | ||
| })), | ||
| JsonRpcProvider, | ||
| Contract, | ||
| } | ||
|
|
||
| export { | ||
| ethersMock as ethers, | ||
| BigNumber, | ||
| Bytes, | ||
| BytesLike, | ||
| Signature, | ||
| Signer, | ||
| UnsignedTransaction, | ||
| providers, | ||
| utils, | ||
| } | ||
| export * from 'ethers' | ||
| export { ethersMock as ethers, Contract, JsonRpcProvider } |
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/bnbsmartchain/parser/abi/bep20.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/foxyStaking.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/shapeShiftRouter.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/thorAvalanche.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/thorEthereum.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/uniV2.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/uniV2StakingRewards.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/weth.ts
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
4 changes: 2 additions & 2 deletions
4
packages/unchained-client/src/evm/ethereum/parser/abi/yearnVault.ts
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.
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.