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

feat: PortfolioView #28593

Merged
merged 417 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
417 commits
Select commit Hold shift + click to select a range
40b36f5
fix: Tweak unit test
gambinish Nov 13, 2024
b24e25a
fix: Tweak unit test
gambinish Nov 13, 2024
18aa7e8
chore: Add low risk selectors to prepare for multichain asset list
gambinish Nov 13, 2024
e127f07
fix: Add unit testable utility in preperation for unified asset list
gambinish Nov 13, 2024
7307904
fix: Revert changes to locales, can't do this in advance
gambinish Nov 13, 2024
b5da71e
fix: Update test id in custom-token-add-approve.spec.js
gambinish Nov 13, 2024
e939574
chore: Remove console.log
gambinish Nov 13, 2024
c71bee0
fix: Update token-sort.spec.ts testid
gambinish Nov 13, 2024
f9fa8da
fix: Update other instances of testid Import
gambinish Nov 13, 2024
d0f53f2
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
jonybur Nov 13, 2024
65c25b1
test fixes, bump, lavamoat fix
jonybur Nov 13, 2024
678ba8c
Fix tests
jonybur Nov 13, 2024
1a1737a
chore: Add new unit test for findAssetByAddress util
gambinish Nov 13, 2024
41adb56
fix: Update nullish search bug in chainSupprotsPricing
gambinish Nov 13, 2024
1237c16
Test fix
jonybur Nov 13, 2024
841aa63
Fix test
jonybur Nov 13, 2024
aa3063f
fix: Lint error in util.test.ts
gambinish Nov 13, 2024
57f8af1
test: [POM] Migrate autodetect and import nft e2e tests to use Page O…
chloeYue Nov 13, 2024
01652f5
test: fix state fixtures race condition (#28421)
seaona Nov 13, 2024
02dba24
feat: btc send flow e2e (#28340)
montelaidev Nov 13, 2024
bc5f345
fix: Default to dApp suggested fees only when user selects the option…
pedronfigueiredo Nov 13, 2024
0055289
Revert "fix: Lint error in util.test.ts"
gambinish Nov 13, 2024
c006bb6
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 13, 2024
25c27ea
fix: @metamask/assets-controllers should be imported before local fil…
gambinish Nov 13, 2024
ce6f520
chore: Merge main, address conflicts
gambinish Nov 13, 2024
de3a412
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
6ceb087
chore: Merge in prep updates to reduces file size diff
gambinish Nov 13, 2024
ae1ea97
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
dcf39fd
fix: Remove duplicate import entry for getCurrentChainId
gambinish Nov 13, 2024
d215c45
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
dedde07
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
d58b91b
Merge branch 'e2e-tests-token-list-aggregated-balance' of github.com:…
gambinish Nov 13, 2024
c2b7058
fix: Snapshot update - padding to edit icon gas button
gambinish Nov 13, 2024
3a2f619
fix: Update snapshots related to pixel padding difference. This may b…
gambinish Nov 13, 2024
0ffa5d0
fix: Revert component library change to ButtonBase
gambinish Nov 13, 2024
7cec54e
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
2e61dfb
fix: After reverting change to component library, reset snapshots to …
gambinish Nov 13, 2024
89b9ffc
fix: Revert margin update to ButtonBase
gambinish Nov 13, 2024
8739893
fix: Continue using optional chaining in useFiatTokenBalance hook
gambinish Nov 13, 2024
760dd6a
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
65bd882
fix: Update snapshots after removing unecessary margin change to Butt…
gambinish Nov 13, 2024
bbc8a2b
fix: NFTs are now also namespaced to currentChainId
gambinish Nov 13, 2024
fc8e334
fix: Update token cell test, by tweaking primary formatWithThreshold …
gambinish Nov 13, 2024
572f998
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 13, 2024
82e1ddd
fix: Update token cell test, by tweaking primary formatWithThreshold …
gambinish Nov 13, 2024
afd98f6
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
5ebc8e4
chore: tweak formatWithThreshold for primary token balance value
gambinish Nov 13, 2024
f48bc66
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
33dabad
fix: Update snapshot for token cell after tweak
gambinish Nov 13, 2024
5b684ad
fix: Update snapshot in token cell unit test
gambinish Nov 13, 2024
3eaed47
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
acc7938
fix: Update mocked action in network-list-menu.test.js
gambinish Nov 13, 2024
21aa0c4
chore: Replace scam token warning logic in token-list-item
gambinish Nov 13, 2024
a2eafbb
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
1dcefd2
chore: update token-list-item snapshot
gambinish Nov 13, 2024
9e7d097
fix: Update unit test for token-list-item related to scam warning
gambinish Nov 13, 2024
11c51aa
chore: Tweak token-list-item isOriginalToken symbol prop
gambinish Nov 13, 2024
be5a8e8
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 13, 2024
5dbf382
fix: Revert lavamoat
gambinish Nov 13, 2024
e7644d3
fix: Revert page models
gambinish Nov 13, 2024
c515109
fix: Revert changes to e2e page object homepage.ts
gambinish Nov 13, 2024
b0ee392
fix: Revert test/e2e/tests/bridge/bridge-button-opens-portfolio.spec.…
gambinish Nov 13, 2024
f1ada18
fix: Revert cross chain aggregate balance test spec
gambinish Nov 13, 2024
21e8cc8
fix: Revert test/e2e/tests/multichain/asset-list.spec.ts to previous
gambinish Nov 13, 2024
61e73af
fix: tokenNetworkFilter should be a preference, not a run time overrid
gambinish Nov 13, 2024
6fa708b
fix: Dont force currency suffix in user-preferenced-currency-display.…
gambinish Nov 13, 2024
bc2f132
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 13, 2024
5e1894a
fix: Revert to default value in usePreferredCurrencyDisplay
gambinish Nov 14, 2024
f474448
chore: Merge develop
gambinish Nov 14, 2024
a29b211
chore: Update legacy gas display unit test
gambinish Nov 14, 2024
01016dc
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
71c8879
fix: Remove suffix constraint
gambinish Nov 14, 2024
4947aba
fix: Update snapshot
gambinish Nov 14, 2024
5fa2984
fix: chore fix otudated snapshot
gambinish Nov 14, 2024
fc0722c
fix: Revert change to token cell snap
gambinish Nov 14, 2024
bf61b33
fix: Tweak snap
gambinish Nov 14, 2024
04c3e3f
fix: troubleshoot whitespace diff
gambinish Nov 14, 2024
ae00656
fix: Troubleshoot whitespace diff
gambinish Nov 14, 2024
d18e085
fix: Troubleshoot whitespace diff
gambinish Nov 14, 2024
c88f3ce
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
43b0cfe
fix: Update showScamWarning to not scam native tokens on multichain t…
gambinish Nov 14, 2024
3d01260
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
c147b3a
fix: Fix behavior of native token click
gambinish Nov 14, 2024
80ac2b8
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
ae01bfc
chore: Merge develop, address conflicts
gambinish Nov 14, 2024
9252c18
chore: Fix undefined bug during token import process causing crash
gambinish Nov 14, 2024
35f6287
fix: When hex balance is 0x0, return zero value
gambinish Nov 14, 2024
8e57813
fix: Cleanup console.log
gambinish Nov 14, 2024
92609df
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
0cb33ba
fix: Update mock state in test to account for new preferences and mul…
gambinish Nov 14, 2024
efa3167
fix: Mock new selectors in token-list-item.test.tsx
gambinish Nov 14, 2024
4c5ac13
fix: Update getCurrencyRates selector in token-cell test, update snap…
gambinish Nov 14, 2024
ec602dc
fix: Add uppercase enforcement to currency suffix to satisfy account-…
gambinish Nov 14, 2024
8444f06
fix: Update expected value from multichain selector for account-list-…
gambinish Nov 14, 2024
a72111d
fix: Update AssetPage unit tests
gambinish Nov 14, 2024
e0b49ed
fix: Do not prematurely return from calculateTokenBalance function
gambinish Nov 14, 2024
7e59b43
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 14, 2024
eeb7e63
fix: Set static arias for randomly generated strings
gambinish Nov 14, 2024
4c272c2
fix: Another dynamic alt tag
gambinish Nov 14, 2024
b9eb5ec
fix: Update mocked state in asset-list.ramps-card.test.js
gambinish Nov 14, 2024
fa37970
fix: Update mock state and background methods for ui/components/multi…
gambinish Nov 14, 2024
fe49771
fix: Update background connection mocks
gambinish Nov 14, 2024
4af2b90
fix: Mock setTokenNetworkFilter action in asset-list.test.tsx
gambinish Nov 14, 2024
ae30e62
fix: Mock useMultiPlling in eth-overview.test.js
gambinish Nov 14, 2024
a506ed2
fix: Mock useMultiPolling in btc-overview.test.tsx
gambinish Nov 14, 2024
e176632
fix: Update expectations for findAssetByAddress on multichain
gambinish Nov 14, 2024
bd9bfc3
fix: Await for after network switch before expecting token click
gambinish Nov 14, 2024
61f4dce
fix: Fix unit tests for useAccountTotalFiatBalance with updated mocks…
gambinish Nov 15, 2024
0a72a62
chore: Merge develop, address conflicts
gambinish Nov 15, 2024
0bee071
fix: Patch updates and NetworkController:state change subscription
gambinish Nov 15, 2024
2df22cb
refactor: Integrate useTokenBalances hook
gambinish Nov 15, 2024
8fdab1a
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 15, 2024
9a2823e
fix: Update asset-list with useMultiPolling hook mock
gambinish Nov 15, 2024
5c4c9b4
chore: Merge develop, address conflicts
gambinish Nov 16, 2024
0e2c013
fix: Address inconsistencies after merge
gambinish Nov 16, 2024
2c7780c
chore: Merge feature branch, adjust unit tests
gambinish Nov 16, 2024
b22b02c
chore: Incorporate e2e fixes from PR 28450
gambinish Nov 18, 2024
8db4d72
fix: Bump vulnerable package cross-spawn to 7.0.5
gambinish Nov 18, 2024
8fe3abf
fix: Update policy
gambinish Nov 18, 2024
aaa978a
chore: Dedupe startPolling methods in metamask-controller
gambinish Nov 18, 2024
bc72f5e
fix: deduplicate
gambinish Nov 18, 2024
60e94a7
fix: Another attempt at cross-spawn upgrade
gambinish Nov 18, 2024
b62fcda
fix: Downgrade cross-spawn version
gambinish Nov 18, 2024
a478875
fix: Lint unused import in selectors.js
gambinish Nov 18, 2024
8bf9eaf
Style fixes
jonybur Nov 18, 2024
17e88ba
fix: Suffix e2e hack
gambinish Nov 18, 2024
3162038
chore: Update snapshots
gambinish Nov 18, 2024
1df49df
fix: Issue 28509 - when navigating to send/swap form a token from a c…
gambinish Nov 19, 2024
bc459c2
fix: Issue 28511 - Show native token symbol in token-list
gambinish Nov 19, 2024
1fff579
fix: Issue 28513 - WHen a network is added, and the network is switch…
gambinish Nov 19, 2024
5980212
fix: Issue 28513: Adding networks should toggle network filter
gambinish Nov 19, 2024
758fa6a
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 19, 2024
8b3d791
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 19, 2024
b4857ce
fix: dedupe controller
gambinish Nov 19, 2024
1b70a71
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 19, 2024
40da45d
fix: Unit tests after merge
gambinish Nov 19, 2024
480584f
fix: Merge after qa-3
gambinish Nov 19, 2024
b947091
fix: Capizalize suffix in currency display
gambinish Nov 19, 2024
f280ff5
fix: Update expectation of capitalized currency suffix
gambinish Nov 19, 2024
3b42f0c
Move refresh list to asset control bar
jonybur Nov 19, 2024
2338fcc
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
jonybur Nov 19, 2024
a8364ff
Style fix
jonybur Nov 19, 2024
4f70ccd
Filter tokens by test-nontest networks
jonybur Nov 19, 2024
da79b45
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 19, 2024
f0d937b
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 19, 2024
73ea683
fix: Refresh List icon moved to another component
gambinish Nov 19, 2024
5b283e0
chore: Tweak unit test
gambinish Nov 19, 2024
a53af55
chore: Rebase, address conflicts
gambinish Nov 19, 2024
b2e9111
fix: Lint
gambinish Nov 19, 2024
86abc08
chore: Update integration test suite to handle SepoliaETH suffix
gambinish Nov 19, 2024
9fa4b96
fix: Import tokens is now a nested click process
gambinish Nov 19, 2024
836c2f5
fix: Dedupde controller polling init
gambinish Nov 19, 2024
e31e63f
fix: Update testId for import token dropdown
gambinish Nov 19, 2024
c47c743
fix: Selector for refresh button is now nested within two clicks
gambinish Nov 19, 2024
7dbc7de
fix: Remove exclusive test
gambinish Nov 19, 2024
c01cd5e
fix: typo in testId
gambinish Nov 19, 2024
704fd6f
fix: typo in test id
gambinish Nov 19, 2024
c19a2ee
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 19, 2024
01e098d
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 19, 2024
2e92c0d
chore: Cleanup
gambinish Nov 19, 2024
dbf60aa
Merge branch 'mmassets-432_network-filter-extension--e2e' of github.c…
gambinish Nov 19, 2024
4eb2da7
fix: Tweak formatWithThreshold
gambinish Nov 19, 2024
c3965fe
fix: Add test data storybook ci
gambinish Nov 19, 2024
33989eb
fix: Tweak code fencing to prevent undefined variables outside of fence
gambinish Nov 19, 2024
85546a0
fix: When new tokens are imported, rerender the token list
gambinish Nov 19, 2024
3273dba
fix: On network change, include newly added network to tokenNetworkFi…
gambinish Nov 20, 2024
136c95c
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 20, 2024
184e83c
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
c1cbb1f
Update LavaMoat policies
metamaskbot Nov 20, 2024
c02257b
fix: Mock dispatch unit tests
gambinish Nov 20, 2024
c850e6a
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
53b7c90
fix: Remove exclusive only test
gambinish Nov 20, 2024
3accb6a
fixed spec file for BTC Account - Overview has balance
NidhiKJha Nov 20, 2024
c3a5f27
nit fix
NidhiKJha Nov 20, 2024
1bdaf8d
fix: Format currency with same format as previous implementation to a…
gambinish Nov 20, 2024
701734c
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 20, 2024
7ee3fd3
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
817c9ba
fix: Map Arbitrum, Linea, and Base native token to ETH logo
gambinish Nov 20, 2024
ce01c11
fix: Lint token-cell.tsx
gambinish Nov 20, 2024
25452e6
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 20, 2024
d702ea0
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
e55b50d
chore: Merge develop, address conflicts
gambinish Nov 20, 2024
72cef22
chore: Rebase with feature branch
gambinish Nov 20, 2024
c048152
chore: Rebase with feature branch
gambinish Nov 20, 2024
f08cbf7
fix: Legitimate fix to custom-token-send-transfer.spec.js made upstre…
gambinish Nov 20, 2024
492960f
fix: Remove exclusive only test
gambinish Nov 20, 2024
a9b16e2
fix: Remove fake loading boolean
gambinish Nov 20, 2024
9123b5c
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 20, 2024
e6ce002
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
675780e
fix: Lint
gambinish Nov 20, 2024
7c744ef
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 20, 2024
8ee5563
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 20, 2024
614b5ff
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 20, 2024
0bbaeb5
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 20, 2024
2c458c5
fix: Typo
gambinish Nov 20, 2024
6e92ee4
chore: Rebase with develop
gambinish Nov 21, 2024
4c5425a
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
d932291
chore: Rebase develop
gambinish Nov 21, 2024
e6b33f5
fix: Revert removal of NativeToken in order to support flask build
gambinish Nov 21, 2024
2f9eab7
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
4c3779d
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
838e4a1
fix: Include nativeToken in props
gambinish Nov 21, 2024
610a15f
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
e51e545
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
00c07aa
chore: Remove patch resolution
gambinish Nov 21, 2024
5b7ea11
fix: Dont remove chokidar
gambinish Nov 21, 2024
0d77e0b
fix: Dedupe controller method
gambinish Nov 21, 2024
d4880c7
fix: Align asset-list-control-bar styles
gambinish Nov 21, 2024
f0d722f
fix: component import
gambinish Nov 21, 2024
035fb5c
fix: Revert token-cell test. Should be fixed in unit test branch, not…
gambinish Nov 21, 2024
0867b5c
chore: Cleanup useAccountTotalFiatBalance hook
gambinish Nov 21, 2024
7f29e11
Merge branch 'develop' into feat/mmassets-432_network-filter-extensio…
gambinish Nov 21, 2024
d19c07c
chore: Rebase
gambinish Nov 21, 2024
a6d01ed
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
2299eed
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
312488a
fix: Update snapshot for token-cell
gambinish Nov 21, 2024
1bda96e
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
5103144
fix: Expect capitalized currency values
gambinish Nov 21, 2024
0149d7a
fix: Remove suffix shennanigans from CurrencyDisplay in favor of prev…
gambinish Nov 21, 2024
7606496
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
a610400
fix: Dont override suffix label
gambinish Nov 21, 2024
e9f14d0
fix: mockEvm account fiat balance snap
gambinish Nov 21, 2024
050d32a
fix: Unskip test
gambinish Nov 21, 2024
650aec5
fix: Lint unused var
gambinish Nov 21, 2024
0b05574
fix: Rebase lint change
gambinish Nov 21, 2024
266e1a0
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
b34ce81
fix: React.CloneElement tells react to return an element in the tree
gambinish Nov 21, 2024
f00b960
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
52a51ad
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
006f12c
fix: Update en locale, loadingTokens no longer needed
gambinish Nov 21, 2024
198fab7
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
246641f
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
4d3aeba
fix: Temporarily log locale string to remove
gambinish Nov 21, 2024
0c8d83c
Merge branch 'feat/mmassets-432_network-filter-extension--integration…
gambinish Nov 21, 2024
f356f4b
Merge branch 'mmassets-432_network-filter-extension--integration-unit…
gambinish Nov 21, 2024
a19a7e1
fix: Revert temp change to btc flask test
gambinish Nov 21, 2024
14a38e0
Merge branch 'mmassets-432_network-filter-extension--e2e' of github.c…
gambinish Nov 21, 2024
328413e
fix: Align upstream branch with flask changes
gambinish Nov 21, 2024
08e61d6
fix: Remove suffix override
gambinish Nov 21, 2024
1a11150
fix: Update snapshots from suffix shenanigans
gambinish Nov 21, 2024
53be791
fix: Remove optional chain diff. We may need to replace this for e2e
gambinish Nov 21, 2024
57cfbe2
fix: typo in e2e selector
gambinish Nov 21, 2024
1b17bec
fix: Fix duped import
gambinish Nov 21, 2024
1a8cb68
fix: Dedupe fixture builder
gambinish Nov 21, 2024
a8de3b2
Merge branch 'develop' into feat/portfolio-view
sahar-fehri Nov 21, 2024
a64e2ff
fix: fix blockexplorer redirection in token details page
sahar-fehri Nov 21, 2024
3612ccb
fix: block explorer link
gambinish Nov 21, 2024
874c372
fix: Block explorer bug, redirect if no explorer present
gambinish Nov 21, 2024
660ed55
fix: Cleanup
gambinish Nov 21, 2024
bc6c4df
chore: Merge main, address conflicts
gambinish Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions shared/constants/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,9 @@ export const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = {
export const CHAIN_ID_TOKEN_IMAGE_MAP = {
[CHAIN_IDS.MAINNET]: ETH_TOKEN_IMAGE_URL,
[CHAIN_IDS.TEST_ETH]: TEST_ETH_TOKEN_IMAGE_URL,
[CHAIN_IDS.ARBITRUM]: ETH_TOKEN_IMAGE_URL,
[CHAIN_IDS.BASE]: ETH_TOKEN_IMAGE_URL,
[CHAIN_IDS.LINEA_MAINNET]: ETH_TOKEN_IMAGE_URL,
[CHAIN_IDS.BSC]: BNB_TOKEN_IMAGE_URL,
[CHAIN_IDS.POLYGON]: POL_TOKEN_IMAGE_URL,
[CHAIN_IDS.AVALANCHE]: AVAX_TOKEN_IMAGE_URL,
Expand Down
5 changes: 4 additions & 1 deletion test/data/mock-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
}
},
"metamask": {
"allTokens": {},
"tokenBalances": {},
"use4ByteResolution": true,
"ipfsGateway": "dweb.link",
"dismissSeedBackUpReminder": false,
Expand Down Expand Up @@ -384,7 +386,8 @@
"key": "tokenFiatAmount",
"order": "dsc",
"sortCallback": "stringNumeric"
}
},
"tokenNetworkFilter": {}
},
"ensResolutionsByAddress": {},
"isAccountMenuOpen": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@
},
"TxController": {
"methodData": "object",
"submitHistory": "object",
"transactions": "object",
"lastFetchedBlockNumbers": "object",
"submitHistory": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"isRedesignedConfirmationsDeveloperEnabled": "boolean",
"showConfirmationAdvancedDetails": false,
"tokenSortConfig": "object",
"tokenNetworkFilter": {},
"showMultiRpcModal": "boolean",
"shouldShowAggregatedBalancePopover": "boolean",
"tokenNetworkFilter": {}
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/tests/privacy-mode/privacy-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Privacy Mode', function () {
async ({ driver }) => {
async function checkForHeaderValue(value) {
const balanceElement = await driver.findElement(
'[data-testid="eth-overview__primary-currency"] .currency-display-component__text',
'[data-testid="account-value-and-suffix"]',
);
const surveyText = await balanceElement.getText();
assert.equal(
Expand All @@ -30,15 +30,15 @@ describe('Privacy Mode', function () {

async function checkForTokenValue(value) {
const balanceElement = await driver.findElement(
'[data-testid="multichain-token-list-item-secondary-value"]',
'[data-testid="multichain-token-list-item-value"]',
);
const surveyText = await balanceElement.getText();
assert.equal(surveyText, value, `Token balance should be "${value}"`);
}

async function checkForPrivacy() {
await checkForHeaderValue('••••••');
await checkForTokenValue('•••••••••');
await checkForTokenValue('••••••');
}

async function checkForNoPrivacy() {
Expand All @@ -48,7 +48,7 @@ describe('Privacy Mode', function () {

async function togglePrivacy() {
const balanceElement = await driver.findElement(
'[data-testid="eth-overview__primary-currency"] .currency-display-component__text',
'[data-testid="account-value-and-suffix"]',
);
const initialText = await balanceElement.getText();

Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Privacy Mode', function () {

async function togglePrivacy() {
const balanceElement = await driver.findElement(
'[data-testid="eth-overview__primary-currency"] .currency-display-component__text',
'[data-testid="account-value-and-suffix"]',
);
const initialText = await balanceElement.getText();

Expand Down
14 changes: 4 additions & 10 deletions test/e2e/tests/tokens/token-sort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ describe('Token List', function () {

assert.ok(tokenSymbolsBeforeSorting[0].includes('Ethereum'));

await await driver.clickElement(
'[data-testid="sort-by-popover-toggle"]',
);
await await driver.clickElement('[data-testid="sortByAlphabetically"]');
await driver.clickElement('[data-testid="sort-by-popover-toggle"]');
await driver.clickElement('[data-testid="sortByAlphabetically"]');

await driver.delay(regularDelayMs);
const tokenListAfterSortingAlphabetically = await driver.findElements(
Expand All @@ -85,12 +83,8 @@ describe('Token List', function () {
tokenListSymbolsAfterSortingAlphabetically[0].includes('ABC'),
);

await await driver.clickElement(
'[data-testid="sort-by-popover-toggle"]',
);
await await driver.clickElement(
'[data-testid="sortByDecliningBalance"]',
);
await driver.clickElement('[data-testid="sort-by-popover-toggle"]');
await driver.clickElement('[data-testid="sortByDecliningBalance"]');

await driver.delay(regularDelayMs);
const tokenListBeforeSortingByDecliningBalance =
Expand Down
1 change: 1 addition & 0 deletions test/jest/mock-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export const createSwapsMockStore = () => {
preferences: {
showFiatInTestnets: true,
smartTransactionsOptInStatus: true,
tokenNetworkFilter: {},
showMultiRpcModal: false,
},
transactions: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => {
}, [currentNetwork.chainId, TEST_CHAINS]);

const allOpts: Record<string, boolean> = {};
Object.keys(allNetworks).forEach((chainId) => {
Object.keys(allNetworks || {}).forEach((chainId) => {
allOpts[chainId] = true;
});

const allNetworksFilterShown =
Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts).length;
Object.keys(tokenNetworkFilter || {}).length !==
Object.keys(allOpts || {}).length;

useEffect(() => {
if (isTestNetwork) {
Expand All @@ -86,7 +87,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => {
// We need to set the default filter for all users to be all included networks, rather than defaulting to empty object
// This effect is to unblock and derisk in the short-term
useEffect(() => {
if (Object.keys(tokenNetworkFilter).length === 0) {
if (Object.keys(tokenNetworkFilter || {}).length === 0) {
dispatch(setTokenNetworkFilter(allOpts));
}
}, []);
Expand Down Expand Up @@ -162,7 +163,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => {
>
{process.env.PORTFOLIO_VIEW && (
<ButtonBase
data-testid="network-filter"
data-testid="sort-by-networks"
variant={TextVariant.bodyMdMedium}
className="asset-list-control-bar__button asset-list-control-bar__network_control"
onClick={toggleNetworkFilterPopover}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ const render = (
[selectedInternalAccount.address]: { balance },
},
},
preferences: {
tokenNetworkFilter: {},
tokenSortConfig: {
key: 'token-sort-key',
order: 'dsc',
sortCallback: 'stringNumeric',
},
},
allTokens: {},
tokenBalances: {},
},
};
const store = configureStore(state);
Expand Down
4 changes: 3 additions & 1 deletion ui/components/app/assets/asset-list/asset-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ const AssetList = ({ onClickAsset, showTokensLinks }: AssetListProps) => {
)}
<AssetListControlBar showTokensLinks={shouldShowTokensLinks} />
<TokenList
nativeToken={<NativeToken onClickAsset={onClickAsset} />}
// nativeToken is still needed to avoid breaking flask build's support for bitcoin
// TODO: refactor this to no longer be needed for non-evm chains
nativeToken={!isEvm && <NativeToken onClickAsset={onClickAsset} />}
onTokenClick={(chainId: string, tokenAddress: string) => {
onClickAsset(chainId, tokenAddress);
trackEvent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ import {
} from '../../../../../selectors/multichain';
import { getPreferences } from '../../../../../selectors';
import { TokenListItem } from '../../../../multichain';
import { useIsOriginalNativeTokenSymbol } from '../../../../../hooks/useIsOriginalNativeTokenSymbol';
import { AssetListProps } from '../asset-list';
import { useNativeTokenBalance } from './use-native-token-balance';

const NativeToken = ({ onClickAsset }: AssetListProps) => {
const nativeCurrency = useSelector(getMultichainNativeCurrency);
const isMainnet = useSelector(getMultichainIsMainnet);
const { chainId, ticker, type, rpcUrl } = useSelector(
getMultichainCurrentNetwork,
);
const { chainId } = useSelector(getMultichainCurrentNetwork);
const { privacyMode } = useSelector(getPreferences);
const isOriginalNativeSymbol = useIsOriginalNativeTokenSymbol(
chainId,
ticker,
type,
rpcUrl,
);
const balance = useSelector(getMultichainSelectedAccountCachedBalance);
const balanceIsLoading = !balance;

Expand All @@ -50,7 +41,6 @@ const NativeToken = ({ onClickAsset }: AssetListProps) => {
tokenSymbol={symbol}
secondary={secondary}
tokenImage={balanceIsLoading ? null : primaryTokenImage}
isOriginalTokenSymbol={isOriginalNativeSymbol}
isNativeCurrency
isStakeable={isStakeable}
showPercentage
Expand Down
Loading
Loading