@ledgerhq/coin-tester-evm 1.9.0-nightly.7 → 1.9.0-nightly.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +26 -0
- package/lib/src/{scenarii.test.d.ts → constants.d.ts} +1 -1
- package/lib/src/constants.d.ts.map +1 -0
- package/lib/src/constants.js +5 -0
- package/lib/src/constants.js.map +1 -0
- package/lib/src/fixtures.d.ts +4 -0
- package/lib/src/fixtures.d.ts.map +1 -0
- package/lib/src/fixtures.js +63 -0
- package/lib/src/fixtures.js.map +1 -0
- package/lib/src/scenarii/blast.js +4 -4
- package/lib/src/scenarii/blast.js.map +1 -1
- package/lib/src/scenarii/core.js +4 -4
- package/lib/src/scenarii/core.js.map +1 -1
- package/lib/src/scenarii/ethereum.js +4 -4
- package/lib/src/scenarii/ethereum.js.map +1 -1
- package/lib/src/scenarii/polygon.js +4 -4
- package/lib/src/scenarii/polygon.js.map +1 -1
- package/lib/src/scenarii/scroll.js +4 -4
- package/lib/src/scenarii/scroll.js.map +1 -1
- package/lib/src/scenarii/sonic.js +4 -4
- package/lib/src/scenarii/sonic.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-es/src/{scenarii.test.d.ts → constants.d.ts} +1 -1
- package/lib-es/src/constants.d.ts.map +1 -0
- package/lib-es/src/constants.js +2 -0
- package/lib-es/src/constants.js.map +1 -0
- package/lib-es/src/fixtures.d.ts +4 -0
- package/lib-es/src/fixtures.d.ts.map +1 -0
- package/lib-es/src/fixtures.js +56 -0
- package/lib-es/src/fixtures.js.map +1 -0
- package/lib-es/src/scenarii/blast.js +2 -2
- package/lib-es/src/scenarii/blast.js.map +1 -1
- package/lib-es/src/scenarii/core.js +2 -2
- package/lib-es/src/scenarii/core.js.map +1 -1
- package/lib-es/src/scenarii/ethereum.js +2 -2
- package/lib-es/src/scenarii/ethereum.js.map +1 -1
- package/lib-es/src/scenarii/polygon.js +2 -2
- package/lib-es/src/scenarii/polygon.js.map +1 -1
- package/lib-es/src/scenarii/scroll.js +2 -2
- package/lib-es/src/scenarii/scroll.js.map +1 -1
- package/lib-es/src/scenarii/sonic.js +2 -2
- package/lib-es/src/scenarii/sonic.js.map +1 -1
- package/lib-es/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/constants.ts +1 -0
- package/src/fixtures.ts +64 -0
- package/src/scenarii/blast.ts +2 -2
- package/src/scenarii/core.ts +2 -2
- package/src/scenarii/ethereum.ts +2 -2
- package/src/scenarii/polygon.ts +2 -2
- package/src/scenarii/scroll.ts +2 -2
- package/src/scenarii/sonic.ts +2 -2
- package/src/scenarii.test.ts +0 -1
- package/lib/src/scenarii.test.d.ts.map +0 -1
- package/lib/src/scenarii.test.js +0 -93
- package/lib/src/scenarii.test.js.map +0 -1
- package/lib-es/src/scenarii.test.d.ts.map +0 -1
- package/lib-es/src/scenarii.test.js +0 -90
- package/lib-es/src/scenarii.test.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-tester-evm",
|
|
3
|
-
"version": "1.9.0-nightly.
|
|
3
|
+
"version": "1.9.0-nightly.9",
|
|
4
4
|
"description": "Ledger EVM Coin Tester",
|
|
5
5
|
"main": "src/scenarii.test.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"dotenv": "^16.4.5",
|
|
52
52
|
"ethers": "6.15.0",
|
|
53
53
|
"msw": "^2.2.1",
|
|
54
|
-
"@ledgerhq/coin-evm": "^2.33.0-nightly.
|
|
55
|
-
"@ledgerhq/coin-framework": "^6.7.0-nightly.5",
|
|
54
|
+
"@ledgerhq/coin-evm": "^2.33.0-nightly.7",
|
|
56
55
|
"@ledgerhq/coin-tester": "^0.10.2-nightly.0",
|
|
57
|
-
"@ledgerhq/cryptoassets": "^13.31.0-nightly.
|
|
58
|
-
"@ledgerhq/live-common": "^34.51.0-nightly.
|
|
59
|
-
"@ledgerhq/
|
|
60
|
-
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.
|
|
56
|
+
"@ledgerhq/cryptoassets": "^13.31.0-nightly.7",
|
|
57
|
+
"@ledgerhq/live-common": "^34.51.0-nightly.9",
|
|
58
|
+
"@ledgerhq/coin-framework": "^6.7.0-nightly.7",
|
|
59
|
+
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.7",
|
|
61
60
|
"@ledgerhq/types-cryptoassets": "^7.29.0-nightly.0",
|
|
62
|
-
"@ledgerhq/
|
|
61
|
+
"@ledgerhq/live-config": "^3.2.0",
|
|
62
|
+
"@ledgerhq/types-live": "^6.87.0-nightly.5"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@swc/core": "1.4.11",
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const defaultNanoApp = { firmware: "2.4.2" as const, version: "1.17.0" as const };
|
package/src/fixtures.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { getDerivationScheme, runDerivationScheme } from "@ledgerhq/coin-framework/derivation";
|
|
3
|
+
import { decodeAccountId } from "@ledgerhq/coin-framework/account/index";
|
|
4
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
5
|
+
import { Account, TokenAccount } from "@ledgerhq/types-live";
|
|
6
|
+
|
|
7
|
+
export const makeAccount = (
|
|
8
|
+
address: string,
|
|
9
|
+
currency: CryptoCurrency,
|
|
10
|
+
subAccounts: TokenAccount[] = [],
|
|
11
|
+
): Account => {
|
|
12
|
+
const id = `js:2:${currency.id}:${address}:`;
|
|
13
|
+
const { derivationMode, xpubOrAddress } = decodeAccountId(id);
|
|
14
|
+
const scheme = getDerivationScheme({
|
|
15
|
+
derivationMode: derivationMode,
|
|
16
|
+
currency,
|
|
17
|
+
});
|
|
18
|
+
const index = 0;
|
|
19
|
+
const freshAddressPath = runDerivationScheme(scheme, currency, {
|
|
20
|
+
account: index,
|
|
21
|
+
node: 0,
|
|
22
|
+
address: 0,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const account: Account = {
|
|
26
|
+
type: "Account",
|
|
27
|
+
xpub: xpubOrAddress,
|
|
28
|
+
subAccounts,
|
|
29
|
+
seedIdentifier: xpubOrAddress,
|
|
30
|
+
used: true,
|
|
31
|
+
swapHistory: [],
|
|
32
|
+
id,
|
|
33
|
+
derivationMode,
|
|
34
|
+
currency,
|
|
35
|
+
index,
|
|
36
|
+
nfts: [],
|
|
37
|
+
freshAddress: xpubOrAddress,
|
|
38
|
+
freshAddressPath,
|
|
39
|
+
balance: new BigNumber(0),
|
|
40
|
+
spendableBalance: new BigNumber(0),
|
|
41
|
+
operationsCount: 0,
|
|
42
|
+
operations: [],
|
|
43
|
+
pendingOperations: [],
|
|
44
|
+
lastSyncDate: new Date(),
|
|
45
|
+
blockHeight: 0,
|
|
46
|
+
creationDate: new Date(),
|
|
47
|
+
balanceHistoryCache: {
|
|
48
|
+
HOUR: {
|
|
49
|
+
latestDate: null,
|
|
50
|
+
balances: [],
|
|
51
|
+
},
|
|
52
|
+
DAY: {
|
|
53
|
+
latestDate: null,
|
|
54
|
+
balances: [],
|
|
55
|
+
},
|
|
56
|
+
WEEK: {
|
|
57
|
+
latestDate: null,
|
|
58
|
+
balances: [],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return account;
|
|
64
|
+
};
|
package/src/scenarii/blast.ts
CHANGED
|
@@ -10,9 +10,9 @@ import { resetIndexer, setBlock, indexBlocks, initMswHandlers } from "../indexer
|
|
|
10
10
|
import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
|
|
11
11
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
12
12
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
13
|
-
import { makeAccount } from "
|
|
13
|
+
import { makeAccount } from "../fixtures";
|
|
14
14
|
import { blast, callMyDealer, VITALIK } from "../helpers";
|
|
15
|
-
import { defaultNanoApp } from "../
|
|
15
|
+
import { defaultNanoApp } from "../constants";
|
|
16
16
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
17
17
|
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
18
18
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
package/src/scenarii/core.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeAccount } from "
|
|
1
|
+
import { makeAccount } from "../fixtures";
|
|
2
2
|
import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
|
|
3
3
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
4
4
|
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
@@ -17,7 +17,7 @@ import { ethers } from "ethers";
|
|
|
17
17
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
18
18
|
import { VITALIK, core } from "../helpers";
|
|
19
19
|
import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
|
|
20
|
-
import { defaultNanoApp } from "../
|
|
20
|
+
import { defaultNanoApp } from "../constants";
|
|
21
21
|
|
|
22
22
|
type CoreScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
|
|
23
23
|
|
package/src/scenarii/ethereum.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
|
|
|
5
5
|
import { Account } from "@ledgerhq/types-live";
|
|
6
6
|
import { BigNumber } from "bignumber.js";
|
|
7
7
|
import { ethers } from "ethers";
|
|
8
|
-
import { makeAccount } from "
|
|
8
|
+
import { makeAccount } from "../fixtures";
|
|
9
9
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
10
10
|
import {
|
|
11
11
|
EvmNftTransaction,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
15
15
|
import { callMyDealer, ethereum, VITALIK, getBridges } from "../helpers";
|
|
16
16
|
import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
|
|
17
|
-
import { defaultNanoApp } from "../
|
|
17
|
+
import { defaultNanoApp } from "../constants";
|
|
18
18
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
19
19
|
import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
|
|
20
20
|
|
package/src/scenarii/polygon.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/specu
|
|
|
8
8
|
import { resetIndexer, initMswHandlers, setBlock, indexBlocks } from "../indexer";
|
|
9
9
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
10
10
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
11
|
-
import { makeAccount } from "
|
|
11
|
+
import { makeAccount } from "../fixtures";
|
|
12
12
|
import { callMyDealer, getBridges, polygon, VITALIK } from "../helpers";
|
|
13
|
-
import { defaultNanoApp } from "../
|
|
13
|
+
import { defaultNanoApp } from "../constants";
|
|
14
14
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
15
15
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
16
16
|
import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
|
package/src/scenarii/scroll.ts
CHANGED
|
@@ -10,9 +10,9 @@ import { resetIndexer, setBlock, indexBlocks, initMswHandlers } from "../indexer
|
|
|
10
10
|
import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
|
|
11
11
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
12
12
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
13
|
-
import { makeAccount } from "
|
|
13
|
+
import { makeAccount } from "../fixtures";
|
|
14
14
|
import { callMyDealer, scroll, VITALIK } from "../helpers";
|
|
15
|
-
import { defaultNanoApp } from "../
|
|
15
|
+
import { defaultNanoApp } from "../constants";
|
|
16
16
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
17
17
|
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
18
18
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
package/src/scenarii/sonic.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/specu
|
|
|
8
8
|
import { resetIndexer, indexBlocks, initMswHandlers, setBlock } from "../indexer";
|
|
9
9
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
10
10
|
import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
|
|
11
|
-
import { makeAccount } from "
|
|
11
|
+
import { makeAccount } from "../fixtures";
|
|
12
12
|
import { VITALIK, callMyDealer, getBridges, sonic } from "../helpers";
|
|
13
|
-
import { defaultNanoApp } from "../
|
|
13
|
+
import { defaultNanoApp } from "../constants";
|
|
14
14
|
import { killAnvil, spawnAnvil } from "../anvil";
|
|
15
15
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
16
16
|
|
package/src/scenarii.test.ts
CHANGED
|
@@ -18,7 +18,6 @@ setCryptoAssetsStoreForCoinFramework(legacyCryptoAssetsStore);
|
|
|
18
18
|
|
|
19
19
|
// Note this config runs with NanoX
|
|
20
20
|
// https://github.com/LedgerHQ/ledger-live/blob/develop/libs/coin-tester/docker-compose.yml
|
|
21
|
-
export const defaultNanoApp = { firmware: "2.4.2" as const, version: "1.17.0" as const };
|
|
22
21
|
|
|
23
22
|
describe.each([["legacy"], ["generic-adapter"]] as const)(
|
|
24
23
|
"EVM Deterministic Tester (%s strategy)",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenarii.test.d.ts","sourceRoot":"","sources":["../../src/scenarii.test.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,cAAc;;;CAA6D,CAAC"}
|
package/lib/src/scenarii.test.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultNanoApp = void 0;
|
|
4
|
-
const speculos_1 = require("@ledgerhq/coin-tester/signers/speculos");
|
|
5
|
-
const main_1 = require("@ledgerhq/coin-tester/main");
|
|
6
|
-
const anvil_1 = require("./anvil");
|
|
7
|
-
const ethereum_1 = require("./scenarii/ethereum");
|
|
8
|
-
const polygon_1 = require("./scenarii/polygon");
|
|
9
|
-
const scroll_1 = require("./scenarii/scroll");
|
|
10
|
-
const blast_1 = require("./scenarii/blast");
|
|
11
|
-
const sonic_1 = require("./scenarii/sonic");
|
|
12
|
-
const core_1 = require("./scenarii/core");
|
|
13
|
-
const index_1 = require("@ledgerhq/coin-framework/crypto-assets/index");
|
|
14
|
-
const tokens_1 = require("@ledgerhq/cryptoassets/tokens");
|
|
15
|
-
global.console = require("console");
|
|
16
|
-
jest.setTimeout(100_000);
|
|
17
|
-
//TODO mock call to CAL when available
|
|
18
|
-
(0, index_1.setCryptoAssetsStore)(tokens_1.legacyCryptoAssetsStore);
|
|
19
|
-
// Note this config runs with NanoX
|
|
20
|
-
// https://github.com/LedgerHQ/ledger-live/blob/develop/libs/coin-tester/docker-compose.yml
|
|
21
|
-
exports.defaultNanoApp = { firmware: "2.4.2", version: "1.17.0" };
|
|
22
|
-
describe.each([["legacy"], ["generic-adapter"]])("EVM Deterministic Tester (%s strategy)", strategy => {
|
|
23
|
-
it("scenario Ethereum", async () => {
|
|
24
|
-
try {
|
|
25
|
-
await (0, main_1.executeScenario)(ethereum_1.scenarioEthereum, strategy);
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
if (e != "done") {
|
|
29
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
30
|
-
throw e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
it("scenario Sonic", async () => {
|
|
35
|
-
try {
|
|
36
|
-
await (0, main_1.executeScenario)(sonic_1.scenarioSonic, strategy);
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
if (e != "done") {
|
|
40
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
41
|
-
throw e;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
it("scenario polygon", async () => {
|
|
46
|
-
try {
|
|
47
|
-
await (0, main_1.executeScenario)(polygon_1.scenarioPolygon, strategy);
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
if (e != "done") {
|
|
51
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
52
|
-
throw e;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
it("scenario Core", async () => {
|
|
57
|
-
try {
|
|
58
|
-
await (0, main_1.executeScenario)(core_1.scenarioCore, strategy);
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
if (e != "done") {
|
|
62
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
63
|
-
throw e;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
it.skip("scenario scroll", async () => {
|
|
68
|
-
try {
|
|
69
|
-
await (0, main_1.executeScenario)(scroll_1.scenarioScroll);
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
if (e != "done") {
|
|
73
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
74
|
-
throw e;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
it.skip("scenario blast", async () => {
|
|
79
|
-
try {
|
|
80
|
-
await (0, main_1.executeScenario)(blast_1.scenarioBlast);
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
if (e != "done") {
|
|
84
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
85
|
-
throw e;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
["exit", "SIGINT", "SIGQUIT", "SIGTERM", "SIGUSR1", "SIGUSR2", "uncaughtException"].map(e => process.on(e, async () => {
|
|
91
|
-
await Promise.all([(0, speculos_1.killSpeculos)(), (0, anvil_1.killAnvil)()]);
|
|
92
|
-
}));
|
|
93
|
-
//# sourceMappingURL=scenarii.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenarii.test.js","sourceRoot":"","sources":["../../src/scenarii.test.ts"],"names":[],"mappings":";;;AAAA,qEAAsE;AACtE,qDAA6D;AAC7D,mCAAoC;AACpC,kDAAuD;AACvD,gDAAqD;AACrD,8CAAmD;AACnD,4CAAiD;AACjD,4CAAiD;AACjD,0CAA+C;AAC/C,wEAA4H;AAC5H,0DAAwE;AAExE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAEzB,sCAAsC;AACtC,IAAA,4BAAoC,EAAC,gCAAuB,CAAC,CAAC;AAE9D,mCAAmC;AACnC,2FAA2F;AAC9E,QAAA,cAAc,GAAG,EAAE,QAAQ,EAAE,OAAgB,EAAE,OAAO,EAAE,QAAiB,EAAE,CAAC;AAEzF,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAU,CAAC,CACvD,wCAAwC,EACxC,QAAQ,CAAC,EAAE;IACT,EA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AAC,CAAC,CAAC,EAAE,CAC1F,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,uBAAY,GAAE,EAAE,IAAA,iBAAS,GAAE,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenarii.test.d.ts","sourceRoot":"","sources":["../../src/scenarii.test.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,cAAc;;;CAA6D,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { killSpeculos } from "@ledgerhq/coin-tester/signers/speculos";
|
|
2
|
-
import { executeScenario } from "@ledgerhq/coin-tester/main";
|
|
3
|
-
import { killAnvil } from "./anvil";
|
|
4
|
-
import { scenarioEthereum } from "./scenarii/ethereum";
|
|
5
|
-
import { scenarioPolygon } from "./scenarii/polygon";
|
|
6
|
-
import { scenarioScroll } from "./scenarii/scroll";
|
|
7
|
-
import { scenarioBlast } from "./scenarii/blast";
|
|
8
|
-
import { scenarioSonic } from "./scenarii/sonic";
|
|
9
|
-
import { scenarioCore } from "./scenarii/core";
|
|
10
|
-
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
|
11
|
-
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/tokens";
|
|
12
|
-
global.console = require("console");
|
|
13
|
-
jest.setTimeout(100_000);
|
|
14
|
-
//TODO mock call to CAL when available
|
|
15
|
-
setCryptoAssetsStoreForCoinFramework(legacyCryptoAssetsStore);
|
|
16
|
-
// Note this config runs with NanoX
|
|
17
|
-
// https://github.com/LedgerHQ/ledger-live/blob/develop/libs/coin-tester/docker-compose.yml
|
|
18
|
-
export const defaultNanoApp = { firmware: "2.4.2", version: "1.17.0" };
|
|
19
|
-
describe.each([["legacy"], ["generic-adapter"]])("EVM Deterministic Tester (%s strategy)", strategy => {
|
|
20
|
-
it("scenario Ethereum", async () => {
|
|
21
|
-
try {
|
|
22
|
-
await executeScenario(scenarioEthereum, strategy);
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
if (e != "done") {
|
|
26
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
it("scenario Sonic", async () => {
|
|
32
|
-
try {
|
|
33
|
-
await executeScenario(scenarioSonic, strategy);
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
if (e != "done") {
|
|
37
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
38
|
-
throw e;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
it("scenario polygon", async () => {
|
|
43
|
-
try {
|
|
44
|
-
await executeScenario(scenarioPolygon, strategy);
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
if (e != "done") {
|
|
48
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
49
|
-
throw e;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
it("scenario Core", async () => {
|
|
54
|
-
try {
|
|
55
|
-
await executeScenario(scenarioCore, strategy);
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
if (e != "done") {
|
|
59
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
60
|
-
throw e;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
it.skip("scenario scroll", async () => {
|
|
65
|
-
try {
|
|
66
|
-
await executeScenario(scenarioScroll);
|
|
67
|
-
}
|
|
68
|
-
catch (e) {
|
|
69
|
-
if (e != "done") {
|
|
70
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
71
|
-
throw e;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
it.skip("scenario blast", async () => {
|
|
76
|
-
try {
|
|
77
|
-
await executeScenario(scenarioBlast);
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
if (e != "done") {
|
|
81
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
82
|
-
throw e;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
["exit", "SIGINT", "SIGQUIT", "SIGTERM", "SIGUSR1", "SIGUSR2", "uncaughtException"].map(e => process.on(e, async () => {
|
|
88
|
-
await Promise.all([killSpeculos(), killAnvil()]);
|
|
89
|
-
}));
|
|
90
|
-
//# sourceMappingURL=scenarii.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenarii.test.js","sourceRoot":"","sources":["../../src/scenarii.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,IAAI,oCAAoC,EAAE,MAAM,8CAA8C,CAAC;AAC5H,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CA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