From 6d86914c9494242e837aeac9cd37516b2b704911 Mon Sep 17 00:00:00 2001 From: ryanml Date: Sun, 2 Oct 2022 21:02:43 -0700 Subject: [PATCH] Merge fixes --- .../@metamask+snap-controllers+0.20.0.patch | 62 ------------------- test/test-results/junit.xml | 23 ------- .../loading-network-screen.component.js | 22 ------- 3 files changed, 107 deletions(-) delete mode 100644 patches/@metamask+snap-controllers+0.20.0.patch delete mode 100644 test/test-results/junit.xml diff --git a/patches/@metamask+snap-controllers+0.20.0.patch b/patches/@metamask+snap-controllers+0.20.0.patch deleted file mode 100644 index 6e1df558c..000000000 --- a/patches/@metamask+snap-controllers+0.20.0.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js b/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js -index ad84417..158e8e6 100644 ---- a/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js -+++ b/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js -@@ -30,6 +30,7 @@ const RequestQueue_1 = require("./RequestQueue"); - const utils_3 = require("./utils"); - const Timer_1 = require("./Timer"); - exports.controllerName = 'SnapController'; -+exports.SNAP_APPROVAL_INSTALL = 'wallet_installSnap'; - exports.SNAP_APPROVAL_UPDATE = 'wallet_updateSnap'; - const TRUNCATED_SNAP_PROPERTIES = new Set([ - 'initialPermissions', -@@ -738,7 +739,7 @@ class SnapController extends controllers_1.BaseControllerV2 { - id: snapId, - versionRange, - }); -- await this.authorize(snapId); -+ await this.authorize(origin, snapId); - await this._startSnap({ - snapId, - sourceCode, -@@ -1073,18 +1074,34 @@ class SnapController extends controllers_1.BaseControllerV2 { - * @param snapId - The id of the Snap. - * @returns The snap's approvedPermissions. - */ -- async authorize(snapId) { -+ async authorize(origin, snapId) { - console.info(`Authorizing snap: ${snapId}`); - const snapsState = this.state.snaps; - const snap = snapsState[snapId]; - const { initialPermissions } = snap; - try { -- if ((0, utils_1.isNonEmptyArray)(Object.keys(initialPermissions))) { -- const processedPermissions = this.processSnapPermissions(initialPermissions); -- const [approvedPermissions] = await this.messagingSystem.call('PermissionController:requestPermissions', { origin: snapId }, processedPermissions); -- return Object.values(approvedPermissions).map((perm) => perm.parentCapability); -+ const processedPermissions = this.processSnapPermissions(initialPermissions); -+ const id = (0, nanoid_1.nanoid)(); -+ const isApproved = await this.messagingSystem.call('ApprovalController:addRequest', { -+ origin, -+ id, -+ type: exports.SNAP_APPROVAL_INSTALL, -+ requestData: { -+ // Mirror previous installation metadata -+ metadata: { id, origin: snapId, dappOrigin: origin }, -+ permissions: processedPermissions, -+ snapId, -+ }, -+ }, true); -+ if (!isApproved) { -+ throw eth_rpc_errors_1.ethErrors.provider.userRejectedRequest(); -+ } -+ if ((0, utils_1.isNonEmptyArray)(Object.keys(processedPermissions))) { -+ await this.messagingSystem.call('PermissionController:grantPermissions', { -+ approvedPermissions: processedPermissions, -+ subject: { origin: snapId }, -+ }); - } -- return []; - } - finally { - const runtime = this.getRuntimeExpect(snapId); diff --git a/test/test-results/junit.xml b/test/test-results/junit.xml deleted file mode 100644 index 400f40ec7..000000000 --- a/test/test-results/junit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ui/components/app/loading-network-screen/loading-network-screen.component.js b/ui/components/app/loading-network-screen/loading-network-screen.component.js index fc43cb41c..bf241cfce 100644 --- a/ui/components/app/loading-network-screen/loading-network-screen.component.js +++ b/ui/components/app/loading-network-screen/loading-network-screen.component.js @@ -76,28 +76,6 @@ export default class LoadingNetworkScreen extends PureComponent { ); }; - renderDeprecatedRpcUrlWarning = () => { - const { showNetworkDropdown } = this.props; - - return ( -
- 😞 - {this.context.t('currentRpcUrlDeprecated')} -
- -
-
- ); - }; - renderErrorScreenContent = () => { const { showNetworkDropdown, setProviderArgs, setProviderType } = this.props;