Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLASK] Bump snaps packages #20567

Merged
merged 10 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


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

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

22 changes: 18 additions & 4 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,12 @@ export default class MetamaskController extends EventEmitter {
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
additionalKeyrings.push(
(() => {
const builder = () => new SnapKeyring(this.snapController);
const builder = () =>
new SnapKeyring(this.snapController, {
saveState: async () => {
await this.keyringController.persistAllKeyrings();
},
});
builder.type = SnapKeyring.type;
return builder;
})(),
Expand Down Expand Up @@ -1888,6 +1893,17 @@ export default class MetamaskController extends EventEmitter {
return this.controllerMessenger.call('SnapController:handleRequest', args);
}

/**
* Gets the currently selected locale from the PreferencesController.
*
* @returns The currently selected locale.
*/
getLocale() {
const { currentLocale } = this.preferencesController.store.getState();

return currentLocale;
}

/**
* Constructor helper for getting Snap permission specifications.
*/
Expand All @@ -1897,6 +1913,7 @@ export default class MetamaskController extends EventEmitter {
...buildSnapRestrictedMethodSpecifications({
encrypt,
decrypt,
getLocale: this.getLocale.bind(this),
clearSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:clearSnapState',
Expand Down Expand Up @@ -1943,9 +1960,6 @@ export default class MetamaskController extends EventEmitter {
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
getSnapKeyring: this.getSnapKeyring.bind(this),
saveSnapKeyring: async () => {
await this.keyringController.persistAllKeyrings();
},
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
}),
Expand Down
4 changes: 2 additions & 2 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.1-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.3-flask.1/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand All @@ -76,7 +76,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.1-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.3-flask.1/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand Down
15 changes: 14 additions & 1 deletion lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1791,14 +1791,27 @@
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/permission-controller>@metamask/utils": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"eth-rpc-errors": true,
"immer": true,
"json-rpc-engine": true
}
},
"@metamask/permission-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/permission-controller>nanoid": {
"globals": {
"crypto.getRandomValues": true
Expand Down
131 changes: 62 additions & 69 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1949,14 +1949,27 @@
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/permission-controller>@metamask/utils": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"eth-rpc-errors": true,
"immer": true,
"json-rpc-engine": true
}
},
"@metamask/permission-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/permission-controller>nanoid": {
"globals": {
"crypto.getRandomValues": true
Expand All @@ -1978,52 +1991,6 @@
"eslint>optionator>fast-levenshtein": true
}
},
"@metamask/post-message-stream": {
"globals": {
"MessageEvent.prototype": true,
"WorkerGlobalScope": true,
"addEventListener": true,
"browser": true,
"chrome": true,
"location.origin": true,
"postMessage": true,
"removeEventListener": true
},
"packages": {
"@metamask/post-message-stream>readable-stream": true,
"@metamask/utils": true
}
},
"@metamask/post-message-stream>readable-stream": {
"packages": {
"@metamask/post-message-stream>readable-stream>process-nextick-args": true,
"@metamask/post-message-stream>readable-stream>safe-buffer": true,
"@metamask/post-message-stream>readable-stream>string_decoder": true,
"browserify>browser-resolve": true,
"browserify>events": true,
"browserify>process": true,
"browserify>timers-browserify": true,
"pumpify>inherits": true,
"readable-stream>core-util-is": true,
"readable-stream>isarray": true,
"readable-stream>util-deprecate": true
}
},
"@metamask/post-message-stream>readable-stream>process-nextick-args": {
"packages": {
"browserify>process": true
}
},
"@metamask/post-message-stream>readable-stream>safe-buffer": {
"packages": {
"browserify>buffer": true
}
},
"@metamask/post-message-stream>readable-stream>string_decoder": {
"packages": {
"@metamask/post-message-stream>readable-stream>safe-buffer": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
Expand Down Expand Up @@ -2084,7 +2051,20 @@
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui": {
"packages": {
"@metamask/rpc-methods-flask>@metamask/utils": true,
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
Expand Down Expand Up @@ -2221,8 +2201,8 @@
"packages": {
"@metamask/base-controller": true,
"@metamask/permission-controller": true,
"@metamask/post-message-stream": true,
"@metamask/providers>@metamask/object-multiplex": true,
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
Expand All @@ -2239,48 +2219,61 @@
"pump": true
}
},
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": {
"globals": {
"MessageEvent.prototype": true,
"WorkerGlobalScope": true,
"addEventListener": true,
"browser": true,
"chrome": true,
"location.origin": true,
"postMessage": true,
"removeEventListener": true
},
"packages": {
"@metamask/snaps-controllers-flask>@metamask/post-message-stream>@metamask/utils": true,
"@metamask/snaps-controllers-flask>concat-stream>readable-stream": true
}
},
"@metamask/snaps-controllers-flask>@metamask/post-message-stream>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods": {
"packages": {
"@metamask/key-tree": true,
"@metamask/key-tree>@noble/hashes": true,
"@metamask/permission-controller": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"eth-rpc-errors": true,
"superstruct": true
}
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui": {
"packages": {
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-utils": {
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"URL": true,
"console.error": true,
"console.log": true,
"console.warn": true,
"document.body.appendChild": true,
"document.createElement": true
"TextEncoder": true
},
"packages": {
"@metamask/key-tree": true,
"@metamask/key-tree>@noble/hashes": true,
"@metamask/key-tree>@scure/base": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-utils-flask>is-svg": 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,
"browserify>buffer": true,
"browserify>path-browserify": true,
"browserify>process": true,
"chalk": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
Expand Down
Loading