From c477e293978806804b02b24cae72328c91273779 Mon Sep 17 00:00:00 2001 From: Filip Sekulic Date: Tue, 14 Mar 2023 18:29:31 +0100 Subject: [PATCH 001/129] Fixed hardware wallet info popup on token allowance screen (#17881) --- ui/pages/token-allowance/token-allowance.js | 8 ++++ .../token-allowance/token-allowance.test.js | 46 ++++++++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/ui/pages/token-allowance/token-allowance.js b/ui/pages/token-allowance/token-allowance.js index d96599493..5aed6bde7 100644 --- a/ui/pages/token-allowance/token-allowance.js +++ b/ui/pages/token-allowance/token-allowance.js @@ -35,6 +35,7 @@ import { getUnapprovedTxCount, getUnapprovedTransactions, getUseCurrencyRateCheck, + isHardwareWallet, } from '../../selectors'; import { NETWORK_TO_NAME_MAP } from '../../../shared/constants/network'; import { @@ -62,6 +63,7 @@ import { ConfirmPageContainerNavigation } from '../../components/app/confirm-pag import { useSimulationFailureWarning } from '../../hooks/useSimulationFailureWarning'; import SimulationErrorMessage from '../../components/ui/simulation-error-message'; import { Icon, ICON_NAMES } from '../../components/component-library'; +import LedgerInstructionField from '../../components/app/ledger-instruction-field/ledger-instruction-field'; export default function TokenAllowance({ origin, @@ -111,6 +113,7 @@ export default function TokenAllowance({ const unapprovedTxCount = useSelector(getUnapprovedTxCount); const unapprovedTxs = useSelector(getUnapprovedTransactions); const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck); + const isHardwareWalletConnected = useSelector(isHardwareWallet); const replaceCommaToDot = (inputValue) => { return inputValue.replace(/,/gu, '.'); @@ -491,6 +494,11 @@ export default function TokenAllowance({ ) : null} + {!isFirstPage && isHardwareWalletConnected && ( + + + + )} { fireEvent.click(gotIt); expect(gotIt).not.toBeInTheDocument(); }); + + it('should show hardware wallet info text', () => { + const { queryByText, getByText, getByTestId } = renderWithProvider( + , + store, + ); + + const textField = getByTestId('custom-spending-cap-input'); + fireEvent.change(textField, { target: { value: '1' } }); + + expect(queryByText('Prior to clicking confirm:')).toBeNull(); + + const nextButton = getByText('Next'); + fireEvent.click(nextButton); + + expect(queryByText('Prior to clicking confirm:')).toBeInTheDocument(); + }); + + it('should not show hardware wallet info text', () => { + const { queryByText } = renderWithProvider( + , + store, + ); + + expect(queryByText('Prior to clicking confirm:')).toBeNull(); + }); }); From 5468c2c14219420eba4643df577d8f6be0d11847 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Tue, 14 Mar 2023 11:31:19 -0700 Subject: [PATCH 002/129] Fix disabled 'eth_sign' event & add 'Request Disabled' event type (#18007) * Fix #17974 / add REQUEST_DISABLED event * RPCMiddleware: add eth_sign REQUEST_DISABLED test * don't call Signature Request for disabled eth_sign * clean: alphabetize * clean: rn isDisabledRequest -> isDisabledRPCMethod * fix test * rpc middeware: add eth_sign comment * fix eth_sign events and re-add Signature Request * send 'Signature Failed' for disabled eth_sigh --- .../lib/createRPCMethodTrackingMiddleware.js | 25 ++++++++++++---- .../createRPCMethodTrackingMiddleware.test.js | 30 +++++++++++++++++++ shared/constants/metametrics.js | 1 + 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.js index 9073a26c3..e1376ae1e 100644 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.js +++ b/app/scripts/lib/createRPCMethodTrackingMiddleware.js @@ -1,3 +1,4 @@ +import { errorCodes } from 'eth-rpc-errors'; import { MESSAGE_TYPE, ORIGIN_METAMASK } from '../../../shared/constants/app'; import { SECOND } from '../../../shared/constants/time'; import { detectSIWE } from '../../../shared/modules/siwe'; @@ -46,6 +47,7 @@ const RATE_LIMIT_MAP = { const EVENT_NAME_MAP = { [MESSAGE_TYPE.ETH_SIGN]: { APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, + FAILED: EVENT_NAMES.SIGNATURE_FAILED, REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, }, @@ -195,13 +197,25 @@ export default function createRPCMethodTrackingMiddleware({ return callback(); } - // An error code of 4001 means the user rejected the request, which we - // can use here to determine which event to track. - const event = - res.error?.code === 4001 ? eventType.REJECTED : eventType.APPROVED; - const properties = {}; + // The rpc error methodNotFound implies that 'eth_sign' is disabled in Advanced Settings + const isDisabledEthSignAdvancedSetting = + method === MESSAGE_TYPE.ETH_SIGN && + res.error?.code === errorCodes.rpc.methodNotFound; + + const isDisabledRPCMethod = isDisabledEthSignAdvancedSetting; + + let event; + if (isDisabledRPCMethod) { + event = eventType.FAILED; + properties.error = res.error; + } else if (res.error?.code === 4001) { + event = eventType.REJECTED; + } else { + event = eventType.APPROVED; + } + if (eventType.REQUESTED === EVENT_NAMES.SIGNATURE_REQUESTED) { properties.signature_type = method; } else { @@ -226,6 +240,7 @@ export default function createRPCMethodTrackingMiddleware({ }, properties, }); + return callback(); }); }; diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js index ffa953fa0..9a9f72157 100644 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js +++ b/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js @@ -1,3 +1,4 @@ +import { errorCodes } from 'eth-rpc-errors'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { EVENT_NAMES } from '../../../shared/constants/metametrics'; import { SECOND } from '../../../shared/constants/time'; @@ -213,5 +214,34 @@ describe('createRPCMethodTrackingMiddleware', () => { expect(trackEvent.mock.calls[0][0].properties.method).toBe('eth_chainId'); expect(trackEvent.mock.calls[1][0].properties.method).toBe('eth_chainId'); }); + + describe(`when '${MESSAGE_TYPE.ETH_SIGN}' is disabled in advanced settings`, () => { + it(`should track ${EVENT_NAMES.SIGNATURE_FAILED} and include error property`, async () => { + const mockError = { code: errorCodes.rpc.methodNotFound }; + const req = { + method: MESSAGE_TYPE.ETH_SIGN, + origin: 'some.dapp', + }; + const res = { + error: mockError, + }; + const { next, executeMiddlewareStack } = getNext(); + + handler(req, res, next); + await executeMiddlewareStack(); + + expect(trackEvent).toHaveBeenCalledTimes(2); + + expect(trackEvent.mock.calls[1][0]).toMatchObject({ + category: 'inpage_provider', + event: EVENT_NAMES.SIGNATURE_FAILED, + properties: { + signature_type: MESSAGE_TYPE.ETH_SIGN, + error: mockError, + }, + referrer: { url: 'some.dapp' }, + }); + }); + }); }); }); diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index 4471457a4..853807ce5 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -342,6 +342,7 @@ export const EVENT_NAMES = { PUBLIC_ADDRESS_COPIED: 'Public Address Copied', PROVIDER_METHOD_CALLED: 'Provider Method Called', SIGNATURE_APPROVED: 'Signature Approved', + SIGNATURE_FAILED: 'Signature Failed', SIGNATURE_REJECTED: 'Signature Rejected', SIGNATURE_REQUESTED: 'Signature Requested', TOKEN_IMPORT_BUTTON_CLICKED: 'Import Token Button Clicked', From 7fc617f1bd1c1a9424b0a6c6882bed6ddaa35ade Mon Sep 17 00:00:00 2001 From: Peter <53189696+PeterYinusa@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:38:34 +0000 Subject: [PATCH 003/129] [skip e2e] bump coverage (#18165) --- coverage-targets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/coverage-targets.js b/coverage-targets.js index 8bd0ef280..d85aa5021 100644 --- a/coverage-targets.js +++ b/coverage-targets.js @@ -6,10 +6,10 @@ // subset of files to check against these targets. module.exports = { global: { - lines: 64.5, - branches: 53.15, - statements: 63.57, - functions: 56.58, + lines: 65, + branches: 53.5, + statements: 64, + functions: 57.5, }, transforms: { branches: 100, From bd23a490133693a464c2f4ab1976181378a9f7bf Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 15 Mar 2023 12:16:31 -0230 Subject: [PATCH 004/129] Revert "Moved subscribe and filter into network controller (#16693)" (#18129) * Revert "Moved subscribe and filter into network controller (#16693)" This reverts commit 6f6984fa58c4797e809387b3b3d0b28e72b252bf. That commit was an RPC middleware refactor intended to move the subscribe and filter middleware into the network controller, to simplify the process of sharing this middleware between clients. This refactor resulted in `eth_subscribe` notifications being sent on the wrong connections, causing the UI to break in some cases (the UI `provider` connection does not support notifications). This happened because the `setupProviderEngine` function runs per-connection, whereas the engine setup inside the network controller is global. The global network client cannot support notifications because it has no way to route them; they'll need to stay in the per-connection provider engine. Closes #17467 * Add e2e test An e2e test has been added that confirms subscriptions are only broadcast to the site that registered them. This test fails on `develop`. --- .../controllers/network/network-controller.js | 24 +----- .../controllers/permissions/specifications.js | 2 - app/scripts/metamask-controller.js | 25 +++--- test/e2e/tests/eth-subscribe.spec.js | 78 +++++++++++++++++++ 4 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 test/e2e/tests/eth-subscribe.spec.js diff --git a/app/scripts/controllers/network/network-controller.js b/app/scripts/controllers/network/network-controller.js index 6cf66f5dd..6f0e08cbe 100644 --- a/app/scripts/controllers/network/network-controller.js +++ b/app/scripts/controllers/network/network-controller.js @@ -2,18 +2,13 @@ import { strict as assert } from 'assert'; import EventEmitter from 'events'; import { ComposedStore, ObservableStore } from '@metamask/obs-store'; import { JsonRpcEngine } from 'json-rpc-engine'; -import { - providerFromEngine, - providerFromMiddleware, -} from '@metamask/eth-json-rpc-middleware'; +import { providerFromEngine } from '@metamask/eth-json-rpc-middleware'; import log from 'loglevel'; import { createSwappableProxy, createEventEmitterProxy, } from 'swappable-obj-proxy'; import EthQuery from 'eth-query'; -import createFilterMiddleware from 'eth-json-rpc-filters'; -import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager'; import { v4 as random } from 'uuid'; import { INFURA_PROVIDER_TYPES, @@ -460,26 +455,9 @@ export default class NetworkController extends EventEmitter { } _setNetworkClient({ networkMiddleware, blockTracker }) { - const networkProvider = providerFromMiddleware(networkMiddleware); - const filterMiddleware = createFilterMiddleware({ - provider: networkProvider, - blockTracker, - }); - const subscriptionManager = createSubscriptionManager({ - provider: networkProvider, - blockTracker, - }); - const engine = new JsonRpcEngine(); - subscriptionManager.events.on('notification', (message) => - engine.emit('notification', message), - ); - engine.push(filterMiddleware); - engine.push(subscriptionManager.middleware); engine.push(networkMiddleware); - const provider = providerFromEngine(engine); - this._setProviderAndBlockTracker({ provider, blockTracker }); } diff --git a/app/scripts/controllers/permissions/specifications.js b/app/scripts/controllers/permissions/specifications.js index 3779a904a..4072398d1 100644 --- a/app/scripts/controllers/permissions/specifications.js +++ b/app/scripts/controllers/permissions/specifications.js @@ -260,12 +260,10 @@ export const unrestrictedMethods = Object.freeze([ 'eth_signTypedData_v1', 'eth_signTypedData_v3', 'eth_signTypedData_v4', - 'eth_subscribe', 'eth_submitHashrate', 'eth_submitWork', 'eth_syncing', 'eth_uninstallFilter', - 'eth_unsubscribe', 'metamask_getProviderState', 'metamask_watchAsset', 'net_listening', diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 9c496fd8b..61f52a635 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -10,6 +10,8 @@ import { KeyringController, keyringBuilderFactory, } from '@metamask/eth-keyring-controller'; +import createFilterMiddleware from 'eth-json-rpc-filters'; +import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager'; import { errorCodes as rpcErrorCodes, EthereumRpcError, @@ -3898,19 +3900,21 @@ export default class MetamaskController extends EventEmitter { * @param {tabId} [options.tabId] - The tab ID of the sender - if the sender is within a tab */ setupProviderEngine({ origin, subjectType, sender, tabId }) { - const { provider } = this; - // setup json rpc engine stack const engine = new JsonRpcEngine(); + const { blockTracker, provider } = this; - // forward notifications from network provider - provider.on('data', (error, message) => { - if (error) { - // This should never happen, this error parameter is never set - throw error; - } - engine.emit('notification', message); + // create filter polyfill middleware + const filterMiddleware = createFilterMiddleware({ provider, blockTracker }); + + // create subscription polyfill middleware + const subscriptionManager = createSubscriptionManager({ + provider, + blockTracker, }); + subscriptionManager.events.on('notification', (message) => + engine.emit('notification', message), + ); if (isManifestV3) { engine.push(createDupeReqFilterMiddleware()); @@ -4063,6 +4067,9 @@ export default class MetamaskController extends EventEmitter { ); ///: END:ONLY_INCLUDE_IN + // filter and subscription polyfills + engine.push(filterMiddleware); + engine.push(subscriptionManager.middleware); if (subjectType !== SubjectType.Internal) { // permissions engine.push( diff --git a/test/e2e/tests/eth-subscribe.spec.js b/test/e2e/tests/eth-subscribe.spec.js new file mode 100644 index 000000000..d77135164 --- /dev/null +++ b/test/e2e/tests/eth-subscribe.spec.js @@ -0,0 +1,78 @@ +const { convertToHexValue, withFixtures } = require('../helpers'); +const FixtureBuilder = require('../fixture-builder'); + +describe('eth_subscribe', function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + + it('only broadcasts subscription notifications on the page that registered the subscription', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .build(), + ganacheOptions, + dappOptions: { numberOfDapps: 2 }, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.openNewPage('http://127.0.0.1:8080/'); + + const setupSubscriptionListener = ` + const responseContainer = document.createElement('div'); + responseContainer.setAttribute('id', 'eth-subscribe-responses'); + + const body = window.document.getElementsByTagName('body')[0]; + body.appendChild(responseContainer); + + window.ethereum.addListener('message', (message) => { + if (message.type === 'eth_subscription') { + const response = document.createElement('p'); + response.setAttribute('data-testid', 'eth-subscribe-response'); + response.append(JSON.stringify(message.data.result)); + + const responses = window.document.getElementById('eth-subscribe-responses'); + responses.appendChild(response) + } + }); + `; + + await driver.executeScript(setupSubscriptionListener); + // A `newHeads` subscription will emit a notification for each new block + // See here for more information: https://docs.infura.io/infura/networks/ethereum/json-rpc-methods/subscription-methods/eth_subscribe + await driver.executeScript(` + window.ethereum.request({ + method: 'eth_subscribe', + params: ['newHeads'] + }); + `); + + // Verify that the new block is seen on the first dapp + await driver.findElement('[data-testid="eth-subscribe-response"]'); + + // Switch to the second dapp + await driver.openNewPage('http://127.0.0.1:8081/'); + + // Setup the same subscription listener as on the first dapp, but without registering a new subscription + await driver.executeScript(setupSubscriptionListener); + + // Verify that the new block is not seen on the second dapp + await driver.assertElementNotPresent( + '[data-testid="eth-subscribe-response"]', + ); + }, + ); + }); +}); From 7a421e05c37658820298ded50c8949df16fc1f3f Mon Sep 17 00:00:00 2001 From: Bowen Sanders Date: Wed, 15 Mar 2023 10:03:01 -0700 Subject: [PATCH 005/129] [FLASK] Snaps e2e test stability improvements (#18090) * waitForSelector and pasteIntoField used now --- test/e2e/snaps/test-snap-bip-32.spec.js | 14 ++++++++------ test/e2e/snaps/test-snap-bip-44.spec.js | 16 +++++++++------- test/e2e/snaps/test-snap-cronjob.spec.js | 10 ++++++---- test/e2e/snaps/test-snap-dialog.spec.js | 12 +++++++----- test/e2e/snaps/test-snap-error.spec.js | 11 ++++++----- test/e2e/snaps/test-snap-installed.spec.js | 19 ++++++++++++------- test/e2e/snaps/test-snap-managestate.spec.js | 13 ++++++++----- test/e2e/snaps/test-snap-notification.spec.js | 12 +++++++----- test/e2e/snaps/test-snap-rpc.spec.js | 1 - test/e2e/snaps/test-snap-update.spec.js | 11 ++++++----- 10 files changed, 69 insertions(+), 50 deletions(-) diff --git a/test/e2e/snaps/test-snap-bip-32.spec.js b/test/e2e/snaps/test-snap-bip-32.spec.js index 2b05c8c4a..e69cdce34 100644 --- a/test/e2e/snaps/test-snap-bip-32.spec.js +++ b/test/e2e/snaps/test-snap-bip-32.spec.js @@ -77,13 +77,15 @@ describe('Test Snap bip-32', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // switch back to test-snaps window - windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectBip32', + text: 'Reconnect to BIP-32 Snap', + }); + // scroll to and click get public key await driver.delay(1000); const snapButton2 = await driver.findElement('#bip32GetPublic'); @@ -122,7 +124,7 @@ describe('Test Snap bip-32', function () { // wait then run SECP256K1 test await driver.delay(1000); - await driver.fill('#bip32Message-secp256k1', 'foo bar'); + await driver.pasteIntoField('#bip32Message-secp256k1', 'foo bar'); await driver.clickElement('#sendBip32-secp256k1'); // hit 'approve' on the custom confirm @@ -157,7 +159,7 @@ describe('Test Snap bip-32', function () { // wait then run ed25519 test await driver.delay(1000); - await driver.fill('#bip32Message-ed25519', 'foo bar'); + await driver.pasteIntoField('#bip32Message-ed25519', 'foo bar'); await driver.clickElement('#sendBip32-ed25519'); // hit 'approve' on the custom confirm diff --git a/test/e2e/snaps/test-snap-bip-44.spec.js b/test/e2e/snaps/test-snap-bip-44.spec.js index 54cd9b142..ad12ac0ac 100644 --- a/test/e2e/snaps/test-snap-bip-44.spec.js +++ b/test/e2e/snaps/test-snap-bip-44.spec.js @@ -70,19 +70,21 @@ describe('Test Snap bip-44', function () { // deal with permissions popover await driver.delay(1000); await driver.clickElement('#key-access-bip44-1-0'); - await driver.delay(1000); + await driver.delay(1500); await driver.clickElement({ text: 'Confirm', tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - await driver.delay(1000); + + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectBip44Snap', + text: 'Reconnect to BIP-44 Snap', + }); + await driver.clickElement('#sendBip44Test'); // check the results of the public key test @@ -94,7 +96,7 @@ describe('Test Snap bip-44', function () { ); // enter a message to sign - await driver.fill('#bip44Message', '1234'); + await driver.pasteIntoField('#bip44Message', '1234'); await driver.delay(1000); const snapButton3 = await driver.findElement('#signBip44Message'); await driver.scrollToElement(snapButton3); diff --git a/test/e2e/snaps/test-snap-cronjob.spec.js b/test/e2e/snaps/test-snap-cronjob.spec.js index 5818c1d37..d94d692ba 100644 --- a/test/e2e/snaps/test-snap-cronjob.spec.js +++ b/test/e2e/snaps/test-snap-cronjob.spec.js @@ -65,13 +65,15 @@ describe('Test Snap Cronjob', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectCronjobSnap', + text: 'Reconnect to Cronjob Snap', + }); + // switch to dialog popup, wait for a maximum of 65 seconds windowHandles = await driver.waitUntilXWindowHandles(3, 1000, 65000); await driver.switchToWindowWithTitle( diff --git a/test/e2e/snaps/test-snap-dialog.spec.js b/test/e2e/snaps/test-snap-dialog.spec.js index f910a6b3b..4ca53ae22 100644 --- a/test/e2e/snaps/test-snap-dialog.spec.js +++ b/test/e2e/snaps/test-snap-dialog.spec.js @@ -65,13 +65,15 @@ describe('Test Snap Dialog', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // switch to test snaps tab - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectDialogSnap', + text: 'Reconnect to Dialog Snap', + }); + // click on alert dialog await driver.clickElement('#sendAlertButton'); await driver.delay(1000); @@ -199,7 +201,7 @@ describe('Test Snap Dialog', function () { await driver.delay(1000); // fill '2323' in form field - await driver.fill('.MuiInput-input', '2323'); + await driver.pasteIntoField('.MuiInput-input', '2323'); // click submit button await driver.clickElement({ diff --git a/test/e2e/snaps/test-snap-error.spec.js b/test/e2e/snaps/test-snap-error.spec.js index 2efb31d89..2e72a9b92 100644 --- a/test/e2e/snaps/test-snap-error.spec.js +++ b/test/e2e/snaps/test-snap-error.spec.js @@ -66,13 +66,14 @@ describe('Test Snap Error', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - await driver.delay(1000); + + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectErrorSnap', + text: 'Reconnect to Error Snap', + }); // find and click on send error await driver.clickElement('#sendError'); diff --git a/test/e2e/snaps/test-snap-installed.spec.js b/test/e2e/snaps/test-snap-installed.spec.js index 08cabb6ec..2645c9b00 100644 --- a/test/e2e/snaps/test-snap-installed.spec.js +++ b/test/e2e/snaps/test-snap-installed.spec.js @@ -65,13 +65,15 @@ describe('Test Snap Installed', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectDialogSnap', + text: 'Reconnect to Dialog Snap', + }); + const errorButton = await driver.findElement('#connectErrorSnap'); await driver.scrollToElement(errorButton); await driver.delay(1000); @@ -101,12 +103,15 @@ describe('Test Snap Installed', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectErrorSnap', + text: 'Reconnect to Error Snap', + }); + const result = await driver.findElement('#installedSnapsResult'); await driver.scrollToElement(result); await driver.delay(1000); diff --git a/test/e2e/snaps/test-snap-managestate.spec.js b/test/e2e/snaps/test-snap-managestate.spec.js index 28892419d..bbf2d5bcf 100644 --- a/test/e2e/snaps/test-snap-managestate.spec.js +++ b/test/e2e/snaps/test-snap-managestate.spec.js @@ -67,14 +67,17 @@ describe('Test Snap manageState', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // fill and click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectManageState', + text: 'Reconnect to Manage State Snap', + }); + await driver.delay(1000); - await driver.fill('#dataManageState', '23'); + await driver.pasteIntoField('#dataManageState', '23'); const snapButton2 = await driver.findElement( '#retrieveManageStateResult', ); diff --git a/test/e2e/snaps/test-snap-notification.spec.js b/test/e2e/snaps/test-snap-notification.spec.js index 81a4a1307..bf4ad409a 100644 --- a/test/e2e/snaps/test-snap-notification.spec.js +++ b/test/e2e/snaps/test-snap-notification.spec.js @@ -67,13 +67,15 @@ describe('Test Snap Notification', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // click send inputs on test snap page - windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - await driver.delay(1000); + + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectNotification', + text: 'Reconnect to Notification Snap', + }); + await driver.clickElement('#sendInAppNotification'); // switch back to the extension page diff --git a/test/e2e/snaps/test-snap-rpc.spec.js b/test/e2e/snaps/test-snap-rpc.spec.js index 19715ec36..3f1716c5b 100644 --- a/test/e2e/snaps/test-snap-rpc.spec.js +++ b/test/e2e/snaps/test-snap-rpc.spec.js @@ -66,7 +66,6 @@ describe('Test Snap RPC', function () { }); // switch back to test snaps page - windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); // wait for npm installation success diff --git a/test/e2e/snaps/test-snap-update.spec.js b/test/e2e/snaps/test-snap-update.spec.js index 1120f20b8..472b5a1de 100644 --- a/test/e2e/snaps/test-snap-update.spec.js +++ b/test/e2e/snaps/test-snap-update.spec.js @@ -75,13 +75,14 @@ describe('Test Snap update', function () { tag: 'button', }); - // delay for npm installation - await driver.delay(2000); - // navigate to test snap page - windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - await driver.delay(1000); + + // wait for npm installation success + await driver.waitForSelector({ + css: '#connectUpdate', + text: 'Reconnect to Update Snap', + }); // find and scroll to the correct card and click first const snapButton2 = await driver.findElement('#connectUpdateNew'); From 1c613a455669983f871c03b42c29b337a05529cd Mon Sep 17 00:00:00 2001 From: Ayush Date: Thu, 16 Mar 2023 05:30:54 +0530 Subject: [PATCH 006/129] Part of #17670: Replace Typography with Text component (#17959) * Updated confirm-page-container-summary.component.js * Updated snap-insight.js * Updated confirmation-warning-modal.js * Updated create-new-vault.js * Fixing import errors, linting errors and adding a story * Updating storybook path * Updating snapshot --------- Co-authored-by: georgewrmarshall --- ...onfirm-page-container-summary.component.js | 13 ++-- .../confirm-page-container-summary.stories.js | 65 +++++++++++++++++++ .../flask/snap-insight.js | 18 ++--- .../confirmation-warning-modal.js | 32 ++++----- .../app/create-new-vault/create-new-vault.js | 4 +- .../confirm-transaction-base.test.js.snap | 2 +- 6 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.stories.js diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js index d58fe0280..90f3dc162 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js @@ -14,8 +14,8 @@ import { getIpfsGateway } from '../../../../../selectors'; import Identicon from '../../../../ui/identicon'; import InfoTooltip from '../../../../ui/info-tooltip'; import NicknamePopovers from '../../../modals/nickname-popovers'; -import Typography from '../../../../ui/typography'; -import { TypographyVariant } from '../../../../../helpers/constants/design-system'; +import { Text } from '../../../../component-library'; +import { TextVariant } from '../../../../../helpers/constants/design-system'; import { ORIGIN_METAMASK } from '../../../../../../shared/constants/app'; import SiteOrigin from '../../../../ui/site-origin'; import { getAssetImageURL } from '../../../../../helpers/utils/util'; @@ -131,17 +131,18 @@ const ConfirmPageContainerSummary = (props) => {
{renderImage()} {!hideTitle ? ( - {titleComponent || title} - + ) : null}
{hideSubtitle ? null : ( diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.stories.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.stories.js new file mode 100644 index 000000000..a25722088 --- /dev/null +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.stories.js @@ -0,0 +1,65 @@ +import React from 'react'; +import ConfirmPageContainerSummary from '.'; + +export default { + title: + 'Components/App/ConfirmPageContainer/ConfirmPageContainerContent/ConfirmPageContainerSummary', + argTypes: { + action: { + control: 'text', + }, + title: { + control: 'text', + }, + image: { + control: 'text', + }, + titleComponent: { + control: 'text', + }, + subtitleComponent: { + control: 'text', + }, + hideSubtitle: { + control: 'boolean', + }, + className: { + control: 'text', + }, + tokenAddress: { + control: 'text', + }, + toAddress: { + control: 'text', + }, + nonce: { + control: 'text', + }, + origin: { + control: 'text', + }, + hideTitle: { + control: 'boolean', + }, + transactionType: { + control: 'text', + }, + }, + args: { + action: 'action', + title: 'title', + titleComponent: 'titleComponent', + subtitleComponent: 'subtitleComponent', + className: 'className', + tokenAddress: '0x2170ed0880ac9a755fd29b2688956bd959f933f8', + toAddress: '0x2170ed0880ac9a755fd29b2688956bd959f933f8', + nonce: 'nonce', + origin: 'origin', + hideTitle: 'hideTitle', + transactionType: 'transactionType', + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/confirm-page-container/flask/snap-insight.js b/ui/components/app/confirm-page-container/flask/snap-insight.js index 14bc84c3b..3cfafd94d 100644 --- a/ui/components/app/confirm-page-container/flask/snap-insight.js +++ b/ui/components/app/confirm-page-container/flask/snap-insight.js @@ -2,14 +2,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import Preloader from '../../../ui/icon/preloader/preloader-icon.component'; -import Typography from '../../../ui/typography/typography'; +import { Text } from '../../../component-library'; import { AlignItems, FLEX_DIRECTION, JustifyContent, TEXT_ALIGN, TextColor, - TypographyVariant, + TextVariant, } from '../../../../helpers/constants/design-system'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { useTransactionInsightSnap } from '../../../../hooks/flask/useTransactionInsightSnap'; @@ -54,12 +54,13 @@ export const SnapInsight = ({ transaction, origin, chainId, selectedSnap }) => { {data && Object.keys(data).length > 0 ? ( ) : ( - {t('snapsNoInsight')} - + )} )} @@ -87,13 +88,14 @@ export const SnapInsight = ({ transaction, origin, chainId, selectedSnap }) => { {loading && ( <> - {t('snapsInsightLoading')} - + )} diff --git a/ui/components/app/confirmation-warning-modal/confirmation-warning-modal.js b/ui/components/app/confirmation-warning-modal/confirmation-warning-modal.js index ebdbd74bc..d17c03b16 100644 --- a/ui/components/app/confirmation-warning-modal/confirmation-warning-modal.js +++ b/ui/components/app/confirmation-warning-modal/confirmation-warning-modal.js @@ -5,17 +5,16 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import Popover from '../../ui/popover'; import Box from '../../ui/box'; import Button from '../../ui/button'; -import Typography from '../../ui/typography'; import { DISPLAY, FLEX_DIRECTION, FONT_WEIGHT, JustifyContent, - TypographyVariant, + TextVariant, AlignItems, IconColor, } from '../../../helpers/constants/design-system'; -import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library'; +import { Text, Icon, ICON_NAMES, ICON_SIZES } from '../../component-library'; const ConfirmationWarningModal = ({ onSubmit, onCancel }) => { const t = useI18nContext(); @@ -61,39 +60,40 @@ const ConfirmationWarningModal = ({ onSubmit, onCancel }) => { className="confirmation-warning-modal__content__header__warning-icon" size={ICON_SIZES.XL} /> - {t('addEthereumChainWarningModalTitle')} - + - + {t('addEthereumChainWarningModalHeader', [ {t('addEthereumChainWarningModalHeaderPartTwo')} , ])} - - + + {t('addEthereumChainWarningModalListHeader')} - +
  • - + {t('addEthereumChainWarningModalListPointOne')} - +
  • - + {t('addEthereumChainWarningModalListPointTwo')} - +
  • - + {t('addEthereumChainWarningModalListPointThree')} - +
diff --git a/ui/components/app/create-new-vault/create-new-vault.js b/ui/components/app/create-new-vault/create-new-vault.js index b8ad32670..13b28eb0a 100644 --- a/ui/components/app/create-new-vault/create-new-vault.js +++ b/ui/components/app/create-new-vault/create-new-vault.js @@ -4,7 +4,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import TextField from '../../ui/text-field'; import Button from '../../ui/button'; import CheckBox from '../../ui/check-box'; -import Typography from '../../ui/typography'; +import { Text } from '../../component-library'; import SrpInput from '../srp-input'; import { PASSWORD_MIN_LENGTH } from '../../../helpers/constants/common'; @@ -135,7 +135,7 @@ export default function CreateNewVault({ className="create-new-vault__terms-label" htmlFor="create-new-vault__terms-checkbox" > - {termsOfUse} + {termsOfUse} ) : null} diff --git a/ui/pages/confirm-transaction-base/__snapshots__/confirm-transaction-base.test.js.snap b/ui/pages/confirm-transaction-base/__snapshots__/confirm-transaction-base.test.js.snap index c6dba019d..46a976a57 100644 --- a/ui/pages/confirm-transaction-base/__snapshots__/confirm-transaction-base.test.js.snap +++ b/ui/pages/confirm-transaction-base/__snapshots__/confirm-transaction-base.test.js.snap @@ -254,7 +254,7 @@ exports[`Confirm Transaction Base should match snapshot 1`] = ` class="confirm-page-container-summary__title" >

Date: Thu, 16 Mar 2023 11:06:33 +0100 Subject: [PATCH 007/129] Fixed test instability (#18174) --- test/e2e/swaps/shared.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/swaps/shared.js b/test/e2e/swaps/shared.js index f6cb920a5..ef7eb8278 100644 --- a/test/e2e/swaps/shared.js +++ b/test/e2e/swaps/shared.js @@ -83,7 +83,7 @@ const reviewQuote = async (driver, options) => { 'Error: SwapFrom has wrong symbol', ); const swapToSymbol = await driver.waitForSelector( - '.main-quote-summary__destination-row', + '.main-quote-summary__destination-row > span', ); assert.equal( await swapToSymbol.getText(), From 872a8c79f40fa2422f6228fd02f98fbebf0ccaa6 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Thu, 16 Mar 2023 11:33:40 +0100 Subject: [PATCH 008/129] Bump `@metamask/utils` to `5.0.0` (#18155) * Update utils * Ignore as-sha256 * Update LavaMoat policies --- development/build/scripts.js | 3 + lavamoat/browserify/beta/policy.json | 312 ++++++++++++-------- lavamoat/browserify/desktop/policy.json | 370 ++++++++++++++++-------- lavamoat/browserify/flask/policy.json | 370 ++++++++++++++++-------- lavamoat/browserify/main/policy.json | 312 ++++++++++++-------- package.json | 2 +- yarn.lock | 107 +++++-- 7 files changed, 986 insertions(+), 490 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index 3bb01ef66..d28ef4db4 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -907,6 +907,9 @@ function setupBundlerDefaults( bundlerOpts.manualIgnore.push('remote-redux-devtools'); } + // This dependency uses WASM which we cannot execute in accordance with our CSP + bundlerOpts.manualIgnore.push('@chainsafe/as-sha256'); + // Inject environment variables via node-style `process.env` if (envVars) { bundlerOpts.transform.push([envify(envVars), { global: true }]); diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 5cf58f0f3..98e2ef7d2 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -707,12 +707,12 @@ "@ethersproject/providers": true, "@metamask/assets-controllers>@metamask/abi-utils": true, "@metamask/assets-controllers>@metamask/controller-utils": true, + "@metamask/assets-controllers>@metamask/utils": true, "@metamask/assets-controllers>abort-controller": true, "@metamask/assets-controllers>multiformats": true, "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/metamask-eth-abis": true, - "@metamask/utils": true, "browserify>events": true, "eth-json-rpc-filters>async-mutex": true, "eth-query": true, @@ -724,10 +724,22 @@ }, "@metamask/assets-controllers>@metamask/abi-utils": { "packages": { - "@metamask/utils": true, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/controller-utils": { "globals": { "console.error": true, @@ -743,6 +755,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/assets-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>abort-controller": { "globals": { "AbortController": true @@ -819,13 +843,25 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-infura>@metamask/utils": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "node-fetch": true } }, + "@metamask/eth-json-rpc-infura>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { "globals": { "URL": true, @@ -853,17 +889,25 @@ }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -880,9 +924,9 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/utils": true, "browserify>browser-resolve": true, "eth-rpc-errors": true, "json-rpc-engine": true, @@ -891,6 +935,18 @@ "vinyl>clone": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, @@ -906,33 +962,17 @@ "TextEncoder": true }, "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true, @@ -940,21 +980,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -965,28 +990,13 @@ "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>obs-store": { "packages": { "safe-event-emitter": true, @@ -1022,17 +1032,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1222,12 +1240,24 @@ }, "@metamask/key-tree": { "packages": { + "@metamask/key-tree>@metamask/utils": true, "@metamask/key-tree>@noble/ed25519": true, "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@noble/secp256k1": true, "@metamask/key-tree>@scure/base": true, - "@metamask/scure-bip39": true, - "@metamask/utils": true + "@metamask/scure-bip39": true + } + }, + "@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/key-tree>@noble/ed25519": { @@ -1362,7 +1392,7 @@ "packages": { "@metamask/key-tree": true, "@metamask/key-tree>@noble/hashes": true, - "@metamask/utils": true, + "@metamask/rpc-methods>@metamask/utils": true, "@metamask/utils>superstruct": true } }, @@ -1380,6 +1410,18 @@ "browserify>buffer": true } }, + "@metamask/rpc-methods>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods>nanoid": { "globals": { "crypto.getRandomValues": true @@ -1448,6 +1490,59 @@ "semver": true } }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": { + "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": true, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>case": true, + "browserify": true, + "browserify>buffer": true + } + }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": { + "globals": { + "WeakRef": true + }, + "packages": { + "browserify": true + } + }, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": { + "globals": { + "TextEncoder": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": { + "globals": { + "crypto": true + }, + "packages": { + "browserify>browser-resolve": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": { + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "@metamask/key-tree>@scure/base": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true + } + }, "@ngraveio/bc-ur": { "packages": { "@ngraveio/bc-ur>@apocentre/alias-sampling": true, @@ -2595,12 +2690,24 @@ "setTimeout": true }, "packages": { - "@metamask/utils": true, + "eth-block-tracker>@metamask/utils": true, "eth-block-tracker>pify": true, "eth-query>json-rpc-random-id": true, "json-rpc-engine>@metamask/safe-event-emitter": true } }, + "eth-block-tracker>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "eth-ens-namehash": { "globals": { "name": "write" @@ -2682,61 +2789,12 @@ "console.warn": true }, "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": true, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "browserify>insert-module-globals>is-buffer": true, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": true, - "eth-lattice-keyring>@ethereumjs/util>async": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": { - "globals": { - "TextEncoder": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>async": { - "globals": { - "clearTimeout": true, - "console": true, - "define": true, - "queueMicrotask": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { - "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": { - "packages": { - "@metamask/key-tree>@noble/hashes": true, - "@metamask/key-tree>@scure/base": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true + "browserify>insert-module-globals>is-buffer": true } }, "eth-lattice-keyring>bn.js": { @@ -2937,14 +2995,22 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3064,13 +3130,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-abi>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ganache>secp256k1>elliptic": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-abi>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3255,14 +3329,22 @@ "ethereumjs-wallet>safe-buffer": true } }, + "ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-wallet>ethereumjs-util": { "packages": { "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, + "ethereumjs-wallet>ethereum-cryptography": true, "ethereumjs-wallet>ethereumjs-util>ethjs-util": true, "ganache>secp256k1>elliptic": true } diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index 00325bca9..a84edb962 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -707,12 +707,12 @@ "@ethersproject/providers": true, "@metamask/assets-controllers>@metamask/abi-utils": true, "@metamask/assets-controllers>@metamask/controller-utils": true, + "@metamask/assets-controllers>@metamask/utils": true, "@metamask/assets-controllers>abort-controller": true, "@metamask/assets-controllers>multiformats": true, "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/metamask-eth-abis": true, - "@metamask/utils": true, "browserify>events": true, "eth-json-rpc-filters>async-mutex": true, "eth-query": true, @@ -724,10 +724,22 @@ }, "@metamask/assets-controllers>@metamask/abi-utils": { "packages": { - "@metamask/utils": true, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/controller-utils": { "globals": { "console.error": true, @@ -743,6 +755,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/assets-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>abort-controller": { "globals": { "AbortController": true @@ -873,13 +897,25 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-infura>@metamask/utils": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "node-fetch": true } }, + "@metamask/eth-json-rpc-infura>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { "globals": { "URL": true, @@ -907,17 +943,25 @@ }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -934,9 +978,9 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/utils": true, "browserify>browser-resolve": true, "eth-rpc-errors": true, "json-rpc-engine": true, @@ -945,6 +989,18 @@ "vinyl>clone": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, @@ -960,33 +1016,17 @@ "TextEncoder": true }, "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true, @@ -994,21 +1034,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1019,28 +1044,13 @@ "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>obs-store": { "packages": { "safe-event-emitter": true, @@ -1076,17 +1086,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1276,12 +1294,24 @@ }, "@metamask/key-tree": { "packages": { + "@metamask/key-tree>@metamask/utils": true, "@metamask/key-tree>@noble/ed25519": true, "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@noble/secp256k1": true, "@metamask/key-tree>@scure/base": true, - "@metamask/scure-bip39": true, - "@metamask/utils": true + "@metamask/scure-bip39": true + } + }, + "@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/key-tree>@noble/ed25519": { @@ -1436,8 +1466,20 @@ "removeEventListener": true }, "packages": { - "@metamask/post-message-stream>readable-stream": true, - "@metamask/utils": true + "@metamask/post-message-stream>@metamask/utils": true, + "@metamask/post-message-stream>readable-stream": true + } + }, + "@metamask/post-message-stream>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/post-message-stream>readable-stream": { @@ -1500,10 +1542,10 @@ "@metamask/key-tree>@noble/hashes": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, "@metamask/rpc-methods>@metamask/permission-controller": true, + "@metamask/rpc-methods>@metamask/utils": true, "@metamask/rpc-methods>nanoid": true, "@metamask/snaps-ui": true, "@metamask/snaps-utils": true, - "@metamask/utils": true, "@metamask/utils>superstruct": true, "eth-rpc-errors": true } @@ -1552,6 +1594,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/rpc-methods>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods>nanoid": { "globals": { "crypto.getRandomValues": true @@ -1615,6 +1669,7 @@ "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/subject-metadata-controller": true, + "@metamask/snaps-controllers>@metamask/utils": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>gunzip-maybe": true, @@ -1622,7 +1677,6 @@ "@metamask/snaps-controllers>readable-web-to-node-stream": true, "@metamask/snaps-controllers>tar-stream": true, "@metamask/snaps-utils": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, @@ -1664,6 +1718,18 @@ "@metamask/snaps-controllers>@metamask/base-controller": true } }, + "@metamask/snaps-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "@metamask/snaps-controllers>concat-stream>readable-stream": true, @@ -1812,10 +1878,22 @@ }, "@metamask/snaps-ui": { "packages": { - "@metamask/utils": true, + "@metamask/snaps-ui>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/snaps-ui>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "TextDecoder": true, @@ -1829,15 +1907,27 @@ "packages": { "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@scure/base": true, + "@metamask/snaps-utils>@metamask/utils": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, - "@metamask/utils": true, "@metamask/utils>superstruct": true, "semver": true } }, + "@metamask/snaps-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils>cron-parser": { "packages": { "browserify>browser-resolve": true, @@ -1877,6 +1967,59 @@ "semver": true } }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": { + "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": true, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>case": true, + "browserify": true, + "browserify>buffer": true + } + }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": { + "globals": { + "WeakRef": true + }, + "packages": { + "browserify": true + } + }, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": { + "globals": { + "TextEncoder": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": { + "globals": { + "crypto": true + }, + "packages": { + "browserify>browser-resolve": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": { + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "@metamask/key-tree>@scure/base": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true + } + }, "@ngraveio/bc-ur": { "packages": { "@ngraveio/bc-ur>@apocentre/alias-sampling": true, @@ -3024,12 +3167,24 @@ "setTimeout": true }, "packages": { - "@metamask/utils": true, + "eth-block-tracker>@metamask/utils": true, "eth-block-tracker>pify": true, "eth-query>json-rpc-random-id": true, "json-rpc-engine>@metamask/safe-event-emitter": true } }, + "eth-block-tracker>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "eth-ens-namehash": { "globals": { "name": "write" @@ -3111,61 +3266,12 @@ "console.warn": true }, "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": true, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "browserify>insert-module-globals>is-buffer": true, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": true, - "eth-lattice-keyring>@ethereumjs/util>async": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": { - "globals": { - "TextEncoder": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>async": { - "globals": { - "clearTimeout": true, - "console": true, - "define": true, - "queueMicrotask": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { - "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": { - "packages": { - "@metamask/key-tree>@noble/hashes": true, - "@metamask/key-tree>@scure/base": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true + "browserify>insert-module-globals>is-buffer": true } }, "eth-lattice-keyring>bn.js": { @@ -3366,14 +3472,22 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3493,13 +3607,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-abi>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ganache>secp256k1>elliptic": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-abi>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3684,14 +3806,22 @@ "ethereumjs-wallet>safe-buffer": true } }, + "ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-wallet>ethereumjs-util": { "packages": { "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, + "ethereumjs-wallet>ethereum-cryptography": true, "ethereumjs-wallet>ethereumjs-util>ethjs-util": true, "ganache>secp256k1>elliptic": true } diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 00325bca9..a84edb962 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -707,12 +707,12 @@ "@ethersproject/providers": true, "@metamask/assets-controllers>@metamask/abi-utils": true, "@metamask/assets-controllers>@metamask/controller-utils": true, + "@metamask/assets-controllers>@metamask/utils": true, "@metamask/assets-controllers>abort-controller": true, "@metamask/assets-controllers>multiformats": true, "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/metamask-eth-abis": true, - "@metamask/utils": true, "browserify>events": true, "eth-json-rpc-filters>async-mutex": true, "eth-query": true, @@ -724,10 +724,22 @@ }, "@metamask/assets-controllers>@metamask/abi-utils": { "packages": { - "@metamask/utils": true, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/controller-utils": { "globals": { "console.error": true, @@ -743,6 +755,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/assets-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>abort-controller": { "globals": { "AbortController": true @@ -873,13 +897,25 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-infura>@metamask/utils": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "node-fetch": true } }, + "@metamask/eth-json-rpc-infura>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { "globals": { "URL": true, @@ -907,17 +943,25 @@ }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -934,9 +978,9 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/utils": true, "browserify>browser-resolve": true, "eth-rpc-errors": true, "json-rpc-engine": true, @@ -945,6 +989,18 @@ "vinyl>clone": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, @@ -960,33 +1016,17 @@ "TextEncoder": true }, "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true, @@ -994,21 +1034,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1019,28 +1044,13 @@ "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>obs-store": { "packages": { "safe-event-emitter": true, @@ -1076,17 +1086,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1276,12 +1294,24 @@ }, "@metamask/key-tree": { "packages": { + "@metamask/key-tree>@metamask/utils": true, "@metamask/key-tree>@noble/ed25519": true, "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@noble/secp256k1": true, "@metamask/key-tree>@scure/base": true, - "@metamask/scure-bip39": true, - "@metamask/utils": true + "@metamask/scure-bip39": true + } + }, + "@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/key-tree>@noble/ed25519": { @@ -1436,8 +1466,20 @@ "removeEventListener": true }, "packages": { - "@metamask/post-message-stream>readable-stream": true, - "@metamask/utils": true + "@metamask/post-message-stream>@metamask/utils": true, + "@metamask/post-message-stream>readable-stream": true + } + }, + "@metamask/post-message-stream>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/post-message-stream>readable-stream": { @@ -1500,10 +1542,10 @@ "@metamask/key-tree>@noble/hashes": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, "@metamask/rpc-methods>@metamask/permission-controller": true, + "@metamask/rpc-methods>@metamask/utils": true, "@metamask/rpc-methods>nanoid": true, "@metamask/snaps-ui": true, "@metamask/snaps-utils": true, - "@metamask/utils": true, "@metamask/utils>superstruct": true, "eth-rpc-errors": true } @@ -1552,6 +1594,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/rpc-methods>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods>nanoid": { "globals": { "crypto.getRandomValues": true @@ -1615,6 +1669,7 @@ "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/subject-metadata-controller": true, + "@metamask/snaps-controllers>@metamask/utils": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>gunzip-maybe": true, @@ -1622,7 +1677,6 @@ "@metamask/snaps-controllers>readable-web-to-node-stream": true, "@metamask/snaps-controllers>tar-stream": true, "@metamask/snaps-utils": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, @@ -1664,6 +1718,18 @@ "@metamask/snaps-controllers>@metamask/base-controller": true } }, + "@metamask/snaps-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "@metamask/snaps-controllers>concat-stream>readable-stream": true, @@ -1812,10 +1878,22 @@ }, "@metamask/snaps-ui": { "packages": { - "@metamask/utils": true, + "@metamask/snaps-ui>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/snaps-ui>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "TextDecoder": true, @@ -1829,15 +1907,27 @@ "packages": { "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@scure/base": true, + "@metamask/snaps-utils>@metamask/utils": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, - "@metamask/utils": true, "@metamask/utils>superstruct": true, "semver": true } }, + "@metamask/snaps-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils>cron-parser": { "packages": { "browserify>browser-resolve": true, @@ -1877,6 +1967,59 @@ "semver": true } }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": { + "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": true, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>case": true, + "browserify": true, + "browserify>buffer": true + } + }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": { + "globals": { + "WeakRef": true + }, + "packages": { + "browserify": true + } + }, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": { + "globals": { + "TextEncoder": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": { + "globals": { + "crypto": true + }, + "packages": { + "browserify>browser-resolve": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": { + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "@metamask/key-tree>@scure/base": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true + } + }, "@ngraveio/bc-ur": { "packages": { "@ngraveio/bc-ur>@apocentre/alias-sampling": true, @@ -3024,12 +3167,24 @@ "setTimeout": true }, "packages": { - "@metamask/utils": true, + "eth-block-tracker>@metamask/utils": true, "eth-block-tracker>pify": true, "eth-query>json-rpc-random-id": true, "json-rpc-engine>@metamask/safe-event-emitter": true } }, + "eth-block-tracker>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "eth-ens-namehash": { "globals": { "name": "write" @@ -3111,61 +3266,12 @@ "console.warn": true }, "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": true, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "browserify>insert-module-globals>is-buffer": true, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": true, - "eth-lattice-keyring>@ethereumjs/util>async": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": { - "globals": { - "TextEncoder": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>async": { - "globals": { - "clearTimeout": true, - "console": true, - "define": true, - "queueMicrotask": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { - "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": { - "packages": { - "@metamask/key-tree>@noble/hashes": true, - "@metamask/key-tree>@scure/base": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true + "browserify>insert-module-globals>is-buffer": true } }, "eth-lattice-keyring>bn.js": { @@ -3366,14 +3472,22 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3493,13 +3607,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-abi>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ganache>secp256k1>elliptic": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-abi>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3684,14 +3806,22 @@ "ethereumjs-wallet>safe-buffer": true } }, + "ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-wallet>ethereumjs-util": { "packages": { "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, + "ethereumjs-wallet>ethereum-cryptography": true, "ethereumjs-wallet>ethereumjs-util>ethjs-util": true, "ganache>secp256k1>elliptic": true } diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 5cf58f0f3..98e2ef7d2 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -707,12 +707,12 @@ "@ethersproject/providers": true, "@metamask/assets-controllers>@metamask/abi-utils": true, "@metamask/assets-controllers>@metamask/controller-utils": true, + "@metamask/assets-controllers>@metamask/utils": true, "@metamask/assets-controllers>abort-controller": true, "@metamask/assets-controllers>multiformats": true, "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/metamask-eth-abis": true, - "@metamask/utils": true, "browserify>events": true, "eth-json-rpc-filters>async-mutex": true, "eth-query": true, @@ -724,10 +724,22 @@ }, "@metamask/assets-controllers>@metamask/abi-utils": { "packages": { - "@metamask/utils": true, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": true, "@metamask/utils>superstruct": true } }, + "@metamask/assets-controllers>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/controller-utils": { "globals": { "console.error": true, @@ -743,6 +755,18 @@ "ethjs>ethjs-unit": true } }, + "@metamask/assets-controllers>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>abort-controller": { "globals": { "AbortController": true @@ -819,13 +843,25 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-infura>@metamask/utils": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true, "node-fetch": true } }, + "@metamask/eth-json-rpc-infura>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { "globals": { "URL": true, @@ -853,17 +889,25 @@ }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -880,9 +924,9 @@ "setTimeout": true }, "packages": { + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/utils": true, "browserify>browser-resolve": true, "eth-rpc-errors": true, "json-rpc-engine": true, @@ -891,6 +935,18 @@ "vinyl>clone": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, @@ -906,33 +962,17 @@ "TextEncoder": true }, "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-lattice-keyring>@ethereumjs/util": true, @@ -940,21 +980,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -965,28 +990,13 @@ "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-keyring-controller>obs-store": { "packages": { "safe-event-emitter": true, @@ -1022,17 +1032,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -1222,12 +1240,24 @@ }, "@metamask/key-tree": { "packages": { + "@metamask/key-tree>@metamask/utils": true, "@metamask/key-tree>@noble/ed25519": true, "@metamask/key-tree>@noble/hashes": true, "@metamask/key-tree>@noble/secp256k1": true, "@metamask/key-tree>@scure/base": true, - "@metamask/scure-bip39": true, - "@metamask/utils": true + "@metamask/scure-bip39": true + } + }, + "@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/key-tree>@noble/ed25519": { @@ -1362,7 +1392,7 @@ "packages": { "@metamask/key-tree": true, "@metamask/key-tree>@noble/hashes": true, - "@metamask/utils": true, + "@metamask/rpc-methods>@metamask/utils": true, "@metamask/utils>superstruct": true } }, @@ -1380,6 +1410,18 @@ "browserify>buffer": true } }, + "@metamask/rpc-methods>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods>nanoid": { "globals": { "crypto.getRandomValues": true @@ -1448,6 +1490,59 @@ "semver": true } }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": { + "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": true, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>case": true, + "browserify": true, + "browserify>buffer": true + } + }, + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz>@chainsafe/persistent-merkle-tree": { + "globals": { + "WeakRef": true + }, + "packages": { + "browserify": true + } + }, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": { + "globals": { + "TextEncoder": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": { + "globals": { + "crypto": true + }, + "packages": { + "browserify>browser-resolve": true + } + }, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@scure/bip32": { + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "@metamask/key-tree>@scure/base": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography>@noble/secp256k1": true + } + }, "@ngraveio/bc-ur": { "packages": { "@ngraveio/bc-ur>@apocentre/alias-sampling": true, @@ -2595,12 +2690,24 @@ "setTimeout": true }, "packages": { - "@metamask/utils": true, + "eth-block-tracker>@metamask/utils": true, "eth-block-tracker>pify": true, "eth-query>json-rpc-random-id": true, "json-rpc-engine>@metamask/safe-event-emitter": true } }, + "eth-block-tracker>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>superstruct": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "eth-ens-namehash": { "globals": { "name": "write" @@ -2682,61 +2789,12 @@ "console.warn": true }, "packages": { + "@metamask/utils>@ethereumjs/tx>@chainsafe/ssz": true, + "@metamask/utils>@ethereumjs/tx>@ethereumjs/rlp": true, + "@metamask/utils>@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "browserify>insert-module-globals>is-buffer": true, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": true, - "eth-lattice-keyring>@ethereumjs/util>async": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>@ethereumjs/rlp": { - "globals": { - "TextEncoder": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>async": { - "globals": { - "clearTimeout": true, - "console": true, - "define": true, - "queueMicrotask": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { - "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true - } - }, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@scure/bip32": { - "packages": { - "@metamask/key-tree>@noble/hashes": true, - "@metamask/key-tree>@scure/base": true, - "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true + "browserify>insert-module-globals>is-buffer": true } }, "eth-lattice-keyring>bn.js": { @@ -2937,14 +2995,22 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ethereumjs-wallet>safe-buffer": true, "ganache>secp256k1>elliptic": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3064,13 +3130,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-abi>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "ganache>secp256k1>elliptic": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-abi>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3255,14 +3329,22 @@ "ethereumjs-wallet>safe-buffer": true } }, + "ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "ethereumjs-wallet>randombytes": true + } + }, "ethereumjs-wallet>ethereumjs-util": { "packages": { "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, + "ethereumjs-wallet>ethereum-cryptography": true, "ethereumjs-wallet>ethereumjs-util>ethjs-util": true, "ganache>secp256k1>elliptic": true } diff --git a/package.json b/package.json index 40c0dd36a..f8957699d 100644 --- a/package.json +++ b/package.json @@ -255,7 +255,7 @@ "@metamask/snaps-ui": "^0.30.0", "@metamask/snaps-utils": "^0.30.0", "@metamask/subject-metadata-controller": "^1.0.0", - "@metamask/utils": "^3.6.0", + "@metamask/utils": "^5.0.0", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", diff --git a/yarn.lock b/yarn.lock index f16c5ce3c..e05d1c415 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1680,6 +1680,33 @@ __metadata: languageName: node linkType: hard +"@chainsafe/as-sha256@npm:^0.3.1": + version: 0.3.1 + resolution: "@chainsafe/as-sha256@npm:0.3.1" + checksum: 58ea733be1657b0e31dbf48b0dba862da0833df34a81c1460c7352f04ce90874f70003cbf34d0afb9e5e53a33ee2d63a261a8b12462be85b2ba0a6f7f13d6150 + languageName: node + linkType: hard + +"@chainsafe/persistent-merkle-tree@npm:^0.4.2": + version: 0.4.2 + resolution: "@chainsafe/persistent-merkle-tree@npm:0.4.2" + dependencies: + "@chainsafe/as-sha256": ^0.3.1 + checksum: f9cfcb2132a243992709715dbd28186ab48c7c0c696f29d30857693cca5526bf753974a505ef68ffd5623bbdbcaa10f9083f4dd40bf99eb6408e451cc26a1a9e + languageName: node + linkType: hard + +"@chainsafe/ssz@npm:0.9.4": + version: 0.9.4 + resolution: "@chainsafe/ssz@npm:0.9.4" + dependencies: + "@chainsafe/as-sha256": ^0.3.1 + "@chainsafe/persistent-merkle-tree": ^0.4.2 + case: ^1.6.3 + checksum: c6eaedeae9e5618b3c666ff4507a27647f665a8dcf17d5ca86da4ed4788c5a93868f256d0005467d184fdf35ec03f323517ec2e55ec42492d769540a2ec396bc + languageName: node + linkType: hard + "@choojs/findup@npm:^0.2.1": version: 0.2.1 resolution: "@choojs/findup@npm:0.2.1" @@ -1999,12 +2026,22 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/rlp@npm:^4.0.0-beta.2": - version: 4.0.0 - resolution: "@ethereumjs/rlp@npm:4.0.0" +"@ethereumjs/common@npm:^3.1.1": + version: 3.1.1 + resolution: "@ethereumjs/common@npm:3.1.1" + dependencies: + "@ethereumjs/util": ^8.0.5 + crc-32: ^1.2.0 + checksum: 58602dee9fbcf691dca111b4fd7fd5770f5e86d68012ce48fba396c7038afdca4fca273a9cf39f88cf6ea7b256603a4bd214e94e9d01361efbcd060460b78952 + languageName: node + linkType: hard + +"@ethereumjs/rlp@npm:^4.0.1": + version: 4.0.1 + resolution: "@ethereumjs/rlp@npm:4.0.1" bin: rlp: bin/rlp - checksum: 407dfb8b1e09b4282e6be561e8d74f8939da78f460c08456c7ba2fb273fc42ee16027955a07085abfd7600ffb466c4c4add159885e67abb91bc85db9dd81ffb5 + checksum: 30db19c78faa2b6ff27275ab767646929207bb207f903f09eb3e4c273ce2738b45f3c82169ddacd67468b4f063d8d96035f2bf36f02b6b7e4d928eefe2e3ecbc languageName: node linkType: hard @@ -2028,14 +2065,33 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/util@npm:^8.0.0, @ethereumjs/util@npm:^8.0.2": - version: 8.0.3 - resolution: "@ethereumjs/util@npm:8.0.3" +"@ethereumjs/tx@npm:^4.1.1": + version: 4.1.1 + resolution: "@ethereumjs/tx@npm:4.1.1" dependencies: - "@ethereumjs/rlp": ^4.0.0-beta.2 - async: ^3.2.4 + "@chainsafe/ssz": 0.9.4 + "@ethereumjs/common": ^3.1.1 + "@ethereumjs/rlp": ^4.0.1 + "@ethereumjs/util": ^8.0.5 + "@ethersproject/providers": ^5.7.2 ethereum-cryptography: ^1.1.2 - checksum: f41b9b1f491d65393fe33431ad2c723bdbf405358e201af3bd9ed2dbf04b6002f039e425681534084fd9b4b11d8c27d2ba521682fe2f49518f6891833246a698 + peerDependencies: + c-kzg: ^1.0.8 + peerDependenciesMeta: + c-kzg: + optional: true + checksum: 98897e79adf03ee90ed98c6a543e15e0b4e127bc5bc381d70cdcc76b111574205b94869c29d925ea9e30a98e5ef8b0f5597914359deb9db552017b2e78ef17a8 + languageName: node + linkType: hard + +"@ethereumjs/util@npm:^8.0.0, @ethereumjs/util@npm:^8.0.2, @ethereumjs/util@npm:^8.0.5": + version: 8.0.5 + resolution: "@ethereumjs/util@npm:8.0.5" + dependencies: + "@chainsafe/ssz": 0.9.4 + "@ethereumjs/rlp": ^4.0.1 + ethereum-cryptography: ^1.1.2 + checksum: 318386785295b4584289b1aa576d2621392b3a918d127890db62d3f74184f3377694dd9e951e19bfb9ab80e8dc9e38e180236cac2651dead26097d10963731f9 languageName: node linkType: hard @@ -4408,7 +4464,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^3.0.1, @metamask/utils@npm:^3.0.3, @metamask/utils@npm:^3.3.0, @metamask/utils@npm:^3.3.1, @metamask/utils@npm:^3.4.0, @metamask/utils@npm:^3.4.1, @metamask/utils@npm:^3.6.0": +"@metamask/utils@npm:^3.0.1, @metamask/utils@npm:^3.0.3, @metamask/utils@npm:^3.3.0, @metamask/utils@npm:^3.3.1, @metamask/utils@npm:^3.4.0, @metamask/utils@npm:^3.4.1": version: 3.6.0 resolution: "@metamask/utils@npm:3.6.0" dependencies: @@ -4420,6 +4476,19 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^5.0.0": + version: 5.0.0 + resolution: "@metamask/utils@npm:5.0.0" + dependencies: + "@ethereumjs/tx": ^4.1.1 + "@types/debug": ^4.1.7 + debug: ^4.3.4 + semver: ^7.3.8 + superstruct: ^1.0.3 + checksum: 34e39fc0bf28db5fe92676753de3291b05a517f8c81dbe332a4b6002739a58450a89fb2bddd85922a4f420affb1674604e6ad4627cdf052459e5371361ef7dd2 + languageName: node + linkType: hard + "@mrmlnc/readdir-enhanced@npm:^2.2.1": version: 2.2.1 resolution: "@mrmlnc/readdir-enhanced@npm:2.2.1" @@ -9764,13 +9833,6 @@ __metadata: languageName: node linkType: hard -"async@npm:^3.2.4": - version: 3.2.4 - resolution: "async@npm:3.2.4" - checksum: 43d07459a4e1d09b84a20772414aa684ff4de085cbcaec6eea3c7a8f8150e8c62aa6cd4e699fe8ee93c3a5b324e777d34642531875a0817a35697522c1b02e89 - languageName: node - linkType: hard - "asynckit@npm:^0.4.0": version: 0.4.0 resolution: "asynckit@npm:0.4.0" @@ -11572,6 +11634,13 @@ __metadata: languageName: node linkType: hard +"case@npm:^1.6.3": + version: 1.6.3 + resolution: "case@npm:1.6.3" + checksum: febe73278f910b0d28aab7efd6f51c235f9aa9e296148edb56dfb83fd58faa88308c30ce9a0122b6e53e0362c44f4407105bd5ef89c46860fc2b184e540fd68d + languageName: node + linkType: hard + "caseless@npm:~0.12.0": version: 0.12.0 resolution: "caseless@npm:0.12.0" @@ -24231,7 +24300,7 @@ __metadata: "@metamask/snaps-utils": ^0.30.0 "@metamask/subject-metadata-controller": ^1.0.0 "@metamask/test-dapp": ^5.6.0 - "@metamask/utils": ^3.6.0 + "@metamask/utils": ^5.0.0 "@ngraveio/bc-ur": ^1.1.6 "@popperjs/core": ^2.4.0 "@reduxjs/toolkit": ^1.6.2 From dce4c6d7c5ed6a99d99f20aca00e3db16840e458 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Thu, 16 Mar 2023 11:45:44 +0100 Subject: [PATCH 009/129] [FLASK] Fix overflow issues with text coming from snap UI (#18169) --- .../app/flask/snap-ui-markdown/snap-ui-markdown.js | 6 +++++- .../app/flask/snap-ui-renderer/snap-ui-renderer.js | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js b/ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js index 080dbf900..359521152 100644 --- a/ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js +++ b/ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js @@ -1,7 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import ReactMarkdown from 'react-markdown'; -import { TypographyVariant } from '../../../../helpers/constants/design-system'; +import { + TypographyVariant, + OVERFLOW_WRAP, +} from '../../../../helpers/constants/design-system'; import Typography from '../../../ui/typography/typography'; const Paragraph = (props) => ( @@ -9,6 +12,7 @@ const Paragraph = (props) => ( {...props} variant={TypographyVariant.H6} className="snap-ui-markdown__text" + overflowWrap={OVERFLOW_WRAP.BREAK_WORD} /> ); diff --git a/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.js b/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.js index 11f1319d3..731bd599f 100644 --- a/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.js +++ b/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.js @@ -9,6 +9,7 @@ import { FONT_WEIGHT, DISPLAY, FLEX_DIRECTION, + OVERFLOW_WRAP, } from '../../../../helpers/constants/design-system'; import { SnapDelineator } from '../snap-delineator'; import { useI18nContext } from '../../../../hooks/useI18nContext'; @@ -33,6 +34,7 @@ export const UI_MAPPING = { props: { variant: TypographyVariant.H3, fontWeight: FONT_WEIGHT.BOLD, + overflowWrap: OVERFLOW_WRAP.BREAK_WORD, }, }), text: (props) => ({ From 0b83b13b4a732b6d9f02b0f0148278fa245da867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Thu, 16 Mar 2023 11:03:54 +0000 Subject: [PATCH 010/129] MMI adds the Jwt dropdown component (#18117) * MMI adds the Jwt dropdown * MMI prettier * review fixes * MMI added stories file --- .../__snapshots__/jwt-dropdown.test.js.snap | 43 ++++++++++++++ .../institutional/jwt-dropdown/index.js | 1 + .../jwt-dropdown/jwt-dropdown.js | 58 +++++++++++++++++++ .../jwt-dropdown/jwt-dropdown.scss | 10 ++++ .../jwt-dropdown/jwt-dropdown.stories.js | 19 ++++++ .../jwt-dropdown/jwt-dropdown.test.js | 23 ++++++++ 6 files changed, 154 insertions(+) create mode 100644 ui/components/institutional/jwt-dropdown/__snapshots__/jwt-dropdown.test.js.snap create mode 100644 ui/components/institutional/jwt-dropdown/index.js create mode 100644 ui/components/institutional/jwt-dropdown/jwt-dropdown.js create mode 100644 ui/components/institutional/jwt-dropdown/jwt-dropdown.scss create mode 100644 ui/components/institutional/jwt-dropdown/jwt-dropdown.stories.js create mode 100644 ui/components/institutional/jwt-dropdown/jwt-dropdown.test.js diff --git a/ui/components/institutional/jwt-dropdown/__snapshots__/jwt-dropdown.test.js.snap b/ui/components/institutional/jwt-dropdown/__snapshots__/jwt-dropdown.test.js.snap new file mode 100644 index 000000000..2612ae47c --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/__snapshots__/jwt-dropdown.test.js.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`JwtDropdown should render the Jwt dropdown component 1`] = ` +
+
+

+ [selectJWT] +

+ +
+
+`; diff --git a/ui/components/institutional/jwt-dropdown/index.js b/ui/components/institutional/jwt-dropdown/index.js new file mode 100644 index 000000000..455c3c0ae --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/index.js @@ -0,0 +1 @@ +export { default } from './jwt-dropdown'; diff --git a/ui/components/institutional/jwt-dropdown/jwt-dropdown.js b/ui/components/institutional/jwt-dropdown/jwt-dropdown.js new file mode 100644 index 000000000..fd1fc4f28 --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/jwt-dropdown.js @@ -0,0 +1,58 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import Dropdown from '../../ui/dropdown'; +import Box from '../../ui/box'; +import { Color } from '../../../helpers/constants/design-system'; +import { Text } from '../../component-library'; +import { useI18nContext } from '../../../hooks/useI18nContext'; + +const JwtDropdown = (props) => { + const t = useI18nContext(); + const { currentJwt, jwtList } = props; + + return ( + + + {t('selectJWT')} + + item === currentJwt) + ? [] + : [ + { + value: currentJwt, + name: + currentJwt.length > 9 + ? `...${currentJwt.slice(-9)}` + : currentJwt, + }, + ]), + ...jwtList.map((text) => { + return { + value: text, + name: `...${text?.slice(-9)}`, + }; + }), + ]} + onChange={(opt) => props.onChange(opt.value)} + /> + + ); +}; + +JwtDropdown.propTypes = { + jwtList: PropTypes.array, + currentJwt: PropTypes.string, + onChange: PropTypes.func, +}; + +export default JwtDropdown; diff --git a/ui/components/institutional/jwt-dropdown/jwt-dropdown.scss b/ui/components/institutional/jwt-dropdown/jwt-dropdown.scss new file mode 100644 index 000000000..61d04f3bb --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/jwt-dropdown.scss @@ -0,0 +1,10 @@ +.custody-search-jwt__select { + height: 54px; + width: 100%; + display: flex; + align-items: center; + + &-title { + @include Paragraph; + } +} diff --git a/ui/components/institutional/jwt-dropdown/jwt-dropdown.stories.js b/ui/components/institutional/jwt-dropdown/jwt-dropdown.stories.js new file mode 100644 index 000000000..e691dc602 --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/jwt-dropdown.stories.js @@ -0,0 +1,19 @@ +import React from 'react'; +import { action } from '@storybook/addon-actions'; +import JwtDropdown from '.'; + +export default { + title: 'Components/Institutional/JwtDropdown', + component: JwtDropdown, + args: { + jwtList: ['jwt1', 'jwt2'], + currentJwt: 'jwt1', + onChange: () => { + action('onChange'); + }, + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'JwtDropdown'; diff --git a/ui/components/institutional/jwt-dropdown/jwt-dropdown.test.js b/ui/components/institutional/jwt-dropdown/jwt-dropdown.test.js new file mode 100644 index 000000000..58fdc2aa5 --- /dev/null +++ b/ui/components/institutional/jwt-dropdown/jwt-dropdown.test.js @@ -0,0 +1,23 @@ +import { render, fireEvent } from '@testing-library/react'; +import React from 'react'; +import sinon from 'sinon'; +import JwtDropdown from './jwt-dropdown'; + +describe('JwtDropdown', () => { + it('should render the Jwt dropdown component', () => { + const props = { + jwtList: ['jwy1', 'jwt2'], + currentJwt: 'someToken', + onChange: sinon.spy(), + }; + + const { getByTestId, container } = render(); + + fireEvent.change(getByTestId('jwt-dropdown'), { + target: { value: 'jwt2' }, + }); + + expect(getByTestId('jwt-dropdown')).toBeDefined(); + expect(container).toMatchSnapshot(); + }); +}); From 0a376fe3ab662d30d53d334025e2089788d57803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Thu, 16 Mar 2023 11:26:00 +0000 Subject: [PATCH 011/129] MMI adds the note-to-trader component (#18106) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * MMI adds the note-to-trader component * MMI adds colors vars * MMI added component folder * MMI adds fireEvent * adds Box * review fixes * adds story * lint fix * prettier fix * prettier fix --------- Co-authored-by: Albert Olivé --- .../__snapshots__/note-to-trader.test.js.snap | 35 ++++++++++++ .../institutional/note-to-trader/index.js | 1 + .../institutional/note-to-trader/index.scss | 23 ++++++++ .../note-to-trader/note-to-trader.js | 53 +++++++++++++++++++ .../note-to-trader/note-to-trader.stories.js | 21 ++++++++ .../note-to-trader/note-to-trader.test.js | 23 ++++++++ 6 files changed, 156 insertions(+) create mode 100644 ui/components/institutional/note-to-trader/__snapshots__/note-to-trader.test.js.snap create mode 100644 ui/components/institutional/note-to-trader/index.js create mode 100644 ui/components/institutional/note-to-trader/index.scss create mode 100644 ui/components/institutional/note-to-trader/note-to-trader.js create mode 100644 ui/components/institutional/note-to-trader/note-to-trader.stories.js create mode 100644 ui/components/institutional/note-to-trader/note-to-trader.test.js diff --git a/ui/components/institutional/note-to-trader/__snapshots__/note-to-trader.test.js.snap b/ui/components/institutional/note-to-trader/__snapshots__/note-to-trader.test.js.snap new file mode 100644 index 000000000..94a2fff67 --- /dev/null +++ b/ui/components/institutional/note-to-trader/__snapshots__/note-to-trader.test.js.snap @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NoteToTrader should render the Note to trader component 1`] = ` +
+
+ +

+ 9 + / + 280 +

+
+
+ +
+
+`; diff --git a/ui/components/institutional/note-to-trader/index.js b/ui/components/institutional/note-to-trader/index.js new file mode 100644 index 000000000..58b37d910 --- /dev/null +++ b/ui/components/institutional/note-to-trader/index.js @@ -0,0 +1 @@ +export { default } from './note-to-trader'; diff --git a/ui/components/institutional/note-to-trader/index.scss b/ui/components/institutional/note-to-trader/index.scss new file mode 100644 index 000000000..692ef8a5c --- /dev/null +++ b/ui/components/institutional/note-to-trader/index.scss @@ -0,0 +1,23 @@ +.note-header { + line-height: 100%; + margin: 0 0 5px 0; + + label { + color: var(--black); + margin: 0 0 4px 0; + } +} + +.note-field { + textarea { + min-height: 90px; + border-radius: 5px; + padding: 10px; + font-size: 12px; + resize: none; + + &::placeholder { + color: var(--color-icon-alternative); + } + } +} diff --git a/ui/components/institutional/note-to-trader/note-to-trader.js b/ui/components/institutional/note-to-trader/note-to-trader.js new file mode 100644 index 000000000..5d8ba4c92 --- /dev/null +++ b/ui/components/institutional/note-to-trader/note-to-trader.js @@ -0,0 +1,53 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { + DISPLAY, + FLEX_DIRECTION, + JustifyContent, +} from '../../../helpers/constants/design-system'; +import { Label, Text } from '../../component-library'; +import Box from '../../ui/box'; + +const NoteToTrader = (props) => { + const { placeholder, maxLength, onChange, noteText, labelText } = props; + + return ( + <> + + + + {noteText.length}/{maxLength} + + + +