@ledgerhq/live-common 34.53.0-nightly.20251119110540 → 34.53.0-nightly.20251120023735
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/lib/e2e/deviceInteraction/DeviceController.d.ts +41 -0
- package/lib/e2e/deviceInteraction/DeviceController.d.ts.map +1 -0
- package/lib/e2e/deviceInteraction/DeviceController.js +68 -0
- package/lib/e2e/deviceInteraction/DeviceController.js.map +1 -0
- package/lib/e2e/families/algorand.d.ts +1 -1
- package/lib/e2e/families/algorand.d.ts.map +1 -1
- package/lib/e2e/families/algorand.js +5 -5
- package/lib/e2e/families/algorand.js.map +1 -1
- package/lib/e2e/families/aptos.d.ts +2 -2
- package/lib/e2e/families/aptos.d.ts.map +1 -1
- package/lib/e2e/families/aptos.js +9 -9
- package/lib/e2e/families/aptos.js.map +1 -1
- package/lib/e2e/families/bitcoin.d.ts +2 -2
- package/lib/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib/e2e/families/bitcoin.js +11 -11
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts +6 -0
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +28 -26
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/celo.d.ts +1 -1
- package/lib/e2e/families/celo.d.ts.map +1 -1
- package/lib/e2e/families/celo.js +5 -5
- package/lib/e2e/families/celo.js.map +1 -1
- package/lib/e2e/families/cosmos.d.ts +2 -2
- package/lib/e2e/families/cosmos.d.ts.map +1 -1
- package/lib/e2e/families/cosmos.js +9 -9
- package/lib/e2e/families/cosmos.js.map +1 -1
- package/lib/e2e/families/evm.d.ts +2 -0
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +13 -12
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/hedera.d.ts +1 -1
- package/lib/e2e/families/hedera.d.ts.map +1 -1
- package/lib/e2e/families/hedera.js +5 -5
- package/lib/e2e/families/hedera.js.map +1 -1
- package/lib/e2e/families/kaspa.d.ts +2 -2
- package/lib/e2e/families/kaspa.d.ts.map +1 -1
- package/lib/e2e/families/kaspa.js +9 -9
- package/lib/e2e/families/kaspa.js.map +1 -1
- package/lib/e2e/families/multiversX.d.ts +1 -1
- package/lib/e2e/families/multiversX.d.ts.map +1 -1
- package/lib/e2e/families/multiversX.js +5 -5
- package/lib/e2e/families/multiversX.js.map +1 -1
- package/lib/e2e/families/near.d.ts +1 -1
- package/lib/e2e/families/near.d.ts.map +1 -1
- package/lib/e2e/families/near.js +6 -6
- package/lib/e2e/families/near.js.map +1 -1
- package/lib/e2e/families/osmosis.d.ts +1 -1
- package/lib/e2e/families/osmosis.d.ts.map +1 -1
- package/lib/e2e/families/osmosis.js +5 -5
- package/lib/e2e/families/osmosis.js.map +1 -1
- package/lib/e2e/families/polkadot.d.ts +1 -1
- package/lib/e2e/families/polkadot.d.ts.map +1 -1
- package/lib/e2e/families/polkadot.js +5 -5
- package/lib/e2e/families/polkadot.js.map +1 -1
- package/lib/e2e/families/solana.d.ts +2 -2
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +9 -9
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/families/stellar.d.ts +1 -1
- package/lib/e2e/families/stellar.d.ts.map +1 -1
- package/lib/e2e/families/stellar.js +5 -5
- package/lib/e2e/families/stellar.js.map +1 -1
- package/lib/e2e/families/sui.d.ts +1 -1
- package/lib/e2e/families/sui.d.ts.map +1 -1
- package/lib/e2e/families/sui.js +5 -5
- package/lib/e2e/families/sui.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +7 -8
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/families/tron.d.ts +1 -1
- package/lib/e2e/families/tron.d.ts.map +1 -1
- package/lib/e2e/families/tron.js +5 -5
- package/lib/e2e/families/tron.js.map +1 -1
- package/lib/e2e/families/xrp.d.ts +1 -1
- package/lib/e2e/families/xrp.d.ts.map +1 -1
- package/lib/e2e/families/xrp.js +5 -5
- package/lib/e2e/families/xrp.js.map +1 -1
- package/lib/e2e/index.d.ts +6 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +11 -11
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +78 -78
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +1 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/canton/react.d.ts +15 -0
- package/lib/families/canton/react.d.ts.map +1 -0
- package/lib/families/canton/react.js +14 -0
- package/lib/families/canton/react.js.map +1 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +2 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +2 -0
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts +41 -0
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts.map +1 -0
- package/lib-es/e2e/deviceInteraction/DeviceController.js +63 -0
- package/lib-es/e2e/deviceInteraction/DeviceController.js.map +1 -0
- package/lib-es/e2e/families/algorand.d.ts +1 -1
- package/lib-es/e2e/families/algorand.d.ts.map +1 -1
- package/lib-es/e2e/families/algorand.js +5 -4
- package/lib-es/e2e/families/algorand.js.map +1 -1
- package/lib-es/e2e/families/aptos.d.ts +2 -2
- package/lib-es/e2e/families/aptos.d.ts.map +1 -1
- package/lib-es/e2e/families/aptos.js +9 -7
- package/lib-es/e2e/families/aptos.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.d.ts +2 -2
- package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +11 -9
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts +6 -0
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +23 -21
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/celo.d.ts +1 -1
- package/lib-es/e2e/families/celo.d.ts.map +1 -1
- package/lib-es/e2e/families/celo.js +5 -4
- package/lib-es/e2e/families/celo.js.map +1 -1
- package/lib-es/e2e/families/cosmos.d.ts +2 -2
- package/lib-es/e2e/families/cosmos.d.ts.map +1 -1
- package/lib-es/e2e/families/cosmos.js +9 -7
- package/lib-es/e2e/families/cosmos.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts +2 -0
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +10 -9
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/hedera.d.ts +1 -1
- package/lib-es/e2e/families/hedera.d.ts.map +1 -1
- package/lib-es/e2e/families/hedera.js +5 -4
- package/lib-es/e2e/families/hedera.js.map +1 -1
- package/lib-es/e2e/families/kaspa.d.ts +2 -2
- package/lib-es/e2e/families/kaspa.d.ts.map +1 -1
- package/lib-es/e2e/families/kaspa.js +9 -7
- package/lib-es/e2e/families/kaspa.js.map +1 -1
- package/lib-es/e2e/families/multiversX.d.ts +1 -1
- package/lib-es/e2e/families/multiversX.d.ts.map +1 -1
- package/lib-es/e2e/families/multiversX.js +5 -4
- package/lib-es/e2e/families/multiversX.js.map +1 -1
- package/lib-es/e2e/families/near.d.ts +1 -1
- package/lib-es/e2e/families/near.d.ts.map +1 -1
- package/lib-es/e2e/families/near.js +6 -5
- package/lib-es/e2e/families/near.js.map +1 -1
- package/lib-es/e2e/families/osmosis.d.ts +1 -1
- package/lib-es/e2e/families/osmosis.d.ts.map +1 -1
- package/lib-es/e2e/families/osmosis.js +5 -4
- package/lib-es/e2e/families/osmosis.js.map +1 -1
- package/lib-es/e2e/families/polkadot.d.ts +1 -1
- package/lib-es/e2e/families/polkadot.d.ts.map +1 -1
- package/lib-es/e2e/families/polkadot.js +5 -4
- package/lib-es/e2e/families/polkadot.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts +2 -2
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +9 -7
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/families/stellar.d.ts +1 -1
- package/lib-es/e2e/families/stellar.d.ts.map +1 -1
- package/lib-es/e2e/families/stellar.js +5 -4
- package/lib-es/e2e/families/stellar.js.map +1 -1
- package/lib-es/e2e/families/sui.d.ts +1 -1
- package/lib-es/e2e/families/sui.d.ts.map +1 -1
- package/lib-es/e2e/families/sui.js +5 -4
- package/lib-es/e2e/families/sui.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +8 -8
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/families/tron.d.ts +1 -1
- package/lib-es/e2e/families/tron.d.ts.map +1 -1
- package/lib-es/e2e/families/tron.js +5 -4
- package/lib-es/e2e/families/tron.js.map +1 -1
- package/lib-es/e2e/families/xrp.d.ts +1 -1
- package/lib-es/e2e/families/xrp.d.ts.map +1 -1
- package/lib-es/e2e/families/xrp.js +5 -4
- package/lib-es/e2e/families/xrp.js.map +1 -1
- package/lib-es/e2e/index.d.ts +6 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +11 -11
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +54 -43
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +1 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/react.d.ts +15 -0
- package/lib-es/families/canton/react.d.ts.map +1 -0
- package/lib-es/families/canton/react.js +10 -0
- package/lib-es/families/canton/react.js.map +1 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +2 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +2 -0
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +52 -51
- package/src/e2e/deviceInteraction/DeviceController.ts +85 -0
- package/src/e2e/families/algorand.ts +20 -13
- package/src/e2e/families/aptos.ts +28 -16
- package/src/e2e/families/bitcoin.ts +53 -39
- package/src/e2e/families/cardano.ts +47 -36
- package/src/e2e/families/celo.ts +18 -12
- package/src/e2e/families/cosmos.ts +35 -23
- package/src/e2e/families/evm.ts +24 -13
- package/src/e2e/families/hedera.ts +6 -4
- package/src/e2e/families/kaspa.ts +28 -16
- package/src/e2e/families/multiversX.ts +16 -10
- package/src/e2e/families/near.ts +23 -17
- package/src/e2e/families/osmosis.ts +19 -13
- package/src/e2e/families/polkadot.ts +19 -13
- package/src/e2e/families/solana.ts +35 -23
- package/src/e2e/families/stellar.ts +18 -13
- package/src/e2e/families/sui.ts +15 -9
- package/src/e2e/families/tezos.ts +25 -18
- package/src/e2e/families/tron.ts +19 -13
- package/src/e2e/families/xrp.ts +19 -13
- package/src/e2e/speculos.ts +168 -140
- package/src/families/canton/bridge/mock.ts +1 -0
- package/src/families/canton/react.ts +50 -0
- package/src/featureFlags/defaultFeatures.ts +2 -0
- package/src/wallet-api/react.ts +2 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +0 -3
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +0 -1
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js +0 -26
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +0 -1
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +0 -3
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +0 -1
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js +0 -18
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +0 -1
- package/src/e2e/deviceInteraction/ButtonDeviceSimulator.ts +0 -23
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
|
|
4
|
-
import { getSpeculosModel } from "../speculosAppVersion";
|
|
5
|
-
import { pressBoth, pressRightButton } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
4
|
+
import { getSpeculosModel, isTouchDevice } from "../speculosAppVersion";
|
|
6
5
|
import {
|
|
7
6
|
pressAndRelease,
|
|
8
7
|
longPressAndRelease,
|
|
@@ -10,7 +9,7 @@ import {
|
|
|
10
9
|
} from "../deviceInteraction/TouchDeviceSimulator";
|
|
11
10
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
12
11
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
13
|
-
import {
|
|
12
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
14
13
|
|
|
15
14
|
type ActionType = "both" | "right" | "tap" | "swipe" | "confirm" | "hold";
|
|
16
15
|
|
|
@@ -32,32 +31,40 @@ async function sendCardanoTouchDevices(tx: Transaction) {
|
|
|
32
31
|
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
export const sendCardanoNanoS = withDeviceController(
|
|
35
|
+
({ getButtonsController }) =>
|
|
36
|
+
async (_tx: Transaction) => {
|
|
37
|
+
const buttons = getButtonsController();
|
|
38
|
+
await waitFor(DeviceLabels.NEW_ORDINARY);
|
|
39
|
+
await buttons.right();
|
|
40
|
+
await waitFor(DeviceLabels.SEND_TO_ADDRESS);
|
|
41
|
+
await buttons.both();
|
|
42
|
+
await pressUntilTextFound(DeviceLabels.SEND);
|
|
43
|
+
await buttons.both();
|
|
44
|
+
await waitFor(DeviceLabels.TRANSACTION_FEE);
|
|
45
|
+
await buttons.both();
|
|
46
|
+
await waitFor(DeviceLabels.CONFIRM);
|
|
47
|
+
await buttons.right();
|
|
48
|
+
},
|
|
49
|
+
);
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
export const sendCardanoButtonDevice = withDeviceController(
|
|
52
|
+
({ getButtonsController }) =>
|
|
53
|
+
async (tx: Transaction) => {
|
|
54
|
+
const buttons = getButtonsController();
|
|
55
|
+
await waitFor(DeviceLabels.NEW_ORDINARY);
|
|
56
|
+
await buttons.both();
|
|
57
|
+
await pressUntilTextFound(DeviceLabels.SEND_TO_ADDRESS_2);
|
|
58
|
+
await buttons.both();
|
|
59
|
+
const events = await pressUntilTextFound(DeviceLabels.SEND);
|
|
60
|
+
validateTransactionData(tx, events);
|
|
61
|
+
await buttons.both();
|
|
62
|
+
await waitFor(DeviceLabels.TRANSACTION_FEE);
|
|
63
|
+
await buttons.both();
|
|
64
|
+
await waitFor(DeviceLabels.CONFIRM);
|
|
65
|
+
await buttons.both();
|
|
66
|
+
},
|
|
67
|
+
);
|
|
61
68
|
|
|
62
69
|
export async function sendCardano(tx: Transaction) {
|
|
63
70
|
const speculosModel = getSpeculosModel();
|
|
@@ -127,14 +134,18 @@ async function delegateTouchDevicesAction(label: DeviceLabels) {
|
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
137
|
+
export const delegateNanoAction = withDeviceController(
|
|
138
|
+
({ getButtonsController }) =>
|
|
139
|
+
async (label: DeviceLabels, action: ActionType) => {
|
|
140
|
+
const buttons = getButtonsController();
|
|
141
|
+
await waitFor(label);
|
|
142
|
+
if (action === "both") {
|
|
143
|
+
await buttons.both();
|
|
144
|
+
} else {
|
|
145
|
+
await buttons.right();
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
);
|
|
138
149
|
|
|
139
150
|
async function executeDelegateStep(label: DeviceLabels, action: ActionType) {
|
|
140
151
|
try {
|
package/src/e2e/families/celo.ts
CHANGED
|
@@ -2,18 +2,24 @@ import { containsSubstringInEvent, getDelegateEvents, pressUntilTextFound } from
|
|
|
2
2
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
3
3
|
import { Delegate } from "../models/Delegate";
|
|
4
4
|
import expect from "expect";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
6
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
export const delegateCelo = withDeviceController(
|
|
10
|
+
({ getButtonsController }) =>
|
|
11
|
+
async (delegatingAccount: Delegate) => {
|
|
12
|
+
const buttons = getButtonsController();
|
|
13
|
+
|
|
14
|
+
const events = await getDelegateEvents(delegatingAccount);
|
|
15
|
+
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
16
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
17
|
+
|
|
18
|
+
if (isTouchDevice()) {
|
|
19
|
+
await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
20
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
21
|
+
} else {
|
|
22
|
+
await buttons.both();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
);
|
|
@@ -2,32 +2,44 @@ import expect from "expect";
|
|
|
2
2
|
import { Delegate } from "../models/Delegate";
|
|
3
3
|
import { Transaction } from "../models/Transaction";
|
|
4
4
|
import { containsSubstringInEvent, getDelegateEvents, getSendEvents } from "../speculos";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
6
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
8
7
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
8
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (isTouchDevice()) {
|
|
15
|
-
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
16
|
-
} else {
|
|
17
|
-
await pressBoth();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
10
|
+
export const delegateCosmos = withDeviceController(
|
|
11
|
+
({ getButtonsController }) =>
|
|
12
|
+
async (delegatingAccount: Delegate) => {
|
|
13
|
+
const buttons = getButtonsController();
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
expect(isAmountCorrect).toBeTruthy();
|
|
25
|
-
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
26
|
-
expect(isAddressCorrect).toBeTruthy();
|
|
15
|
+
const events = await getDelegateEvents(delegatingAccount);
|
|
16
|
+
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
17
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
19
|
+
if (isTouchDevice()) {
|
|
20
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
21
|
+
} else {
|
|
22
|
+
await buttons.both();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const sendCosmos = withDeviceController(
|
|
28
|
+
({ getButtonsController }) =>
|
|
29
|
+
async (tx: Transaction) => {
|
|
30
|
+
const buttons = getButtonsController();
|
|
31
|
+
|
|
32
|
+
const events = await getSendEvents(tx);
|
|
33
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
34
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
35
|
+
|
|
36
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
37
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
38
|
+
|
|
39
|
+
if (isTouchDevice()) {
|
|
40
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
41
|
+
} else {
|
|
42
|
+
await buttons.both();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
);
|
package/src/e2e/families/evm.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { containsSubstringInEvent, pressUntilTextFound } from "../speculos";
|
|
4
|
-
import { getSpeculosModel } from "../speculosAppVersion";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
4
|
+
import { getSpeculosModel, isTouchDevice } from "../speculosAppVersion";
|
|
6
5
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
6
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
8
7
|
import { Device } from "../enum/Device";
|
|
9
8
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
10
|
-
import {
|
|
9
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
11
10
|
|
|
12
11
|
function validateTransactionData(tx: Transaction, events: string[]) {
|
|
13
12
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
14
13
|
expect(isAmountCorrect).toBeTruthy();
|
|
14
|
+
|
|
15
15
|
if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
16
16
|
const isENSNameCorrect = containsSubstringInEvent(tx.accountToCredit.ensName, events);
|
|
17
17
|
expect(isENSNameCorrect).toBeTruthy();
|
|
@@ -27,20 +27,31 @@ async function sendEvmTouchDevices(tx: Transaction) {
|
|
|
27
27
|
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
export const sendEvmButtonDevice = withDeviceController(
|
|
31
|
+
({ getButtonsController }) =>
|
|
32
|
+
async (tx: Transaction) => {
|
|
33
|
+
const buttons = getButtonsController();
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
|
36
|
+
validateTransactionData(tx, events);
|
|
37
|
+
await buttons.both();
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const sendEvmNanoS = withDeviceController(
|
|
42
|
+
({ getButtonsController }) =>
|
|
43
|
+
async (tx: Transaction) => {
|
|
44
|
+
const buttons = getButtonsController();
|
|
45
|
+
|
|
46
|
+
const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
|
|
47
|
+
validateTransactionData(tx, events);
|
|
48
|
+
await buttons.both();
|
|
49
|
+
},
|
|
50
|
+
);
|
|
41
51
|
|
|
42
52
|
export async function sendEVM(tx: Transaction) {
|
|
43
53
|
const speculosModel = getSpeculosModel();
|
|
54
|
+
|
|
44
55
|
if (isTouchDevice()) {
|
|
45
56
|
return sendEvmTouchDevices(tx);
|
|
46
57
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
2
1
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
3
2
|
import { pressUntilTextFound } from "../speculos";
|
|
3
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
4
|
+
|
|
5
|
+
export const sendHedera = withDeviceController(({ getButtonsController }) => async () => {
|
|
6
|
+
const buttons = getButtonsController();
|
|
4
7
|
|
|
5
|
-
export async function sendHedera() {
|
|
6
8
|
await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
7
|
-
await
|
|
8
|
-
}
|
|
9
|
+
await buttons.both();
|
|
10
|
+
});
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { waitFor, containsSubstringInEvent, pressUntilTextFound, getSendEvents } from "../speculos";
|
|
3
3
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
4
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
4
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
6
5
|
import { Delegate } from "../models/Delegate";
|
|
7
6
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
8
7
|
import { Transaction } from "../models/Transaction";
|
|
8
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} else {
|
|
15
|
-
await pressBoth();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
10
|
+
export const sendKaspa = withDeviceController(
|
|
11
|
+
({ getButtonsController }) =>
|
|
12
|
+
async (tx: Transaction) => {
|
|
13
|
+
const buttons = getButtonsController();
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
15
|
+
await getSendEvents(tx);
|
|
16
|
+
|
|
17
|
+
if (isTouchDevice()) {
|
|
18
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
19
|
+
} else {
|
|
20
|
+
await buttons.both();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export const delegateKaspa = withDeviceController(
|
|
26
|
+
({ getButtonsController }) =>
|
|
27
|
+
async (delegatingAccount: Delegate) => {
|
|
28
|
+
const buttons = getButtonsController();
|
|
29
|
+
|
|
30
|
+
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
|
31
|
+
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
32
|
+
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
33
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
34
|
+
|
|
35
|
+
await buttons.both();
|
|
36
|
+
},
|
|
37
|
+
);
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { getDelegateEvents, pressUntilTextFound } from "../speculos";
|
|
2
2
|
import { Delegate } from "../models/Delegate";
|
|
3
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
4
3
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
5
4
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
6
5
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
6
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
7
7
|
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
export const delegateMultiversX = withDeviceController(
|
|
9
|
+
({ getButtonsController }) =>
|
|
10
|
+
async (delegatingAccount: Delegate) => {
|
|
11
|
+
const buttons = getButtonsController();
|
|
12
|
+
|
|
13
|
+
await getDelegateEvents(delegatingAccount);
|
|
14
|
+
|
|
15
|
+
if (isTouchDevice()) {
|
|
16
|
+
await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
17
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
18
|
+
} else {
|
|
19
|
+
await buttons.both();
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
);
|
package/src/e2e/families/near.ts
CHANGED
|
@@ -7,23 +7,29 @@ import {
|
|
|
7
7
|
pressUntilTextFound,
|
|
8
8
|
} from "../speculos";
|
|
9
9
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
10
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
11
10
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
12
11
|
import { longPressAndRelease, pressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
12
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
13
13
|
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
export const delegateNear = withDeviceController(
|
|
15
|
+
({ getButtonsController }) =>
|
|
16
|
+
async (delegatingAccount: Delegate) => {
|
|
17
|
+
const buttons = getButtonsController();
|
|
18
|
+
|
|
19
|
+
const events = await getDelegateEvents(delegatingAccount);
|
|
20
|
+
const isProviderCorrect = containsSubstringInEvent(delegatingAccount.provider, events);
|
|
21
|
+
expect(isProviderCorrect).toBeTruthy();
|
|
22
|
+
|
|
23
|
+
if (isTouchDevice()) {
|
|
24
|
+
await pressAndRelease(DeviceLabels.CONFIRM_HEADER);
|
|
25
|
+
await waitFor(DeviceLabels.VIEW_ACTION);
|
|
26
|
+
await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
27
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
28
|
+
} else {
|
|
29
|
+
await buttons.both();
|
|
30
|
+
await waitFor(DeviceLabels.VIEW_ACTION);
|
|
31
|
+
await pressUntilTextFound(DeviceLabels.SIGN);
|
|
32
|
+
await buttons.both();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -2,19 +2,25 @@ import { Delegate } from "../models/Delegate";
|
|
|
2
2
|
import { pressUntilTextFound, containsSubstringInEvent, getDelegateEvents } from "../speculos";
|
|
3
3
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
4
4
|
import expect from "expect";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
6
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
export const delegateOsmosis = withDeviceController(
|
|
10
|
+
({ getButtonsController }) =>
|
|
11
|
+
async (delegatingAccount: Delegate) => {
|
|
12
|
+
const buttons = getButtonsController();
|
|
13
|
+
|
|
14
|
+
const events = await getDelegateEvents(delegatingAccount);
|
|
15
|
+
const amountInUosmo = (Number(delegatingAccount.amount) * 1_000_000).toString();
|
|
16
|
+
const isAmountCorrect = containsSubstringInEvent(amountInUosmo, events);
|
|
17
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
18
|
+
|
|
19
|
+
if (isTouchDevice()) {
|
|
20
|
+
await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
21
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
22
|
+
} else {
|
|
23
|
+
await buttons.both();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
);
|
|
@@ -2,20 +2,26 @@ import expect from "expect";
|
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { containsSubstringInEvent, getSendEvents } from "../speculos";
|
|
4
4
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
6
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
14
|
-
expect(isAddressCorrect).toBeTruthy();
|
|
9
|
+
export const sendPolkadot = withDeviceController(
|
|
10
|
+
({ getButtonsController }) =>
|
|
11
|
+
async (tx: Transaction) => {
|
|
12
|
+
const buttons = getButtonsController();
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const events = await getSendEvents(tx);
|
|
15
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
16
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
17
|
+
|
|
18
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
19
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
20
|
+
|
|
21
|
+
if (isTouchDevice()) {
|
|
22
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
23
|
+
} else {
|
|
24
|
+
await buttons.both();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -2,33 +2,45 @@ import expect from "expect";
|
|
|
2
2
|
import { containsSubstringInEvent, getDelegateEvents, getSendEvents } from "../speculos";
|
|
3
3
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
4
4
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
6
|
import { Device } from "../enum/Device";
|
|
8
7
|
import { Transaction } from "../models/Transaction";
|
|
9
8
|
import { Delegate } from "../models/Delegate";
|
|
9
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} else {
|
|
16
|
-
await pressBoth();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
11
|
+
export const delegateSolana = withDeviceController(
|
|
12
|
+
({ getButtonsController }) =>
|
|
13
|
+
async (delegatingAccount: Delegate) => {
|
|
14
|
+
const buttons = getButtonsController();
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
const events = await getSendEvents(tx);
|
|
22
|
-
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
23
|
-
expect(isAmountCorrect).toBeTruthy();
|
|
24
|
-
if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
25
|
-
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
26
|
-
expect(isAddressCorrect).toBeTruthy();
|
|
27
|
-
}
|
|
16
|
+
await getDelegateEvents(delegatingAccount);
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
18
|
+
if (isTouchDevice()) {
|
|
19
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
20
|
+
} else {
|
|
21
|
+
await buttons.both();
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const sendSolana = withDeviceController(
|
|
27
|
+
({ getButtonsController }) =>
|
|
28
|
+
async (tx: Transaction) => {
|
|
29
|
+
const buttons = getButtonsController();
|
|
30
|
+
|
|
31
|
+
const events = await getSendEvents(tx);
|
|
32
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
33
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
34
|
+
|
|
35
|
+
if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
36
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
37
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (isTouchDevice()) {
|
|
41
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
42
|
+
} else {
|
|
43
|
+
await buttons.both();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
);
|
|
@@ -2,21 +2,26 @@ import expect from "expect";
|
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { containsSubstringInEvent, getSendEvents } from "../speculos";
|
|
4
4
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
5
|
-
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
6
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
6
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
|
+
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export const sendStellar = withDeviceController(
|
|
10
|
+
({ getButtonsController }) =>
|
|
11
|
+
async (tx: Transaction) => {
|
|
12
|
+
const buttons = getButtonsController();
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const events = await getSendEvents(tx);
|
|
15
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
16
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
19
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
20
|
+
|
|
21
|
+
if (isTouchDevice()) {
|
|
22
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
23
|
+
} else {
|
|
24
|
+
await buttons.both();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
);
|