-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix(deps): Bump @metamask/eth-json-rpc-middleware
to ^14.0.0
, @metamask/transaction-controller
to ^35.1.1
#26143
Merged
Merged
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
76972b0
Bump `@metamask/eth-json-rpc-middleware` from `^12.1.1` to `^14.0.0`
MajorLift 8976cf2
Fix type error regressions
MajorLift 9599905
Bump `@trezor/connect-web` to `9.3.0`, update patch, fix type errors …
MajorLift 633fe35
Fix tests
MajorLift f72b7c4
Allow `null` in params object of snaps requests
MajorLift 72206df
Define `PPOMMiddlewareRequest` type
MajorLift 26f4b63
Fix failing ppom-middleware tests
MajorLift 4e69823
Fix tests by reverting `importTime` field addition in migration 105
MajorLift 05432ed
Make `securityAlertResponse` property of `PPOMMiddlewareRequest` both…
MajorLift 548dde8
Rename `SecurityAlertsApiRequest` to `SecurityAlertsApiRequestBody` a…
MajorLift c4f4466
Fix misdefined `PPOMRequest` type
MajorLift dbfa9dd
minor test refactor for dry-ness
MajorLift 5f9b683
More concise generic parameter typing for `handleSnapRequest` calls
MajorLift 99bf3cd
Add generic constraint to `Params` generic parameter of `handleSnapRe…
MajorLift c91d976
Update LavaMoat policies
metamaskbot f09f100
Merge branch 'develop' into bump/eth-json-rpc-provider-14.0.0
MajorLift be27eee
Revert narrowing of `rawSnapRequestFunction` `value` parameter from `…
MajorLift 460d7b7
Merge branch 'develop' into bump/eth-json-rpc-provider-14.0.0
MajorLift 1433121
Update LavaMoat policies
metamaskbot 7ddf6e7
Merge branch 'develop' into bump/eth-json-rpc-provider-14.0.0
MajorLift e0f9925
Revert `rawSnapRequestFunction` allowing `null` type for `name`, `val…
MajorLift e653cc8
Restore commit lost during rebase: "Bump `@metamask/eth-json-rpc-midd…
MajorLift 31c95c6
Update LavaMoat policies
metamaskbot 9a159cf
Restore `as unknown as` casting for `BitcoinWalletSnap`
MajorLift 3c40934
Bump `@metamask/transaction-controller` from `^34.0.0` to `^35.1.1`
MajorLift fb5ffd3
Merge branch 'develop' into bump/eth-json-rpc-provider-14.0.0
MajorLift 4d13778
Dedupe lockfile
MajorLift File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
.yarn/patches/@trezor-connect-web-npm-9.3.0-040ab10d9a.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,33 @@ | ||
diff --git a/lib/impl/core-in-iframe.js b/lib/impl/core-in-iframe.js | ||
index c47cf3bff860d6b1855341c00b80fc6c40f9d6d5..275eb0f312ff396819fa406c154a3562842db49d 100644 | ||
--- a/lib/impl/core-in-iframe.js | ||
+++ b/lib/impl/core-in-iframe.js | ||
@@ -116,7 +116,9 @@ class CoreInIframe { | ||
this._log.enabled = !!this._settings.debug; | ||
window.addEventListener('message', this.boundHandleMessage); | ||
window.addEventListener('unload', this.boundDispose); | ||
- await iframe.init(this._settings); | ||
+ const modifiedSettings = Object.assign({}, this.settings); | ||
+ modifiedSettings.env = 'webextension'; | ||
+ await iframe.init(modifiedSettings); | ||
if (this._settings.sharedLogger !== false) { | ||
iframe.initIframeLogger(); | ||
} | ||
diff --git a/lib/popup/index.js b/lib/popup/index.js | ||
index 9b13c370a5ac8b4e4fc0315ed40cdf615d0bb0cb..4dbd97fc28df49beb73379451974ec48a8a42ea7 100644 | ||
--- a/lib/popup/index.js | ||
+++ b/lib/popup/index.js | ||
@@ -229,10 +229,12 @@ class PopupManager extends events_1.default { | ||
} | ||
else if (message.type === events_2.POPUP.LOADED) { | ||
this.handleMessage(message); | ||
+ const modifiedSettings = Object.assign({}, this.settings); | ||
+ modifiedSettings.env = 'webextension'; | ||
this.channel.postMessage({ | ||
type: events_2.POPUP.INIT, | ||
payload: { | ||
- settings: this.settings, | ||
+ settings: modifiedSettings, | ||
useCore: true, | ||
}, | ||
}); |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ import OurReadableStream from 'readable-stream'; | |
import ReadableStream2 from 'readable-stream-2'; | ||
import ReadableStream3 from 'readable-stream-3'; | ||
|
||
import type { JsonRpcRequest } from '@metamask/utils'; | ||
import type { JsonRpcNotification, JsonRpcRequest } from '@metamask/utils'; | ||
import createDupeReqFilterStream, { | ||
THREE_MINUTES, | ||
} from './createDupeReqFilterStream'; | ||
|
@@ -26,7 +26,7 @@ function createTestStream(output: JsonRpcRequest[] = [], S = Transform) { | |
} | ||
|
||
function runStreamTest( | ||
requests: JsonRpcRequest[] = [], | ||
requests: (JsonRpcRequest | JsonRpcNotification)[] = [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mock requests with no |
||
advanceTimersTime = 10, | ||
S = Transform, | ||
) { | ||
|
@@ -54,12 +54,12 @@ describe('createDupeReqFilterStream', () => { | |
const requests = [ | ||
{ id: 1, method: 'foo' }, | ||
{ id: 2, method: 'bar' }, | ||
]; | ||
].map((request) => ({ ...request, jsonrpc: '2.0' as const })); | ||
|
||
const expectedOutput = [ | ||
{ id: 1, method: 'foo' }, | ||
{ id: 2, method: 'bar' }, | ||
]; | ||
].map((output) => ({ ...output, jsonrpc: '2.0' })); | ||
|
||
const output = await runStreamTest(requests); | ||
expect(output).toEqual(expectedOutput); | ||
|
@@ -69,18 +69,25 @@ describe('createDupeReqFilterStream', () => { | |
const requests = [ | ||
{ id: 1, method: 'foo' }, | ||
{ id: 1, method: 'foo' }, // duplicate | ||
]; | ||
].map((request) => ({ ...request, jsonrpc: '2.0' as const })); | ||
|
||
const expectedOutput = [{ id: 1, method: 'foo' }]; | ||
const expectedOutput = [{ id: 1, method: 'foo' }].map((output) => ({ | ||
...output, | ||
jsonrpc: '2.0', | ||
})); | ||
|
||
const output = await runStreamTest(requests); | ||
expect(output).toEqual(expectedOutput); | ||
}); | ||
|
||
it("lets through requests if they don't have an id", async () => { | ||
const requests = [{ method: 'notify1' }, { method: 'notify2' }]; | ||
const requests = [{ method: 'notify1' }, { method: 'notify2' }].map( | ||
(request) => ({ ...request, jsonrpc: '2.0' as const }), | ||
); | ||
|
||
const expectedOutput = [{ method: 'notify1' }, { method: 'notify2' }]; | ||
const expectedOutput = [{ method: 'notify1' }, { method: 'notify2' }].map( | ||
(output) => ({ ...output, jsonrpc: '2.0' }), | ||
); | ||
|
||
const output = await runStreamTest(requests); | ||
expect(output).toEqual(expectedOutput); | ||
|
@@ -95,15 +102,15 @@ describe('createDupeReqFilterStream', () => { | |
{ method: 'notify2' }, | ||
{ id: 2, method: 'bar' }, | ||
{ id: 3, method: 'baz' }, | ||
]; | ||
].map((request) => ({ ...request, jsonrpc: '2.0' as const })); | ||
|
||
const expectedOutput = [ | ||
{ id: 1, method: 'foo' }, | ||
{ method: 'notify1' }, | ||
{ id: 2, method: 'bar' }, | ||
{ method: 'notify2' }, | ||
{ id: 3, method: 'baz' }, | ||
]; | ||
].map((output) => ({ ...output, jsonrpc: '2.0' })); | ||
|
||
const output = await runStreamTest(requests); | ||
expect(output).toEqual(expectedOutput); | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No user-facing changes other than the version bump.
The locations of the diffs have changed because the package has been refactored, but the applied changes are the same as those in the previous patch.