Skip to content

Commit

Permalink
DONTMERGE: patch in github.com/MetaMask/eth-json-rpc-middleware/pull/263
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Oct 26, 2023
1 parent 2eb62db commit b21e5fd
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/dist/wallet.js b/dist/wallet.js
index 89e30ef9b44f3852ecef5e0ae7336e1d6903d6a5..c38576393a91f666ad4b2ccef67cbded4d88234b 100644
--- a/dist/wallet.js
+++ b/dist/wallet.js
@@ -72,9 +72,9 @@ function createWalletMiddleware({ getAccounts, processDecryptMessage, processEnc
throw rpc_errors_1.rpcErrors.invalidInput();
}
const params = req.params;
- const txParams = {
+ const txParams = Object.assign({}, req.params[0] || {}, {
from: await validateAndNormalizeKeyholder(((_a = params[0]) === null || _a === void 0 ? void 0 : _a.from) || '', req),
- };
+ });
res.result = await processTransaction(txParams, req);
}
async function signTransaction(req, res) {
@@ -88,9 +88,9 @@ function createWalletMiddleware({ getAccounts, processDecryptMessage, processEnc
throw rpc_errors_1.rpcErrors.invalidInput();
}
const params = req.params;
- const txParams = {
+ const txParams = Object.assign({}, req.params[0] || {}, {
from: await validateAndNormalizeKeyholder(((_a = params[0]) === null || _a === void 0 ? void 0 : _a.from) || '', req),
- };
+ });
res.result = await processSignTransaction(txParams, req);
}
//
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
"@metamask/signature-controller@^6.1.2": "patch:@metamask/signature-controller@npm%3A6.1.2#~/.yarn/patches/@metamask-signature-controller-npm-6.1.2-f60d8a4960.patch",
"[email protected]": "^7.5.4",
"[email protected]": "^7.5.4",
"@metamask/eth-keyring-controller@npm:^13.0.1": "patch:@metamask/eth-keyring-controller@npm%3A13.0.1#~/.yarn/patches/@metamask-eth-keyring-controller-npm-13.0.1-06ff83faad.patch"
"@metamask/eth-keyring-controller@npm:^13.0.1": "patch:@metamask/eth-keyring-controller@npm%3A13.0.1#~/.yarn/patches/@metamask-eth-keyring-controller-npm-13.0.1-06ff83faad.patch",
"@metamask/eth-json-rpc-middleware@npm:^12.0.0": "patch:@metamask/eth-json-rpc-middleware@npm%3A12.0.0#~/.yarn/patches/@metamask-eth-json-rpc-middleware-npm-12.0.0-0e9d7bc980.patch"
},
"dependencies": {
"@babel/runtime": "^7.23.2",
Expand Down Expand Up @@ -245,7 +246,7 @@
"@metamask/controller-utils": "^5.0.0",
"@metamask/design-tokens": "^1.12.0",
"@metamask/desktop": "^0.3.0",
"@metamask/eth-json-rpc-middleware": "^12.0.0",
"@metamask/eth-json-rpc-middleware": "patch:@metamask/eth-json-rpc-middleware@npm%3A12.0.0#~/.yarn/patches/@metamask-eth-json-rpc-middleware-npm-12.0.0-0e9d7bc980.patch",
"@metamask/eth-keyring-controller": "^13.0.1",
"@metamask/eth-ledger-bridge-keyring": "^0.15.0",
"@metamask/eth-snap-keyring": "^1.0.0",
Expand Down
21 changes: 19 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4134,7 +4134,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@npm:^12.0.0":
"@metamask/eth-json-rpc-middleware@npm:12.0.0":
version: 12.0.0
resolution: "@metamask/eth-json-rpc-middleware@npm:12.0.0"
dependencies:
Expand All @@ -4151,6 +4151,23 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@patch:@metamask/eth-json-rpc-middleware@npm%3A12.0.0#~/.yarn/patches/@metamask-eth-json-rpc-middleware-npm-12.0.0-0e9d7bc980.patch":
version: 12.0.0
resolution: "@metamask/eth-json-rpc-middleware@patch:@metamask/eth-json-rpc-middleware@npm%3A12.0.0#~/.yarn/patches/@metamask-eth-json-rpc-middleware-npm-12.0.0-0e9d7bc980.patch::version=12.0.0&hash=7da1ac"
dependencies:
"@metamask/eth-json-rpc-provider": "npm:^2.1.0"
"@metamask/eth-sig-util": "npm:^7.0.0"
"@metamask/json-rpc-engine": "npm:^7.1.1"
"@metamask/rpc-errors": "npm:^6.0.0"
"@metamask/utils": "npm:^8.1.0"
eth-block-tracker: "npm:^8.0.0"
klona: "npm:^2.0.6"
pify: "npm:^5.0.0"
safe-stable-stringify: "npm:^2.4.3"
checksum: 555c796adedfe1bc750daebdf0ca207c2a95e72ae3c77a41df1dbdc310ec5618b11363df21abbf058c88d27c50ea173f65b82a78319f5e7f985ccdf55f55a295
languageName: node
linkType: hard

"@metamask/eth-json-rpc-provider@npm:^2.1.0, @metamask/eth-json-rpc-provider@npm:^2.2.0":
version: 2.2.0
resolution: "@metamask/eth-json-rpc-provider@npm:2.2.0"
Expand Down Expand Up @@ -24645,7 +24662,7 @@ __metadata:
"@metamask/eslint-config-mocha": "npm:^9.0.0"
"@metamask/eslint-config-nodejs": "npm:^9.0.0"
"@metamask/eslint-config-typescript": "npm:^9.0.1"
"@metamask/eth-json-rpc-middleware": "npm:^12.0.0"
"@metamask/eth-json-rpc-middleware": "patch:@metamask/eth-json-rpc-middleware@npm%3A12.0.0#~/.yarn/patches/@metamask-eth-json-rpc-middleware-npm-12.0.0-0e9d7bc980.patch"
"@metamask/eth-keyring-controller": "npm:^13.0.1"
"@metamask/eth-ledger-bridge-keyring": "npm:^0.15.0"
"@metamask/eth-snap-keyring": "npm:^1.0.0"
Expand Down

0 comments on commit b21e5fd

Please sign in to comment.