Skip to content

Commit

Permalink
Merge branch 'develop' into currency-display-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
NidhiKJha authored Jul 14, 2023
2 parents 987d548 + 751120b commit 48ded7b
Show file tree
Hide file tree
Showing 34 changed files with 329 additions and 306 deletions.
4 changes: 4 additions & 0 deletions .iyarc
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ GHSA-p8p7-x288-28g6
# Not easily patched
# Minimal risk to us because we're using lockdown which also prevents this case of prototype pollution
GHSA-h755-8qp9-cq85

# tough-cookie
# this will go away soon when we get rid of web3-provider-engine
GHSA-72xf-g2v4-qvf3
22 changes: 1 addition & 21 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
Expand All @@ -1642,26 +1642,6 @@
"superstruct": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": {
"globals": {
"URL": true,
"btoa": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>pify": true,
"@metamask/safe-event-emitter": true,
"browserify>browser-resolve": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"lavamoat>json-stable-stringify": true,
"vinyl>clone": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/safe-event-emitter": true,
Expand Down
22 changes: 1 addition & 21 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
Expand All @@ -1768,26 +1768,6 @@
"superstruct": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": {
"globals": {
"URL": true,
"btoa": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>pify": true,
"@metamask/safe-event-emitter": true,
"browserify>browser-resolve": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"lavamoat>json-stable-stringify": true,
"vinyl>clone": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/safe-event-emitter": true,
Expand Down
22 changes: 1 addition & 21 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
Expand All @@ -1768,26 +1768,6 @@
"superstruct": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": {
"globals": {
"URL": true,
"btoa": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>pify": true,
"@metamask/safe-event-emitter": true,
"browserify>browser-resolve": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"lavamoat>json-stable-stringify": true,
"vinyl>clone": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/safe-event-emitter": true,
Expand Down
22 changes: 1 addition & 21 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
Expand All @@ -1642,26 +1642,6 @@
"superstruct": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": {
"globals": {
"URL": true,
"btoa": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>pify": true,
"@metamask/safe-event-emitter": true,
"browserify>browser-resolve": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"lavamoat>json-stable-stringify": true,
"vinyl>clone": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/safe-event-emitter": true,
Expand Down
22 changes: 1 addition & 21 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
Expand All @@ -1870,26 +1870,6 @@
"superstruct": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": {
"globals": {
"URL": true,
"btoa": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>pify": true,
"@metamask/safe-event-emitter": true,
"browserify>browser-resolve": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"lavamoat>json-stable-stringify": true,
"vinyl>clone": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/safe-event-emitter": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"@metamask/base-controller": "^3.1.0",
"@metamask/browser-passworder": "^4.1.0",
"@metamask/contract-metadata": "^2.3.1",
"@metamask/controller-utils": "^4.1.0",
"@metamask/controller-utils": "^4.2.0",
"@metamask/design-tokens": "^1.12.0",
"@metamask/desktop": "^0.3.0",
"@metamask/eth-json-rpc-middleware": "^11.0.0",
Expand All @@ -248,7 +248,7 @@
"@metamask/logo": "^3.1.1",
"@metamask/message-manager": "^7.0.2",
"@metamask/metamask-eth-abis": "^3.0.0",
"@metamask/network-controller": "^10.3.0",
"@metamask/network-controller": "^10.3.1",
"@metamask/notification-controller": "^3.0.0",
"@metamask/obs-store": "^8.1.0",
"@metamask/permission-controller": "^4.0.0",
Expand Down
13 changes: 11 additions & 2 deletions test/data/mock-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,22 @@
"type": "rpc",
"chainId": "0x5",
"ticker": "ETH",
"id": "testNetworkConfigurationId"
"id": "chain5"
},
"networkConfigurations": {
"testNetworkConfigurationId": {
"rpcUrl": "https://testrpc.com",
"chainId": "0x1",
"nickname": "Custom Mainnet RPC"
"nickname": "Custom Mainnet RPC",
"type": "rpc",
"id": "testNetworkConfigurationId"
},
"chain5": {
"type": "rpc",
"chainId": "0x5",
"ticker": "ETH",
"nickname": "Chain 5",
"id": "chain5"
}
},
"keyrings": [
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function defaultFixture() {
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
type: 'rpc',
id: 'networkConfigurationId',
},
networkConfigurations: {
networkConfigurationId: {
Expand Down Expand Up @@ -346,6 +347,7 @@ function onboardingFixture() {
rpcUrl: 'http://localhost:8545',
chainId: CHAIN_IDS.LOCALHOST,
nickname: 'Localhost 8545',
id: 'networkConfigurationId',
},
networkConfigurations: {
networkConfigurationId: {
Expand All @@ -355,6 +357,7 @@ function onboardingFixture() {
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
networkConfigurationId: 'networkConfigurationId',
type: 'rpc',
},
},
},
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/tests/custom-rpc-history.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,21 @@ describe('Stores custom RPC history', function () {
fixtures: new FixtureBuilder()
.withNetworkController({
networkConfigurations: {
networkConfigurationId: {
networkConfigurationIdOne: {
rpcUrl: 'http://127.0.0.1:8545/1',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/1',
rpcPrefs: {},
type: 'rpc',
},
networkConfigurationId2: {
networkConfigurationIdTwo: {
rpcUrl: 'http://127.0.0.1:8545/2',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/2',
rpcPrefs: {},
type: 'rpc',
},
},
})
Expand Down Expand Up @@ -248,14 +250,14 @@ describe('Stores custom RPC history', function () {
fixtures: new FixtureBuilder()
.withNetworkController({
networkConfigurations: {
networkConfigurationId: {
networkConfigurationIdOne: {
rpcUrl: 'http://127.0.0.1:8545/1',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/1',
rpcPrefs: {},
},
networkConfigurationId2: {
networkConfigurationIdTwo: {
rpcUrl: 'http://127.0.0.1:8545/2',
chainId: '0x539',
ticker: 'ETH',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = `
class="box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network nft-item__network-badge mm-text--body-sm mm-text--text-transform-uppercase box--display-flex box--flex-direction-row box--justify-content-center box--align-items-center box--color-text-default box--background-color-background-alternative box--rounded-full box--border-color-background-default box--border-width-2 box--border-style-solid"
data-testid="nft-network-badge"
>
G
C
</div>
</div>
</div>
Expand Down
18 changes: 16 additions & 2 deletions ui/components/app/nft-details/nft-details.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import {
removeAndIgnoreNft,
setRemoveNftMessage,
} from '../../../store/actions';
import {
CHAIN_IDS,
CURRENCY_SYMBOLS,
MAINNET_DISPLAY_NAME,
NETWORK_TYPES,
} from '../../../../shared/constants/network';
import NftDetails from './nft-details';

jest.mock('copy-to-clipboard');
Expand Down Expand Up @@ -172,7 +178,10 @@ describe('NFT Details', () => {
metamask: {
...mockState.metamask,
providerConfig: {
chainId: '0x1',
chainId: CHAIN_IDS.MAINNET,
type: NETWORK_TYPES.MAINNET,
ticker: CURRENCY_SYMBOLS.ETH,
nickname: MAINNET_DISPLAY_NAME,
},
},
};
Expand Down Expand Up @@ -203,12 +212,16 @@ describe('NFT Details', () => {
...mockState.metamask,
providerConfig: {
chainId: '0x89',
type: 'rpc',
id: 'custom-mainnet',
},
networkConfigurations: {
testNetworkConfigurationId: {
rpcUrl: 'https://testrpc.com',
chainId: '0x89',
nickname: 'Custom Mainnet RPC',
type: 'rpc',
id: 'custom-mainnet',
},
},
},
Expand Down Expand Up @@ -239,7 +252,8 @@ describe('NFT Details', () => {
metamask: {
...mockState.metamask,
providerConfig: {
chainId: '0xaa36a7',
chainId: CHAIN_IDS.SEPOLIA,
type: NETWORK_TYPES.SEPOLIA,
},
},
};
Expand Down
Loading

0 comments on commit 48ded7b

Please sign in to comment.