@ledgerhq/coin-tron 0.0.1
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/.eslintrc.js +20 -0
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +25 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +8 -0
- package/jest.integ.config.js +7 -0
- package/lib/bridge/broadcast.d.ts +7 -0
- package/lib/bridge/broadcast.d.ts.map +1 -0
- package/lib/bridge/broadcast.js +26 -0
- package/lib/bridge/broadcast.js.map +1 -0
- package/lib/bridge/buildOptimisticOperation.d.ts +5 -0
- package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib/bridge/buildOptimisticOperation.js +101 -0
- package/lib/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib/bridge/createTransaction.d.ts +4 -0
- package/lib/bridge/createTransaction.d.ts.map +1 -0
- package/lib/bridge/createTransaction.js +19 -0
- package/lib/bridge/createTransaction.js.map +1 -0
- package/lib/bridge/deviceTransactionConfig.d.ts +20 -0
- package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/bridge/deviceTransactionConfig.js +65 -0
- package/lib/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib/bridge/estimateMaxSpendable.d.ts +5 -0
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/estimateMaxSpendable.js +30 -0
- package/lib/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/getEstimateFees.d.ts +6 -0
- package/lib/bridge/getEstimateFees.d.ts.map +1 -0
- package/lib/bridge/getEstimateFees.js +52 -0
- package/lib/bridge/getEstimateFees.js.map +1 -0
- package/lib/bridge/getTransactionStatus.d.ts +4 -0
- package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib/bridge/getTransactionStatus.js +218 -0
- package/lib/bridge/getTransactionStatus.js.map +1 -0
- package/lib/bridge/index.d.ts +10 -0
- package/lib/bridge/index.d.ts.map +1 -0
- package/lib/bridge/index.js +60 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge/preload.d.ts +8 -0
- package/lib/bridge/preload.d.ts.map +1 -0
- package/lib/bridge/preload.js +32 -0
- package/lib/bridge/preload.js.map +1 -0
- package/lib/bridge/prepareTransaction.d.ts +4 -0
- package/lib/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib/bridge/prepareTransaction.js +19 -0
- package/lib/bridge/prepareTransaction.js.map +1 -0
- package/lib/bridge/serialization.d.ts +9 -0
- package/lib/bridge/serialization.d.ts.map +1 -0
- package/lib/bridge/serialization.js +238 -0
- package/lib/bridge/serialization.js.map +1 -0
- package/lib/bridge/signOperation.d.ts +5 -0
- package/lib/bridge/signOperation.d.ts.map +1 -0
- package/lib/bridge/signOperation.js +92 -0
- package/lib/bridge/signOperation.js.map +1 -0
- package/lib/bridge/synchronization.d.ts +5 -0
- package/lib/bridge/synchronization.d.ts.map +1 -0
- package/lib/bridge/synchronization.integ.test.d.ts +3 -0
- package/lib/bridge/synchronization.integ.test.d.ts.map +1 -0
- package/lib/bridge/synchronization.integ.test.js +96 -0
- package/lib/bridge/synchronization.integ.test.js.map +1 -0
- package/lib/bridge/synchronization.js +216 -0
- package/lib/bridge/synchronization.js.map +1 -0
- package/lib/bridge/transaction.d.ts +15 -0
- package/lib/bridge/transaction.d.ts.map +1 -0
- package/lib/bridge/transaction.js +61 -0
- package/lib/bridge/transaction.js.map +1 -0
- package/lib/config.d.ts +10 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +17 -0
- package/lib/config.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/logic/constants.d.ts +4 -0
- package/lib/logic/constants.d.ts.map +1 -0
- package/lib/logic/constants.js +7 -0
- package/lib/logic/constants.js.map +1 -0
- package/lib/logic/pagination.d.ts +3 -0
- package/lib/logic/pagination.d.ts.map +1 -0
- package/lib/logic/pagination.js +19 -0
- package/lib/logic/pagination.js.map +1 -0
- package/lib/logic/utils.d.ts +12 -0
- package/lib/logic/utils.d.ts.map +1 -0
- package/lib/logic/utils.js +177 -0
- package/lib/logic/utils.js.map +1 -0
- package/lib/network/format.d.ts +9 -0
- package/lib/network/format.d.ts.map +1 -0
- package/lib/network/format.js +127 -0
- package/lib/network/format.js.map +1 -0
- package/lib/network/index.d.ts +30 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.integ.test.d.ts +2 -0
- package/lib/network/index.integ.test.d.ts.map +1 -0
- package/lib/network/index.integ.test.js +38 -0
- package/lib/network/index.integ.test.js.map +1 -0
- package/lib/network/index.js +555 -0
- package/lib/network/index.js.map +1 -0
- package/lib/network/index.test.d.ts +2 -0
- package/lib/network/index.test.d.ts.map +1 -0
- package/lib/network/index.test.js +66 -0
- package/lib/network/index.test.js.map +1 -0
- package/lib/network/superRepresentativesData.mock.d.ts +69 -0
- package/lib/network/superRepresentativesData.mock.d.ts.map +1 -0
- package/lib/network/superRepresentativesData.mock.js +2208 -0
- package/lib/network/superRepresentativesData.mock.js.map +1 -0
- package/lib/network/types.d.ts +122 -0
- package/lib/network/types.d.ts.map +1 -0
- package/lib/network/types.fixture.d.ts +498 -0
- package/lib/network/types.fixture.d.ts.map +1 -0
- package/lib/network/types.fixture.js +4375 -0
- package/lib/network/types.fixture.js.map +1 -0
- package/lib/network/types.js +13 -0
- package/lib/network/types.js.map +1 -0
- package/lib/signer/getAddress.d.ts +6 -0
- package/lib/signer/getAddress.d.ts.map +1 -0
- package/lib/signer/getAddress.js +19 -0
- package/lib/signer/getAddress.js.map +1 -0
- package/lib/signer/index.d.ts +6 -0
- package/lib/signer/index.d.ts.map +1 -0
- package/lib/signer/index.js +11 -0
- package/lib/signer/index.js.map +1 -0
- package/lib/test/bot-deviceActions.d.ts +4 -0
- package/lib/test/bot-deviceActions.d.ts.map +1 -0
- package/lib/test/bot-deviceActions.js +103 -0
- package/lib/test/bot-deviceActions.js.map +1 -0
- package/lib/test/bot-specs.d.ts +7 -0
- package/lib/test/bot-specs.d.ts.map +1 -0
- package/lib/test/bot-specs.js +433 -0
- package/lib/test/bot-specs.js.map +1 -0
- package/lib/test/bridgeDatasetTest.d.ts +4 -0
- package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib/test/bridgeDatasetTest.js +1284 -0
- package/lib/test/bridgeDatasetTest.js.map +1 -0
- package/lib/test/cli.d.ts +52 -0
- package/lib/test/cli.d.ts.map +1 -0
- package/lib/test/cli.js +155 -0
- package/lib/test/cli.js.map +1 -0
- package/lib/test/index.d.ts +6 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +26 -0
- package/lib/test/index.js.map +1 -0
- package/lib/types/bridge.d.ts +245 -0
- package/lib/types/bridge.d.ts.map +1 -0
- package/lib/types/bridge.js +16 -0
- package/lib/types/bridge.js.map +1 -0
- package/lib/types/errors.d.ts +49 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/errors.js +21 -0
- package/lib/types/errors.js.map +1 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/signer.d.ts +10 -0
- package/lib/types/signer.d.ts.map +1 -0
- package/lib/types/signer.js +3 -0
- package/lib/types/signer.js.map +1 -0
- package/lib-es/bridge/broadcast.d.ts +7 -0
- package/lib-es/bridge/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.js +24 -0
- package/lib-es/bridge/broadcast.js.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts +5 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.js +94 -0
- package/lib-es/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib-es/bridge/createTransaction.d.ts +4 -0
- package/lib-es/bridge/createTransaction.d.ts.map +1 -0
- package/lib-es/bridge/createTransaction.js +14 -0
- package/lib-es/bridge/createTransaction.js.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts +20 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.js +63 -0
- package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts +5 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.js +25 -0
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/getEstimateFees.d.ts +6 -0
- package/lib-es/bridge/getEstimateFees.d.ts.map +1 -0
- package/lib-es/bridge/getEstimateFees.js +47 -0
- package/lib-es/bridge/getEstimateFees.js.map +1 -0
- package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
- package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/bridge/getTransactionStatus.js +213 -0
- package/lib-es/bridge/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/index.d.ts +10 -0
- package/lib-es/bridge/index.d.ts.map +1 -0
- package/lib-es/bridge/index.js +53 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge/preload.d.ts +8 -0
- package/lib-es/bridge/preload.d.ts.map +1 -0
- package/lib-es/bridge/preload.js +27 -0
- package/lib-es/bridge/preload.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.d.ts +4 -0
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib-es/bridge/prepareTransaction.js +15 -0
- package/lib-es/bridge/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/serialization.d.ts +9 -0
- package/lib-es/bridge/serialization.d.ts.map +1 -0
- package/lib-es/bridge/serialization.js +229 -0
- package/lib-es/bridge/serialization.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts +5 -0
- package/lib-es/bridge/signOperation.d.ts.map +1 -0
- package/lib-es/bridge/signOperation.js +85 -0
- package/lib-es/bridge/signOperation.js.map +1 -0
- package/lib-es/bridge/synchronization.d.ts +5 -0
- package/lib-es/bridge/synchronization.d.ts.map +1 -0
- package/lib-es/bridge/synchronization.integ.test.d.ts +3 -0
- package/lib-es/bridge/synchronization.integ.test.d.ts.map +1 -0
- package/lib-es/bridge/synchronization.integ.test.js +89 -0
- package/lib-es/bridge/synchronization.integ.test.js.map +1 -0
- package/lib-es/bridge/synchronization.js +209 -0
- package/lib-es/bridge/synchronization.js.map +1 -0
- package/lib-es/bridge/transaction.d.ts +15 -0
- package/lib-es/bridge/transaction.d.ts.map +1 -0
- package/lib-es/bridge/transaction.js +55 -0
- package/lib-es/bridge/transaction.js.map +1 -0
- package/lib-es/config.d.ts +10 -0
- package/lib-es/config.d.ts.map +1 -0
- package/lib-es/config.js +12 -0
- package/lib-es/config.js.map +1 -0
- package/lib-es/index.d.ts +3 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +3 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/logic/constants.d.ts +4 -0
- package/lib-es/logic/constants.d.ts.map +1 -0
- package/lib-es/logic/constants.js +4 -0
- package/lib-es/logic/constants.js.map +1 -0
- package/lib-es/logic/pagination.d.ts +3 -0
- package/lib-es/logic/pagination.d.ts.map +1 -0
- package/lib-es/logic/pagination.js +15 -0
- package/lib-es/logic/pagination.js.map +1 -0
- package/lib-es/logic/utils.d.ts +12 -0
- package/lib-es/logic/utils.d.ts.map +1 -0
- package/lib-es/logic/utils.js +167 -0
- package/lib-es/logic/utils.js.map +1 -0
- package/lib-es/network/format.d.ts +9 -0
- package/lib-es/network/format.d.ts.map +1 -0
- package/lib-es/network/format.js +117 -0
- package/lib-es/network/format.js.map +1 -0
- package/lib-es/network/index.d.ts +30 -0
- package/lib-es/network/index.d.ts.map +1 -0
- package/lib-es/network/index.integ.test.d.ts +2 -0
- package/lib-es/network/index.integ.test.d.ts.map +1 -0
- package/lib-es/network/index.integ.test.js +36 -0
- package/lib-es/network/index.integ.test.js.map +1 -0
- package/lib-es/network/index.js +524 -0
- package/lib-es/network/index.js.map +1 -0
- package/lib-es/network/index.test.d.ts +2 -0
- package/lib-es/network/index.test.d.ts.map +1 -0
- package/lib-es/network/index.test.js +63 -0
- package/lib-es/network/index.test.js.map +1 -0
- package/lib-es/network/superRepresentativesData.mock.d.ts +69 -0
- package/lib-es/network/superRepresentativesData.mock.d.ts.map +1 -0
- package/lib-es/network/superRepresentativesData.mock.js +2206 -0
- package/lib-es/network/superRepresentativesData.mock.js.map +1 -0
- package/lib-es/network/types.d.ts +122 -0
- package/lib-es/network/types.d.ts.map +1 -0
- package/lib-es/network/types.fixture.d.ts +498 -0
- package/lib-es/network/types.fixture.d.ts.map +1 -0
- package/lib-es/network/types.fixture.js +4371 -0
- package/lib-es/network/types.fixture.js.map +1 -0
- package/lib-es/network/types.js +8 -0
- package/lib-es/network/types.js.map +1 -0
- package/lib-es/signer/getAddress.d.ts +6 -0
- package/lib-es/signer/getAddress.d.ts.map +1 -0
- package/lib-es/signer/getAddress.js +17 -0
- package/lib-es/signer/getAddress.js.map +1 -0
- package/lib-es/signer/index.d.ts +6 -0
- package/lib-es/signer/index.d.ts.map +1 -0
- package/lib-es/signer/index.js +6 -0
- package/lib-es/signer/index.js.map +1 -0
- package/lib-es/test/bot-deviceActions.d.ts +4 -0
- package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
- package/lib-es/test/bot-deviceActions.js +100 -0
- package/lib-es/test/bot-deviceActions.js.map +1 -0
- package/lib-es/test/bot-specs.d.ts +7 -0
- package/lib-es/test/bot-specs.d.ts.map +1 -0
- package/lib-es/test/bot-specs.js +428 -0
- package/lib-es/test/bot-specs.js.map +1 -0
- package/lib-es/test/bridgeDatasetTest.d.ts +4 -0
- package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib-es/test/bridgeDatasetTest.js +1278 -0
- package/lib-es/test/bridgeDatasetTest.js.map +1 -0
- package/lib-es/test/cli.d.ts +52 -0
- package/lib-es/test/cli.d.ts.map +1 -0
- package/lib-es/test/cli.js +149 -0
- package/lib-es/test/cli.js.map +1 -0
- package/lib-es/test/index.d.ts +6 -0
- package/lib-es/test/index.d.ts.map +1 -0
- package/lib-es/test/index.js +6 -0
- package/lib-es/test/index.js.map +1 -0
- package/lib-es/types/bridge.d.ts +245 -0
- package/lib-es/types/bridge.d.ts.map +1 -0
- package/lib-es/types/bridge.js +11 -0
- package/lib-es/types/bridge.js.map +1 -0
- package/lib-es/types/errors.d.ts +49 -0
- package/lib-es/types/errors.d.ts.map +1 -0
- package/lib-es/types/errors.js +18 -0
- package/lib-es/types/errors.js.map +1 -0
- package/lib-es/types/index.d.ts +4 -0
- package/lib-es/types/index.d.ts.map +1 -0
- package/lib-es/types/index.js +5 -0
- package/lib-es/types/index.js.map +1 -0
- package/lib-es/types/signer.d.ts +10 -0
- package/lib-es/types/signer.d.ts.map +1 -0
- package/lib-es/types/signer.js +2 -0
- package/lib-es/types/signer.js.map +1 -0
- package/package.json +133 -0
- package/src/bridge/broadcast.ts +24 -0
- package/src/bridge/buildOptimisticOperation.ts +133 -0
- package/src/bridge/createTransaction.ts +16 -0
- package/src/bridge/deviceTransactionConfig.ts +99 -0
- package/src/bridge/estimateMaxSpendable.ts +32 -0
- package/src/bridge/getEstimateFees.ts +52 -0
- package/src/bridge/getTransactionStatus.ts +263 -0
- package/src/bridge/index.ts +78 -0
- package/src/bridge/preload.ts +24 -0
- package/src/bridge/prepareTransaction.ts +12 -0
- package/src/bridge/serialization.ts +288 -0
- package/src/bridge/signOperation.ts +123 -0
- package/src/bridge/synchronization.integ.test.ts +105 -0
- package/src/bridge/synchronization.ts +284 -0
- package/src/bridge/transaction.ts +84 -0
- package/src/config.ts +24 -0
- package/src/index.ts +3 -0
- package/src/logic/constants.ts +4 -0
- package/src/logic/pagination.ts +21 -0
- package/src/logic/utils.ts +231 -0
- package/src/network/format.ts +148 -0
- package/src/network/index.integ.test.ts +33 -0
- package/src/network/index.test.ts +61 -0
- package/src/network/index.ts +747 -0
- package/src/network/superRepresentativesData.mock.ts +2205 -0
- package/src/network/types.fixture.ts +4476 -0
- package/src/network/types.ts +147 -0
- package/src/signer/getAddress.ts +13 -0
- package/src/signer/index.ts +7 -0
- package/src/test/bot-deviceActions.ts +121 -0
- package/src/test/bot-specs.ts +457 -0
- package/src/test/bridgeDatasetTest.ts +1343 -0
- package/src/test/cli.ts +219 -0
- package/src/test/index.ts +6 -0
- package/src/types/bridge.ts +304 -0
- package/src/types/errors.ts +22 -0
- package/src/types/index.ts +4 -0
- package/src/types/signer.ts +9 -0
- package/tsconfig.json +14 -0
- package/types/tronweb/index.d.ts +5 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { BigNumber } from "bignumber.js";
|
|
2
|
+
import invariant from "invariant";
|
|
3
|
+
import expect from "expect";
|
|
4
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/index";
|
|
5
|
+
import { parseCurrencyUnit } from "@ledgerhq/coin-framework/currencies";
|
|
6
|
+
import { botTest, pickSiblings } from "@ledgerhq/coin-framework/bot/specs";
|
|
7
|
+
// import { getUnfreezeData, getNextRewardDate } from "./react";
|
|
8
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
9
|
+
import { acceptTransaction } from "./bot-deviceActions";
|
|
10
|
+
const currency = getCryptoCurrencyById("tron");
|
|
11
|
+
const minimalAmount = parseCurrencyUnit(currency.units[0], "1");
|
|
12
|
+
const maxAccount = 10;
|
|
13
|
+
/*const getDecimalPart = (value: BigNumber, magnitude: number) =>
|
|
14
|
+
value.minus(value.modulo(10 ** magnitude));*/
|
|
15
|
+
// FIXME TRON have a bug where the amounts from the API have imprecisions
|
|
16
|
+
const expectedApproximate = (value, expected, delta = 50) => {
|
|
17
|
+
if (value.minus(expected).abs().gt(delta)) {
|
|
18
|
+
expect(value.toString()).toEqual(value.toString());
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const testDestination = ({ destination, operation, destinationBeforeTransaction, sendingOperation, }) => {
|
|
22
|
+
const amount = sendingOperation.value.minus(sendingOperation.fee);
|
|
23
|
+
botTest("account balance increased with transaction amount", () => expectedApproximate(destination.balance, destinationBeforeTransaction.balance.plus(amount)));
|
|
24
|
+
botTest("operation amount is consistent with sendingOperation", () => expectedApproximate(operation.value, amount));
|
|
25
|
+
};
|
|
26
|
+
const tron = {
|
|
27
|
+
name: "Tron",
|
|
28
|
+
currency,
|
|
29
|
+
appQuery: {
|
|
30
|
+
model: DeviceModelId.nanoSP,
|
|
31
|
+
appName: "Tron",
|
|
32
|
+
firmware: "1.1.1",
|
|
33
|
+
appVersion: "0.5.0",
|
|
34
|
+
},
|
|
35
|
+
genericDeviceAction: acceptTransaction,
|
|
36
|
+
testTimeout: 2 * 60 * 1000,
|
|
37
|
+
minViableAmount: minimalAmount,
|
|
38
|
+
mutations: [
|
|
39
|
+
{
|
|
40
|
+
name: "move 50% to another account",
|
|
41
|
+
maxRun: 2,
|
|
42
|
+
testDestination,
|
|
43
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
44
|
+
invariant(maxSpendable.gt(minimalAmount), "balance is too low");
|
|
45
|
+
const sibling = pickSiblings(siblings, maxAccount);
|
|
46
|
+
const recipient = sibling.freshAddress;
|
|
47
|
+
const amount = maxSpendable.div(2).integerValue();
|
|
48
|
+
return {
|
|
49
|
+
transaction: bridge.createTransaction(account),
|
|
50
|
+
updates: [
|
|
51
|
+
{
|
|
52
|
+
recipient,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
amount,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
test: ({ accountBeforeTransaction, operation, account }) => {
|
|
61
|
+
botTest("account spendable balance decreased with operation", () => expectedApproximate(account.spendableBalance, accountBeforeTransaction.spendableBalance.minus(operation.value)));
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "send max to another account",
|
|
66
|
+
maxRun: 1,
|
|
67
|
+
testDestination,
|
|
68
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
69
|
+
invariant(maxSpendable.gt(minimalAmount), "balance is too low");
|
|
70
|
+
const sibling = pickSiblings(siblings, maxAccount);
|
|
71
|
+
const recipient = sibling.freshAddress;
|
|
72
|
+
return {
|
|
73
|
+
transaction: bridge.createTransaction(account),
|
|
74
|
+
updates: [
|
|
75
|
+
{
|
|
76
|
+
recipient,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
useAllAmount: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
test: ({ account }) => {
|
|
85
|
+
botTest("account spendable balance is zero", () => expectedApproximate(account.spendableBalance, new BigNumber(0)));
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
/*
|
|
89
|
+
We do not manage staking anymore
|
|
90
|
+
{
|
|
91
|
+
name: "freeze 25% to bandwidth | energy",
|
|
92
|
+
maxRun: 1,
|
|
93
|
+
transaction: ({ siblings, account, bridge, maxSpendable }) => {
|
|
94
|
+
expectSiblingsHaveSpendablePartGreaterThan(siblings, 0.5);
|
|
95
|
+
|
|
96
|
+
invariant(maxSpendable.gt(minimalAmount), "balance is too low");
|
|
97
|
+
let amount = getDecimalPart(
|
|
98
|
+
maxSpendable.div(4),
|
|
99
|
+
currency.units[0].magnitude,
|
|
100
|
+
).integerValue();
|
|
101
|
+
|
|
102
|
+
if (amount.lt(minimalAmount)) {
|
|
103
|
+
amount = minimalAmount;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const energy = get(account, `tronResources.energy`, new BigNumber(0));
|
|
107
|
+
return {
|
|
108
|
+
transaction: bridge.createTransaction(account),
|
|
109
|
+
updates: [
|
|
110
|
+
{
|
|
111
|
+
mode: "freeze",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
resource: energy.eq(0) ? "ENERGY" : "BANDWIDTH",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
amount,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
test: ({ account, accountBeforeTransaction, transaction }) => {
|
|
123
|
+
const resourceType = (transaction.resource || "").toLocaleLowerCase();
|
|
124
|
+
const resourceBeforeTransaction = get(
|
|
125
|
+
accountBeforeTransaction,
|
|
126
|
+
`tronResources.frozen.${resourceType}.amount`,
|
|
127
|
+
new BigNumber(0),
|
|
128
|
+
);
|
|
129
|
+
const expectedAmount = new BigNumber(transaction.amount).plus(resourceBeforeTransaction);
|
|
130
|
+
const currentRessourceAmount = get(
|
|
131
|
+
account,
|
|
132
|
+
`tronResources.frozen.${resourceType}.amount`,
|
|
133
|
+
new BigNumber(0),
|
|
134
|
+
);
|
|
135
|
+
botTest("frozen amount is accumulated in resources", () =>
|
|
136
|
+
expect(expectedAmount.toString()).toBe(currentRessourceAmount.toString()),
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "unfreeze bandwith / energy",
|
|
142
|
+
maxRun: 1,
|
|
143
|
+
transaction: ({ account, bridge }) => {
|
|
144
|
+
const TP = new BigNumber(get(account, "tronResources.tronPower", "0"));
|
|
145
|
+
invariant(TP.gt(0), "no frozen assets");
|
|
146
|
+
const { canUnfreezeBandwidth, canUnfreezeEnergy } = getUnfreezeData(account as TronAccount);
|
|
147
|
+
invariant(canUnfreezeBandwidth || canUnfreezeEnergy, "freeze period not expired yet");
|
|
148
|
+
const resourceToUnfreeze = canUnfreezeBandwidth ? "BANDWIDTH" : "ENERGY";
|
|
149
|
+
return {
|
|
150
|
+
transaction: bridge.createTransaction(account),
|
|
151
|
+
updates: [
|
|
152
|
+
{
|
|
153
|
+
mode: "unfreeze",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
resource: resourceToUnfreeze,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
test: ({ account, accountBeforeTransaction, transaction }) => {
|
|
162
|
+
const TxResource = (transaction.resource || "").toLocaleLowerCase();
|
|
163
|
+
const currentFrozen = get(account, `tronResources.frozen.${TxResource}`, undefined);
|
|
164
|
+
botTest("no current frozen", () => expect(currentFrozen).toBeUndefined());
|
|
165
|
+
const TPBeforeTx = new BigNumber(
|
|
166
|
+
get(accountBeforeTransaction, "tronResources.tronPower", 0),
|
|
167
|
+
);
|
|
168
|
+
const currentTP = new BigNumber(get(account, "tronResources.tronPower", 0));
|
|
169
|
+
const expectedTronPower = TPBeforeTx.minus(transaction.amount);
|
|
170
|
+
botTest("tron power", () => expectedApproximate(currentTP, expectedTronPower));
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "submit vote",
|
|
175
|
+
maxRun: 1,
|
|
176
|
+
transaction: ({ account, bridge, preloadedData }) => {
|
|
177
|
+
const TP = new BigNumber(get(account, "tronResources.tronPower", "0"));
|
|
178
|
+
invariant(TP.gt(0), "no tron power to vote");
|
|
179
|
+
const currentTPVoted = get(account, "tronResources.votes", []).reduce(
|
|
180
|
+
(acc, curr) => acc.plus(new BigNumber(get(curr, "voteCount", 0))),
|
|
181
|
+
new BigNumber(0),
|
|
182
|
+
);
|
|
183
|
+
invariant(TP.gt(currentTPVoted), "you have no tron power left");
|
|
184
|
+
const { superRepresentatives } = preloadedData;
|
|
185
|
+
invariant(
|
|
186
|
+
superRepresentatives && superRepresentatives.length,
|
|
187
|
+
"there are no super representatives to vote for, or the list has not been loaded yet",
|
|
188
|
+
);
|
|
189
|
+
const count = 1 + Math.floor(5 * Math.random());
|
|
190
|
+
const candidates = sampleSize(superRepresentatives.slice(0, 40), count);
|
|
191
|
+
let remaining = TP;
|
|
192
|
+
const votes = candidates
|
|
193
|
+
.map(c => {
|
|
194
|
+
if (!remaining.gt(0)) return null;
|
|
195
|
+
const voteCount = remaining.eq(1)
|
|
196
|
+
? remaining.integerValue().toNumber()
|
|
197
|
+
: remaining.times(Math.random()).integerValue().toNumber();
|
|
198
|
+
if (voteCount === 0) return null;
|
|
199
|
+
remaining = remaining.minus(voteCount);
|
|
200
|
+
return {
|
|
201
|
+
address: c.address,
|
|
202
|
+
voteCount,
|
|
203
|
+
};
|
|
204
|
+
})
|
|
205
|
+
.filter(Boolean);
|
|
206
|
+
return {
|
|
207
|
+
transaction: bridge.createTransaction(account) as Transaction,
|
|
208
|
+
updates: [
|
|
209
|
+
{
|
|
210
|
+
mode: "vote",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
votes,
|
|
214
|
+
},
|
|
215
|
+
] as Array<Partial<Transaction>>,
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
test: ({ account, transaction }) => {
|
|
219
|
+
const votes = sortBy(transaction.votes, ["address"]);
|
|
220
|
+
const currentVotes = sortBy(get(account, "tronResources.votes", []), ["address"]);
|
|
221
|
+
botTest("current votes", () => expect(currentVotes).toEqual(votes));
|
|
222
|
+
},
|
|
223
|
+
},*/
|
|
224
|
+
/**
|
|
225
|
+
* FIXME
|
|
226
|
+
*
|
|
227
|
+
* Our bad implementation of TRC10/TRC20 operations and sync make those tests impossible to
|
|
228
|
+
* work properly.
|
|
229
|
+
*
|
|
230
|
+
* To make them work we need to rework the link between Operation and SubOperations which is wrong as of now and
|
|
231
|
+
* rework our fee estimation (TRC20 do have fees which are ignored today until the next sync creates an OUT tx to represent it).
|
|
232
|
+
*/
|
|
233
|
+
// {
|
|
234
|
+
// name: "move some TRC10",
|
|
235
|
+
// maxRun: 1,
|
|
236
|
+
// transaction: ({ account, siblings, bridge }) => {
|
|
237
|
+
// const trc10Account = sample(
|
|
238
|
+
// (account.subAccounts || []).filter(
|
|
239
|
+
// (a) => a.type === "TokenAccount" && a.token.tokenType === "trc10"
|
|
240
|
+
// )
|
|
241
|
+
// );
|
|
242
|
+
// invariant(trc10Account, "no trc10 account");
|
|
243
|
+
// if (!trc10Account) throw new Error("no trc10 account");
|
|
244
|
+
// invariant(trc10Account?.balance.gt(0), "trc10 account has no balance");
|
|
245
|
+
// const sibling = pickSiblings(siblings, maxAccount);
|
|
246
|
+
// const recipient = sibling.freshAddress;
|
|
247
|
+
// return {
|
|
248
|
+
// transaction: bridge.createTransaction(account),
|
|
249
|
+
// updates: [
|
|
250
|
+
// {
|
|
251
|
+
// recipient,
|
|
252
|
+
// subAccountId: trc10Account.id,
|
|
253
|
+
// },
|
|
254
|
+
// Math.random() < 0.5
|
|
255
|
+
// ? {
|
|
256
|
+
// useAllAmount: true,
|
|
257
|
+
// }
|
|
258
|
+
// : {
|
|
259
|
+
// amount: trc10Account.balance
|
|
260
|
+
// .times(Math.random())
|
|
261
|
+
// .integerValue(),
|
|
262
|
+
// },
|
|
263
|
+
// ],
|
|
264
|
+
// };
|
|
265
|
+
// },
|
|
266
|
+
// test: ({ accountBeforeTransaction, account, transaction }) => {
|
|
267
|
+
// invariant(accountBeforeTransaction.subAccounts, "sub accounts before");
|
|
268
|
+
// const trc10accountBefore = (
|
|
269
|
+
// accountBeforeTransaction.subAccounts as SubAccount[]
|
|
270
|
+
// ).find((s) => s.id === transaction.subAccountId);
|
|
271
|
+
// invariant(trc10accountBefore, "trc10 acc was here before");
|
|
272
|
+
// if (!trc10accountBefore) throw new Error("no trc10before account");
|
|
273
|
+
// invariant(account.subAccounts, "sub accounts");
|
|
274
|
+
// const trc10account = (account.subAccounts as SubAccount[]).find(
|
|
275
|
+
// (s) => s.id === transaction.subAccountId
|
|
276
|
+
// );
|
|
277
|
+
// invariant(trc10account, "trc10 acc is still here");
|
|
278
|
+
// if (!trc10account) throw new Error("no trc10 account");
|
|
279
|
+
// if (transaction.useAllAmount) {
|
|
280
|
+
// botTest("trc10 balance became zero", () =>
|
|
281
|
+
// expect(trc10account.balance.toString()).toBe("0")
|
|
282
|
+
// );
|
|
283
|
+
// } else {
|
|
284
|
+
// botTest("trc10 balance decreased with operation", () =>
|
|
285
|
+
// expect(trc10account.balance.toString()).toBe(
|
|
286
|
+
// trc10accountBefore.balance.minus(transaction.amount).toString()
|
|
287
|
+
// )
|
|
288
|
+
// );
|
|
289
|
+
// }
|
|
290
|
+
// },
|
|
291
|
+
// },
|
|
292
|
+
// {
|
|
293
|
+
// name: "move some TRC20",
|
|
294
|
+
// maxRun: 1,
|
|
295
|
+
// transaction: ({ account, siblings, bridge }) => {
|
|
296
|
+
// const balance = account.spendableBalance;
|
|
297
|
+
// const energy = get(account, "tronResources.energy", new BigNumber(0));
|
|
298
|
+
// invariant(
|
|
299
|
+
// energy.gt(0) || balance.gt(minimalAmount),
|
|
300
|
+
// "trx and energy too low"
|
|
301
|
+
// );
|
|
302
|
+
// const trc20Account = sample(
|
|
303
|
+
// (account.subAccounts || []).filter(
|
|
304
|
+
// (a) => a.type === "TokenAccount" && a.token.tokenType === "trc20"
|
|
305
|
+
// )
|
|
306
|
+
// );
|
|
307
|
+
// invariant(trc20Account, "no trc20 account");
|
|
308
|
+
// invariant(trc20Account?.balance.gt(0), "trc20 account has no balance");
|
|
309
|
+
// if (!trc20Account) throw new Error("no trc20 account");
|
|
310
|
+
// const sibling = pickSiblings(siblings, maxAccount);
|
|
311
|
+
// invariant(
|
|
312
|
+
// sibling.balance.gt(0),
|
|
313
|
+
// "recipient cannot receive trc20 because it has no balance"
|
|
314
|
+
// );
|
|
315
|
+
// const recipient = sibling.freshAddress;
|
|
316
|
+
// return {
|
|
317
|
+
// transaction: bridge.createTransaction(account),
|
|
318
|
+
// updates: [
|
|
319
|
+
// {
|
|
320
|
+
// recipient,
|
|
321
|
+
// subAccountId: trc20Account.id,
|
|
322
|
+
// },
|
|
323
|
+
// Math.random() < 0.5
|
|
324
|
+
// ? {
|
|
325
|
+
// useAllAmount: true,
|
|
326
|
+
// }
|
|
327
|
+
// : {
|
|
328
|
+
// amount: trc20Account.balance
|
|
329
|
+
// .times(Math.random())
|
|
330
|
+
// .integerValue(),
|
|
331
|
+
// },
|
|
332
|
+
// ],
|
|
333
|
+
// };
|
|
334
|
+
// },
|
|
335
|
+
// test: ({ accountBeforeTransaction, account, transaction }) => {
|
|
336
|
+
// invariant(accountBeforeTransaction.subAccounts, "sub accounts before");
|
|
337
|
+
// const trc20accountBefore = (
|
|
338
|
+
// accountBeforeTransaction.subAccounts as SubAccount[]
|
|
339
|
+
// ).find((s) => s.id === transaction.subAccountId);
|
|
340
|
+
// invariant(trc20accountBefore, "trc20 acc was here before");
|
|
341
|
+
// if (!trc20accountBefore) throw new Error("no trc20 before account");
|
|
342
|
+
// invariant(account.subAccounts, "sub accounts");
|
|
343
|
+
// const trc20account = (account.subAccounts as SubAccount[]).find(
|
|
344
|
+
// (s) => s.id === transaction.subAccountId
|
|
345
|
+
// );
|
|
346
|
+
// invariant(trc20account, "trc20 acc is still here");
|
|
347
|
+
// if (!trc20account) throw new Error("no trc20 account");
|
|
348
|
+
// if (transaction.useAllAmount) {
|
|
349
|
+
// botTest("trc10 balance became zero", () =>
|
|
350
|
+
// expect(trc20account.balance.toString()).toBe("0")
|
|
351
|
+
// );
|
|
352
|
+
// } else {
|
|
353
|
+
// botTest("trc10 balance decreased with operation", () =>
|
|
354
|
+
// expect(trc20account.balance.toString()).toBe(
|
|
355
|
+
// trc20accountBefore.balance.minus(transaction.amount).toString()
|
|
356
|
+
// )
|
|
357
|
+
// );
|
|
358
|
+
// }
|
|
359
|
+
// if (
|
|
360
|
+
// get(trc20accountBefore, "tronResources.energy", new BigNumber(0)).eq(
|
|
361
|
+
// 0
|
|
362
|
+
// )
|
|
363
|
+
// ) {
|
|
364
|
+
// botTest("account balance decreased", () =>
|
|
365
|
+
// expect(account.balance.lt(accountBeforeTransaction.balance)).toBe(
|
|
366
|
+
// true
|
|
367
|
+
// )
|
|
368
|
+
// );
|
|
369
|
+
// } else {
|
|
370
|
+
// botTest("energy decreased", () =>
|
|
371
|
+
// expect(
|
|
372
|
+
// get(account, "tronResources.energy", new BigNumber(0)).lt(
|
|
373
|
+
// get(
|
|
374
|
+
// accountBeforeTransaction,
|
|
375
|
+
// "tronResources.energy",
|
|
376
|
+
// new BigNumber(0)
|
|
377
|
+
// )
|
|
378
|
+
// )
|
|
379
|
+
// ).toBe(true)
|
|
380
|
+
// );
|
|
381
|
+
// botTest("balance didn't change", () =>
|
|
382
|
+
// expect(account.balance.eq(accountBeforeTransaction.balance)).toBe(
|
|
383
|
+
// true
|
|
384
|
+
// )
|
|
385
|
+
// );
|
|
386
|
+
// }
|
|
387
|
+
// },
|
|
388
|
+
// },
|
|
389
|
+
/*
|
|
390
|
+
We do not manage staking anymore
|
|
391
|
+
{
|
|
392
|
+
name: "claim rewards",
|
|
393
|
+
maxRun: 1,
|
|
394
|
+
transaction: ({ account, bridge }) => {
|
|
395
|
+
const nextRewardDate = getNextRewardDate(account as TronAccount);
|
|
396
|
+
const today = Date.now();
|
|
397
|
+
const unwithdrawnReward = new BigNumber(
|
|
398
|
+
get(account, "tronResources.unwithdrawnReward", "0"),
|
|
399
|
+
);
|
|
400
|
+
invariant(unwithdrawnReward.gt(0), "no rewards to claim");
|
|
401
|
+
invariant(
|
|
402
|
+
nextRewardDate && nextRewardDate <= today,
|
|
403
|
+
"you can't claim twice in less than 24 hours",
|
|
404
|
+
);
|
|
405
|
+
return {
|
|
406
|
+
transaction: bridge.createTransaction(account),
|
|
407
|
+
updates: [
|
|
408
|
+
{
|
|
409
|
+
mode: "claimReward",
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
};
|
|
413
|
+
},
|
|
414
|
+
test: ({ account }) => {
|
|
415
|
+
const rewards = new BigNumber(get(account, "tronResources.unwithdrawnReward", "0"));
|
|
416
|
+
const nextRewardDate = getNextRewardDate(account as TronAccount);
|
|
417
|
+
botTest("rewards is zero", () => expect(rewards.eq(0)).toBe(true));
|
|
418
|
+
botTest("next reward date settled", () =>
|
|
419
|
+
expect(nextRewardDate && nextRewardDate > Date.now()).toBe(true),
|
|
420
|
+
);
|
|
421
|
+
},
|
|
422
|
+
},*/
|
|
423
|
+
],
|
|
424
|
+
};
|
|
425
|
+
export default {
|
|
426
|
+
tron,
|
|
427
|
+
};
|
|
428
|
+
//# sourceMappingURL=bot-specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-specs.js","sourceRoot":"","sources":["../../src/test/bot-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE3E,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC/C,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;+CAC+C;AAE/C,yEAAyE;AACzE,MAAM,mBAAmB,GAAG,CAAC,KAAgB,EAAE,QAAmB,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IAChF,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAI,EAC1B,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5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CAA8C;QAC9C,eAAe;QACf,wDAAwD;QACxD,mBAAmB;QACnB,YAAY;QACZ,uBAAuB;QACvB,2CAA2C;QAC3C,aAAa;QACb,8BAA8B;QAC9B,gBAAgB;QAChB,oCAAoC;QACpC,gBAAgB;QAChB,gBAAgB;QAChB,6CAA6C;QAC7C,wCAAwC;QACxC,mCAAmC;QACnC,iBAAiB;QACjB,WAAW;QACX,SAAS;QACT,OAAO;QACP,oEAAoE;QACpE,8EAA8E;QAC9E,mCAAmC;QACnC,6DAA6D;QAC7D,wDAAwD;QACxD,kEAAkE;QAClE,2EAA2E;QAC3E,sDAAsD;QACtD,uEAAuE;QACvE,iDAAiD;QACjD,SAAS;QACT,0DAA0D;QAC1D,8DAA8D;QAE9D,sCAAsC;QACtC,mDAAmD;QACnD,4DAA4D;QAC5D,WAAW;QACX,eAAe;QACf,gEAAgE;QAChE,wDAAwD;QACxD,4EAA4E;QAC5E,YAAY;QACZ,WAAW;QACX,QAAQ;QAER,WAAW;QACX,8EAA8E;QAC9E,YAAY;QACZ,UAAU;QACV,UAAU;QACV,mDAAmD;QACnD,6EAA6E;QAC7E,iBAAiB;QACjB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,0CAA0C;QAC1C,kBAAkB;QAClB,uEAAuE;QACvE,mBAAmB;QACnB,0CAA0C;QAC1C,wCAAwC;QACxC,iCAAiC;QACjC,gBAAgB;QAChB,cAAc;QACd,uBAAuB;QACvB,WAAW;QACX,+CAA+C;QAC/C,6EAA6E;QAC7E,iBAAiB;QACjB,YAAY;QACZ,WAAW;QACX,QAAQ;QACR,OAAO;QACP,KAAK;QACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiCI;KACL;CACF,CAAC;AACF,eAAe;IACb,IAAI;CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeDatasetTest.d.ts","sourceRoot":"","sources":["../../src/test/bridgeDatasetTest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA2B,WAAW,EAAgB,MAAM,sBAAsB,CAAC;AAkB/F,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAC;AAgyC5D,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAK5C,CAAC"}
|