-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25025 from MetaMask/Version-v11.16.6
Version v11.16.6
- Loading branch information
Showing
209 changed files
with
4,388 additions
and
1,066 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ git clone [email protected]:MetaMask/extension_bundlesize_stats.git temp | |
|
||
{ | ||
echo " '${CIRCLE_SHA1}': "; | ||
cat test-artifacts/chrome/mv3/bundle_size_stats.json; | ||
cat test-artifacts/chrome/bundle_size_stats.json; | ||
echo ", "; | ||
} >> temp/stats/bundle_size_data.temp.js | ||
|
||
|
@@ -57,14 +57,14 @@ if [ -f temp/stats/bundle_size_data.json ]; then | |
{ | ||
echo "},"; | ||
echo "\"$CIRCLE_SHA1\":"; | ||
cat test-artifacts/chrome/mv3/bundle_size_stats.json; | ||
cat test-artifacts/chrome/bundle_size_stats.json; | ||
echo "}"; | ||
} >> bundle_size_stats.temp.json | ||
else | ||
{ | ||
echo "{"; | ||
echo "\"$CIRCLE_SHA1\":"; | ||
cat test-artifacts/chrome/mv3/bundle_size_stats.json; | ||
cat test-artifacts/chrome/bundle_size_stats.json; | ||
echo "}"; | ||
} > bundle_size_stats.temp.json | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
206 changes: 206 additions & 0 deletions
206
.yarn/patches/@metamask-snaps-controllers-npm-8.0.0-7e59688855.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
diff --git a/dist/chunk-IRVUYBSV.mjs b/dist/chunk-IRVUYBSV.mjs | ||
index 499574e7ffa925674ce2685f00742e15007df102..7926d9f03d5e6711944d0620dae9fc625c9fc2ab 100644 | ||
--- a/dist/chunk-IRVUYBSV.mjs | ||
+++ b/dist/chunk-IRVUYBSV.mjs | ||
@@ -31,14 +31,15 @@ import { | ||
import { nanoid } from "nanoid"; | ||
import { pipeline } from "readable-stream"; | ||
var controllerName = "ExecutionService"; | ||
-var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn; | ||
+var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _usePing, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn; | ||
var AbstractExecutionService = class { | ||
constructor({ | ||
setupSnapProvider, | ||
messenger, | ||
initTimeout = inMilliseconds(60, Duration.Second), | ||
pingTimeout = inMilliseconds(2, Duration.Second), | ||
- terminationTimeout = inMilliseconds(1, Duration.Second) | ||
+ terminationTimeout = inMilliseconds(1, Duration.Second), | ||
+ usePing = true | ||
}) { | ||
__privateAdd(this, _removeSnapHooks); | ||
__privateAdd(this, _createSnapHooks); | ||
@@ -51,6 +52,7 @@ var AbstractExecutionService = class { | ||
__privateAdd(this, _initTimeout, void 0); | ||
__privateAdd(this, _pingTimeout, void 0); | ||
__privateAdd(this, _terminationTimeout, void 0); | ||
+ __privateAdd(this, _usePing, void 0); | ||
__privateSet(this, _snapRpcHooks, /* @__PURE__ */ new Map()); | ||
this.jobs = /* @__PURE__ */ new Map(); | ||
this.setupSnapProvider = setupSnapProvider; | ||
@@ -60,6 +62,7 @@ var AbstractExecutionService = class { | ||
__privateSet(this, _initTimeout, initTimeout); | ||
__privateSet(this, _pingTimeout, pingTimeout); | ||
__privateSet(this, _terminationTimeout, terminationTimeout); | ||
+ __privateSet(this, _usePing, usePing); | ||
this.registerMessageHandlers(); | ||
} | ||
/** | ||
@@ -268,16 +271,18 @@ var AbstractExecutionService = class { | ||
const timer = new Timer(__privateGet(this, _initTimeout)); | ||
const job = await this.initJob(jobId, timer); | ||
__privateMethod(this, _mapSnapAndJob, mapSnapAndJob_fn).call(this, snapId, job.id); | ||
- const pingResult = await withTimeout( | ||
- this.command(job.id, { | ||
- jsonrpc: "2.0", | ||
- method: "ping", | ||
- id: nanoid() | ||
- }), | ||
- __privateGet(this, _pingTimeout) | ||
- ); | ||
- if (pingResult === hasTimedOut) { | ||
- throw new Error("The Snaps execution environment failed to start."); | ||
+ if (__privateGet(this, _usePing)) { | ||
+ const pingResult = await withTimeout( | ||
+ this.command(job.id, { | ||
+ jsonrpc: "2.0", | ||
+ method: "ping", | ||
+ id: nanoid() | ||
+ }), | ||
+ __privateGet(this, _pingTimeout) | ||
+ ); | ||
+ if (pingResult === hasTimedOut) { | ||
+ throw new Error("The Snaps execution environment failed to start."); | ||
+ } | ||
} | ||
const rpcStream = job.streams.rpc; | ||
this.setupSnapProvider(snapId, rpcStream); | ||
@@ -341,6 +346,7 @@ _messenger = new WeakMap(); | ||
_initTimeout = new WeakMap(); | ||
_pingTimeout = new WeakMap(); | ||
_terminationTimeout = new WeakMap(); | ||
+_usePing = new WeakMap(); | ||
_removeSnapHooks = new WeakSet(); | ||
removeSnapHooks_fn = function(snapId) { | ||
__privateGet(this, _snapRpcHooks).delete(snapId); | ||
diff --git a/dist/chunk-JZCXZEFV.js b/dist/chunk-JZCXZEFV.js | ||
index 1ace9d2de3101797650c7d1be19c184b782b4163..9142d804a6acbe2bb0d961c5a5bb1e633f377a92 100644 | ||
--- a/dist/chunk-JZCXZEFV.js | ||
+++ b/dist/chunk-JZCXZEFV.js | ||
@@ -31,14 +31,15 @@ var _utils = require('@metamask/utils'); | ||
var _nanoid = require('nanoid'); | ||
var _readablestream = require('readable-stream'); | ||
var controllerName = "ExecutionService"; | ||
-var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn; | ||
+var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _usePing, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn; | ||
var AbstractExecutionService = class { | ||
constructor({ | ||
setupSnapProvider, | ||
messenger, | ||
initTimeout = _utils.inMilliseconds.call(void 0, 60, _utils.Duration.Second), | ||
pingTimeout = _utils.inMilliseconds.call(void 0, 2, _utils.Duration.Second), | ||
- terminationTimeout = _utils.inMilliseconds.call(void 0, 1, _utils.Duration.Second) | ||
+ terminationTimeout = _utils.inMilliseconds.call(void 0, 1, _utils.Duration.Second), | ||
+ usePing = true | ||
}) { | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _removeSnapHooks); | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _createSnapHooks); | ||
@@ -51,6 +52,7 @@ var AbstractExecutionService = class { | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _initTimeout, void 0); | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _pingTimeout, void 0); | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _terminationTimeout, void 0); | ||
+ _chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _usePing, void 0); | ||
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _snapRpcHooks, /* @__PURE__ */ new Map()); | ||
this.jobs = /* @__PURE__ */ new Map(); | ||
this.setupSnapProvider = setupSnapProvider; | ||
@@ -60,6 +62,7 @@ var AbstractExecutionService = class { | ||
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _initTimeout, initTimeout); | ||
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _pingTimeout, pingTimeout); | ||
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _terminationTimeout, terminationTimeout); | ||
+ _chunkEXN2TFDJjs.__privateSet.call(void 0, this, _usePing, usePing); | ||
this.registerMessageHandlers(); | ||
} | ||
/** | ||
@@ -268,16 +271,18 @@ var AbstractExecutionService = class { | ||
const timer = new (0, _chunkBOFPNIRXjs.Timer)(_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _initTimeout)); | ||
const job = await this.initJob(jobId, timer); | ||
_chunkEXN2TFDJjs.__privateMethod.call(void 0, this, _mapSnapAndJob, mapSnapAndJob_fn).call(this, snapId, job.id); | ||
- const pingResult = await _chunk4DPX4O3Tjs.withTimeout.call(void 0, | ||
- this.command(job.id, { | ||
- jsonrpc: "2.0", | ||
- method: "ping", | ||
- id: _nanoid.nanoid.call(void 0, ) | ||
- }), | ||
- _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _pingTimeout) | ||
- ); | ||
- if (pingResult === _chunk4DPX4O3Tjs.hasTimedOut) { | ||
- throw new Error("The Snaps execution environment failed to start."); | ||
+ if (_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _usePing)) { | ||
+ const pingResult = await _chunk4DPX4O3Tjs.withTimeout.call(void 0, | ||
+ this.command(job.id, { | ||
+ jsonrpc: "2.0", | ||
+ method: "ping", | ||
+ id: _nanoid.nanoid.call(void 0, ) | ||
+ }), | ||
+ _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _pingTimeout) | ||
+ ); | ||
+ if (pingResult === _chunk4DPX4O3Tjs.hasTimedOut) { | ||
+ throw new Error("The Snaps execution environment failed to start."); | ||
+ } | ||
} | ||
const rpcStream = job.streams.rpc; | ||
this.setupSnapProvider(snapId, rpcStream); | ||
@@ -341,6 +346,7 @@ _messenger = new WeakMap(); | ||
_initTimeout = new WeakMap(); | ||
_pingTimeout = new WeakMap(); | ||
_terminationTimeout = new WeakMap(); | ||
+_usePing = new WeakMap(); | ||
_removeSnapHooks = new WeakSet(); | ||
removeSnapHooks_fn = function(snapId) { | ||
_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _snapRpcHooks).delete(snapId); | ||
diff --git a/dist/chunk-M2NMZ4ER.js b/dist/chunk-M2NMZ4ER.js | ||
index 5e56452ad179871bb8e9580437f53016c0094273..a634cc4a0b2012cf3af314bd3d72131e971046cd 100644 | ||
--- a/dist/chunk-M2NMZ4ER.js | ||
+++ b/dist/chunk-M2NMZ4ER.js | ||
@@ -32,7 +32,8 @@ var ProxyExecutionService = class extends _chunkJZCXZEFVjs.AbstractExecutionServ | ||
}) { | ||
super({ | ||
messenger, | ||
- setupSnapProvider | ||
+ setupSnapProvider, | ||
+ usePing: false | ||
}); | ||
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _stream, void 0); | ||
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _stream, stream); | ||
@@ -63,6 +64,13 @@ var ProxyExecutionService = class extends _chunkJZCXZEFVjs.AbstractExecutionServ | ||
stream: _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _stream), | ||
jobId | ||
}); | ||
+ await new Promise((resolve) => { | ||
+ stream.once("data", resolve); | ||
+ stream.write({ | ||
+ name: "command", | ||
+ data: { jsonrpc: "2.0", method: "ping", id: _nanoid.nanoid.call(void 0, ) } | ||
+ }); | ||
+ }); | ||
return { worker: jobId, stream }; | ||
} | ||
}; | ||
diff --git a/dist/chunk-MB23XAVD.mjs b/dist/chunk-MB23XAVD.mjs | ||
index 3a31a241bd689e480f2cf573d894e6aefc4dc672..6467cdf0893ff4b0f0a71b28f6b4d7603c5257eb 100644 | ||
--- a/dist/chunk-MB23XAVD.mjs | ||
+++ b/dist/chunk-MB23XAVD.mjs | ||
@@ -32,7 +32,8 @@ var ProxyExecutionService = class extends AbstractExecutionService { | ||
}) { | ||
super({ | ||
messenger, | ||
- setupSnapProvider | ||
+ setupSnapProvider, | ||
+ usePing: false | ||
}); | ||
__privateAdd(this, _stream, void 0); | ||
__privateSet(this, _stream, stream); | ||
@@ -63,6 +64,13 @@ var ProxyExecutionService = class extends AbstractExecutionService { | ||
stream: __privateGet(this, _stream), | ||
jobId | ||
}); | ||
+ await new Promise((resolve) => { | ||
+ stream.once("data", resolve); | ||
+ stream.write({ | ||
+ name: "command", | ||
+ data: { jsonrpc: "2.0", method: "ping", id: nanoid() } | ||
+ }); | ||
+ }); | ||
return { worker: jobId, stream }; | ||
} | ||
}; |
43 changes: 43 additions & 0 deletions
43
.yarn/patches/@trezor-connect-web-npm-9.2.2-a4de8e45fc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index 82a21b70dc18597fdbb1c5bfdbebb10f615c723d..04edf4b3a8a5a2bebda8bf907225b502ab5c30ad 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -109,7 +109,9 @@ const init = async (settings = {}) => { | ||
_log.enabled = !!_settings.debug; | ||
window.addEventListener('message', handleMessage); | ||
window.addEventListener('unload', dispose); | ||
- await iframe.init(_settings); | ||
+ var modifiedSettings = Object.assign({}, _settings); | ||
+ modifiedSettings.env = 'webextension'; | ||
+ await iframe.init(modifiedSettings); | ||
if (_settings.sharedLogger !== false) { | ||
iframe.initIframeLogger(); | ||
} | ||
@@ -125,7 +127,9 @@ const call = async (params) => { | ||
} | ||
_popupManager.request(); | ||
try { | ||
- await init(_settings); | ||
+ var modifiedSettings = Object.assign({}, _settings); | ||
+ modifiedSettings.env = 'webextension'; | ||
+ await init(modifiedSettings); | ||
} | ||
catch (error) { | ||
if (_popupManager) { | ||
diff --git a/lib/popup/index.js b/lib/popup/index.js | ||
index 6948bdb73b381bb72fb8b87fe2006d0046b65acb..d8f80f77728a18a851da3f03a5ed956cb46fe8e6 100644 | ||
--- a/lib/popup/index.js | ||
+++ b/lib/popup/index.js | ||
@@ -272,9 +272,11 @@ class PopupManager extends events_1.default { | ||
this.popupPromise.resolve(); | ||
} | ||
(_b = this.iframeHandshakePromise) === null || _b === void 0 ? void 0 : _b.promise.then(payload => { | ||
+ var modifiedSettings = Object.assign({}, this.settings); | ||
+ modifiedSettings.env = 'webextension'; | ||
this.channel.postMessage({ | ||
type: events_2.POPUP.INIT, | ||
- payload: Object.assign(Object.assign({}, payload), { settings: this.settings }), | ||
+ payload: Object.assign(Object.assign({}, payload), { settings: modifiedSettings }), | ||
}); | ||
}); | ||
} |
2 changes: 1 addition & 1 deletion
2
...r-schema-utils-npm-1.0.1-70c2a68232.patch → ...r-schema-utils-npm-1.0.2-7dd48689b2.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/package.json b/package.json | ||
index 0f83178c00d4168f35241589d2e77c8a874ed4bd..f0ff8911f5366f9cb05c64e73fe38c4b3e9a74a7 100644 | ||
--- a/package.json | ||
+++ b/package.json | ||
@@ -4,7 +4,6 @@ | ||
"description": "A very small TypeScript library that provides tolerable Mixin functionality.", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
- "browser": "dist/esm/index.js", | ||
"unpkg": "dist/esm/index.min.js", | ||
"types": "dist/types/index.d.ts", | ||
"files": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.