Skip to content

Commit

Permalink
Merge branch 'main' into fix/remove-supported-chains-check-ppom
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistevam authored Jan 28, 2025
2 parents 748ed7c + e2fea0f commit d5b9e39
Show file tree
Hide file tree
Showing 27 changed files with 287 additions and 270 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/lib/message/EIP712/index.js b/lib/message/EIP712/index.js
index 5443ac06d4ef29028e3acce98210949da2ef9263..57ec8615340a9285290ad5d2c2522ed19af2d0fc 100644
index a5c677ebf53ab6c22987cebf1c92b21c6245b5db..f5a5580df74100d5e1725bb783038c4c60ae1dbc 100644
--- a/lib/message/EIP712/index.js
+++ b/lib/message/EIP712/index.js
@@ -28,8 +28,8 @@ const ethers_1 = require("ethers");
const axios_1 = __importDefault(require("axios"));
const sha224_1 = __importDefault(require("crypto-js/sha224"));
@@ -29,8 +29,8 @@ const sha224_1 = __importDefault(require("crypto-js/sha224"));
const live_env_1 = require("@ledgerhq/live-env");
const constants_1 = require("@ethersproject/constants");
const hash_1 = require("@ethersproject/hash");
-const eip712_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/data/eip712"));
-const eip712_v2_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/data/eip712_v2"));
+const eip712_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/lib/data/eip712"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/lib/modules/EIP712/index.js b/lib/modules/EIP712/index.js
index bbca23c9a596b2b300aca0f323bad277a4190def..c85cb18c3d6ff049c442d358b4d834c04a49951f 100644
index 24251b4584b04fd138b8892f027ccad60b14fc9e..4b99b94cf2327042b53687b4e2b076bd0cb8fba1 100644
--- a/lib/modules/EIP712/index.js
+++ b/lib/modules/EIP712/index.js
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
Expand All @@ -12,7 +12,7 @@ index bbca23c9a596b2b300aca0f323bad277a4190def..c85cb18c3d6ff049c442d358b4d834c0
const utils_1 = require("../../utils");
const loadConfig_1 = require("../../services/ledger/loadConfig");
diff --git a/lib/modules/EIP712/utils.js b/lib/modules/EIP712/utils.js
index 4f09ea8a24ae4f175f1a4d2d40999d36ffa2a915..1cc7de0d5ffd2b980741ad6d85a75792085c031b 100644
index 4f09ea8a24ae4f175f1a4d2d40999d36ffa2a915..38225b98bc124d8648d1ff110570293f165bd2a6 100644
--- a/lib/modules/EIP712/utils.js
+++ b/lib/modules/EIP712/utils.js
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Expand All @@ -25,7 +25,7 @@ index 4f09ea8a24ae4f175f1a4d2d40999d36ffa2a915..1cc7de0d5ffd2b980741ad6d85a75792
/**
* @ignore for the README
diff --git a/lib/services/ledger/erc20.js b/lib/services/ledger/erc20.js
index 8fdedf8037b2684ab6d48fd279a0c014b074b676..c10cea22504a4d3cd72bfac51463e5664639d20e 100644
index 8fdedf8037b2684ab6d48fd279a0c014b074b676..90ce6589407c1b8719550c21251f3f247fcef085 100644
--- a/lib/services/ledger/erc20.js
+++ b/lib/services/ledger/erc20.js
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
Expand All @@ -38,26 +38,26 @@ index 8fdedf8037b2684ab6d48fd279a0c014b074b676..c10cea22504a4d3cd72bfac51463e566
const asContractAddress = (addr) => {
const a = addr.toLowerCase();
diff --git a/lib/services/ledger/index.js b/lib/services/ledger/index.js
index 8385537236dfc98902376b29f712e9f7b605091a..6641b951b0c7e477fe5622c724ee22b9e5272213 100644
index 86db9973e63e1ac7c0e7f67e53ca8f05aa809805..29ebceeab40cdad75092d8af747d770411f8a605 100644
--- a/lib/services/ledger/index.js
+++ b/lib/services/ledger/index.js
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
// This implements the resolution of a Transaction using Ledger's own API
const logs_1 = require("@ledgerhq/logs");
const transactions_1 = require("@ethersproject/transactions");
const abi_1 = require("@ethersproject/abi");
const logs_1 = require("@ledgerhq/logs");
-const index_1 = require("@ledgerhq/domain-service/signers/index");
+const index_1 = require("@ledgerhq/domain-service/lib/signers/index");
const constants_1 = require("../../modules/Uniswap/constants");
const erc20_1 = require("./erc20");
const contracts_1 = require("./contracts");
const nfts_1 = require("./nfts");
const Uniswap_1 = require("../../modules/Uniswap");
diff --git a/lib/utils.js b/lib/utils.js
index 027089bf09c047b34af79e3dea253d5335d336f3..1c5da628db47a33099532973de9ea634a1ee65df 100644
index 6c5f58439116b2c6b5844f5e17d0eb876a436f41..e719e9840d33721ef79bb12232991621c828b501 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeResolutions = exports.nftSelectors = exports.tokenSelectors = exports.intAsHexBytes = exports.decodeTxInfo = exports.maybeHexBuffer = exports.hexBuffer = exports.splitPath = exports.padHexString = exports.ERC1155_CLEAR_SIGNED_SELECTORS = exports.ERC721_CLEAR_SIGNED_SELECTORS = exports.ERC20_CLEAR_SIGNED_SELECTORS = void 0;
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.safeChunkTransaction = exports.getV = exports.getChainIdAsUint32 = exports.getParity = exports.mergeResolutions = exports.nftSelectors = exports.tokenSelectors = exports.intAsHexBytes = exports.maybeHexBuffer = exports.hexBuffer = exports.splitPath = exports.padHexString = exports.ERC1155_CLEAR_SIGNED_SELECTORS = exports.ERC721_CLEAR_SIGNED_SELECTORS = exports.ERC20_CLEAR_SIGNED_SELECTORS = void 0;
const bignumber_js_1 = require("bignumber.js");
const rlp = __importStar(require("@ethersproject/rlp"));
-const index_1 = require("@ledgerhq/evm-tools/selectors/index");
+const index_1 = require("@ledgerhq/evm-tools/lib/selectors/index");
Object.defineProperty(exports, "ERC20_CLEAR_SIGNED_SELECTORS", { enumerable: true, get: function () { return index_1.ERC20_CLEAR_SIGNED_SELECTORS; } });
Expand Down
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.

15 changes: 15 additions & 0 deletions app/scripts/controllers/bridge-status/validators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ const BridgeTxStatusResponses = {
isExpectedToken: true,
bridge: 'across',
},
STATUS_FAILED_VALID: {
status: 'FAILED',
bridge: 'across',
srcChain: {
chainId: 42161,
txHash:
'0x4c57876fad21fb5149af5a58a4aba2ca9d6b212014505dd733b75667ca4f0f2b',
token: {},
},
},
};

describe('validators', () => {
Expand Down Expand Up @@ -250,6 +260,11 @@ describe('validators', () => {
expected: true,
description: 'complete bridge status with missing fields',
},
{
input: BridgeTxStatusResponses.STATUS_FAILED_VALID,
expected: true,
description: 'valid failed bridge status',
},
{
input: undefined,
expected: false,
Expand Down
4 changes: 3 additions & 1 deletion app/scripts/controllers/bridge-status/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ const srcChainStatusValidators = [
property: 'token',
type: 'object|undefined',
validator: (v: unknown): v is object | undefined =>
v === undefined || assetValidator(v),
v === undefined ||
(v && typeof v === 'object' && Object.keys(v).length === 0) ||
assetValidator(v),
},
];

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4820,7 +4820,7 @@ export default class MetamaskController extends EventEmitter {

async attemptLedgerTransportCreation() {
return await this.#withKeyringForDevice(
HardwareDeviceNames.ledger,
{ name: HardwareDeviceNames.ledger },
async (keyring) => keyring.attemptMakeApp(),
);
}
Expand Down
8 changes: 4 additions & 4 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.13.0/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
# Main build uses the default browser manifest
manifestOverrides: false
Expand All @@ -48,7 +48,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.13.0/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
# Modifies how the version is displayed.
# eg. instead of 10.25.0 -> 10.25.0-beta.2
Expand All @@ -72,7 +72,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.13.0/index.html
- SUPPORT_LINK: https://support.metamask.io/
- SUPPORT_REQUEST_LINK: https://support.metamask.io/
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand All @@ -96,7 +96,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.13.0/index.html
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v2/configuration/default
- SUPPORT_LINK: https://support.metamask-institutional.io
- SUPPORT_REQUEST_LINK: https://support.metamask-institutional.io
Expand Down
38 changes: 5 additions & 33 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,12 @@
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools": {
"packages": {
"ethers>@ethersproject/constants": true,
"@ethersproject/hash": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>@ledgerhq/live-env": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>axios": true,
"@metamask/ppom-validator>crypto-js": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": true
"@metamask/ppom-validator>crypto-js": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": {
Expand All @@ -707,6 +708,7 @@
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/transactions": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/domain-service": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/errors": true,
Expand Down Expand Up @@ -1841,6 +1843,7 @@
},
"@metamask/snaps-sdk": {
"globals": {
"URL": true,
"fetch": true
},
"packages": {
Expand Down Expand Up @@ -4043,37 +4046,6 @@
"ethers>@ethersproject/wordlists": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": {
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/abstract-signer": true,
"ethers>@ethersproject/address": true,
"ethers>@ethersproject/base64": true,
"ethers>@ethersproject/basex": true,
"@ethersproject/bignumber": true,
"@ethersproject/bytes": true,
"ethers>@ethersproject/constants": true,
"@ethersproject/contracts": true,
"@ethersproject/hash": true,
"@ethersproject/hdnode": true,
"ethers>@ethersproject/json-wallets": true,
"ethers>@ethersproject/keccak256": true,
"ethers>@ethersproject/logger": true,
"ethers>@ethersproject/properties": true,
"@ethersproject/providers": true,
"ethers>@ethersproject/random": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/sha2": true,
"ethers>@ethersproject/signing-key": true,
"ethers>@ethersproject/solidity": true,
"ethers>@ethersproject/strings": true,
"ethers>@ethersproject/transactions": true,
"ethers>@ethersproject/units": true,
"@ethersproject/wallet": true,
"@ethersproject/providers>@ethersproject/web": true,
"ethers>@ethersproject/wordlists": true
}
},
"eth-method-registry>@metamask/ethjs-contract>ethjs-abi": {
"packages": {
"bn.js": true,
Expand Down
38 changes: 5 additions & 33 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,12 @@
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools": {
"packages": {
"ethers>@ethersproject/constants": true,
"@ethersproject/hash": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>@ledgerhq/live-env": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>axios": true,
"@metamask/ppom-validator>crypto-js": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": true
"@metamask/ppom-validator>crypto-js": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": {
Expand All @@ -707,6 +708,7 @@
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/transactions": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/domain-service": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/errors": true,
Expand Down Expand Up @@ -1854,6 +1856,7 @@
},
"@metamask/snaps-sdk": {
"globals": {
"URL": true,
"fetch": true
},
"packages": {
Expand Down Expand Up @@ -4056,37 +4059,6 @@
"ethers>@ethersproject/wordlists": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": {
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/abstract-signer": true,
"ethers>@ethersproject/address": true,
"ethers>@ethersproject/base64": true,
"ethers>@ethersproject/basex": true,
"@ethersproject/bignumber": true,
"@ethersproject/bytes": true,
"ethers>@ethersproject/constants": true,
"@ethersproject/contracts": true,
"@ethersproject/hash": true,
"@ethersproject/hdnode": true,
"ethers>@ethersproject/json-wallets": true,
"ethers>@ethersproject/keccak256": true,
"ethers>@ethersproject/logger": true,
"ethers>@ethersproject/properties": true,
"@ethersproject/providers": true,
"ethers>@ethersproject/random": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/sha2": true,
"ethers>@ethersproject/signing-key": true,
"ethers>@ethersproject/solidity": true,
"ethers>@ethersproject/strings": true,
"ethers>@ethersproject/transactions": true,
"ethers>@ethersproject/units": true,
"@ethersproject/wallet": true,
"@ethersproject/providers>@ethersproject/web": true,
"ethers>@ethersproject/wordlists": true
}
},
"eth-method-registry>@metamask/ethjs-contract>ethjs-abi": {
"packages": {
"bn.js": true,
Expand Down
38 changes: 5 additions & 33 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,12 @@
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools": {
"packages": {
"ethers>@ethersproject/constants": true,
"@ethersproject/hash": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>@ledgerhq/live-env": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>axios": true,
"@metamask/ppom-validator>crypto-js": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": true
"@metamask/ppom-validator>crypto-js": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": {
Expand All @@ -707,6 +708,7 @@
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/transactions": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/domain-service": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/errors": true,
Expand Down Expand Up @@ -1841,6 +1843,7 @@
},
"@metamask/snaps-sdk": {
"globals": {
"URL": true,
"fetch": true
},
"packages": {
Expand Down Expand Up @@ -4043,37 +4046,6 @@
"ethers>@ethersproject/wordlists": true
}
},
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/evm-tools>ethers": {
"packages": {
"@ethersproject/abi": true,
"ethers>@ethersproject/abstract-signer": true,
"ethers>@ethersproject/address": true,
"ethers>@ethersproject/base64": true,
"ethers>@ethersproject/basex": true,
"@ethersproject/bignumber": true,
"@ethersproject/bytes": true,
"ethers>@ethersproject/constants": true,
"@ethersproject/contracts": true,
"@ethersproject/hash": true,
"@ethersproject/hdnode": true,
"ethers>@ethersproject/json-wallets": true,
"ethers>@ethersproject/keccak256": true,
"ethers>@ethersproject/logger": true,
"ethers>@ethersproject/properties": true,
"@ethersproject/providers": true,
"ethers>@ethersproject/random": true,
"ethers>@ethersproject/rlp": true,
"ethers>@ethersproject/sha2": true,
"ethers>@ethersproject/signing-key": true,
"ethers>@ethersproject/solidity": true,
"ethers>@ethersproject/strings": true,
"ethers>@ethersproject/transactions": true,
"ethers>@ethersproject/units": true,
"@ethersproject/wallet": true,
"@ethersproject/providers>@ethersproject/web": true,
"ethers>@ethersproject/wordlists": true
}
},
"eth-method-registry>@metamask/ethjs-contract>ethjs-abi": {
"packages": {
"bn.js": true,
Expand Down
Loading

0 comments on commit d5b9e39

Please sign in to comment.