Updated send test

This commit is contained in:
Alexandre Paillier
2022-01-27 14:55:11 +01:00
parent 571f439f58
commit 782e39c494
35 changed files with 56 additions and 68 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 365 B

View File

@@ -1,82 +1,70 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
import { waitForAppScreen, zemu } from './test.fixture';
import { waitForAppScreen, zemu, nano_models } from './test.fixture';
import { TransportStatusError } from "@ledgerhq/errors";
test('[Nano S] Transfer Ether on Ethereum app', zemu("nanos", async (sim, eth) => {
nano_models.forEach(function(model) {
test('[Nano ' + model.letter + '] Transfer Ether on Ethereum app', zemu(model, async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
);
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_ethereum', [8, 0]);
await waitForAppScreen(sim);
let clicks;
if (model.letter === 'S') clicks = [9];
else clicks = [5];
// Go to the reject screen
await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum', clicks);
// Accepting the transaction somehow takes too long for Zemu and takes the same screenshot
// twice, so accept it manually
await sim.clickLeft();
await sim.clickBoth();
await expect(tx).resolves.toEqual({
"r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
"s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
"v": "26",
});
}));
await expect(tx).resolves.toEqual({
"r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
"s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
"v": "26",
});
}));
});
test('[Nano S] Transfer amount >= 2^87 Eth on Ethereum app should fail', zemu("nanos", async (sim, eth) => {
nano_models.forEach(function(model) {
test('[Nano ' + model.letter + '] Transfer amount >= 2^87 Eth on Ethereum app should fail', zemu(model, async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'f83f268e02cc9be5c53ea44bd43c289dcddc82520894dac17f958d2ee523a2206206994597c13d831ec7928db8b0861b8f7fe5df83cd553a829878000080018080',
);
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'f83f268e02cc9be5c53ea44bd43c289dcddc82520894dac17f958d2ee523a2206206994597c13d831ec7928db8b0861b8f7fe5df83cd553a829878000080018080',
);
await expect(tx).rejects.toEqual(new TransportStatusError(0x6807));
}));
await expect(tx).rejects.toEqual(new TransportStatusError(0x6807));
}));
});
test('[Nano S] Transfer Ether on network 5234 on Ethereum app', zemu("nanos", async (sim, eth) => {
nano_models.forEach(function(model) {
test('[Nano ' + model.letter + '] Transfer Ether on network 5234 on Ethereum app', zemu(model, async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
);
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_ethereum_5234_network', [9, 0]);
await waitForAppScreen(sim);
let clicks;
if (model.letter === 'S') clicks = [10];
else clicks = [6];
// Go to the reject screen
await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum_5234_network', clicks);
// Accepting the transaction somehow takes too long for Zemu and takes the same screenshot
// twice, so accept it manually
await sim.clickLeft();
await sim.clickBoth();
await expect(tx).resolves.toEqual({
"r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
"s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
"v": "2908",
});
}));
test.skip('[Nano X] Transfer Ether on Ethereum app', zemu("nanox", async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_ethereum', [4, 0]);
await expect(tx).resolves.toEqual({
"r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
"s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
"v": "26",
});
}));
test.skip('[Nano X] Transfer Ether on network 5234 on Ethereum app', zemu("nanox", async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_ethereum_5234_network', [5, 0]);
await expect(tx).resolves.toEqual({
"r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
"s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
"v": "2908",
});
}));
await expect(tx).resolves.toEqual({
"r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
"s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
"v": "2908",
});
}));
});