Updated starkware test
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 374 B |
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 488 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 774 B After Width: | Height: | Size: 391 B |
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 429 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 313 B |
|
Before Width: | Height: | Size: 458 B After Width: | Height: | Size: 315 B |
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 281 B |
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 340 B |
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 693 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 571 B |
|
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 568 B After Width: | Height: | Size: 345 B |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 395 B |
|
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 365 B |
@@ -1,65 +1,45 @@
|
||||
import "core-js/stable";
|
||||
import "regenerator-runtime/runtime";
|
||||
import { waitForAppScreen, zemu } from './test.fixture';
|
||||
import { waitForAppScreen, zemu, nano_models } from './test.fixture';
|
||||
import { byContractAddressAndChainId } from '@ledgerhq/hw-app-eth/erc20'
|
||||
import { BigNumber } from "bignumber.js";
|
||||
|
||||
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) => {
|
||||
|
||||
// Provide USDT token info to the app
|
||||
const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
|
||||
await eth.provideERC20TokenInformation(usdt_info);
|
||||
// Provide USDT token info to the app
|
||||
const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
|
||||
await eth.provideERC20TokenInformation(usdt_info);
|
||||
|
||||
// Provide Stark quantum
|
||||
const quantization = new BigNumber(1);
|
||||
await eth.starkProvideQuantum_v2(
|
||||
"0xdac17f958d2ee523a2206206994597c13d831ec7",
|
||||
"erc20",
|
||||
quantization,
|
||||
null
|
||||
)
|
||||
// Provide Stark quantum
|
||||
const quantization = new BigNumber(1);
|
||||
await eth.starkProvideQuantum_v2(
|
||||
"0xdac17f958d2ee523a2206206994597c13d831ec7",
|
||||
"erc20",
|
||||
quantization,
|
||||
null
|
||||
)
|
||||
|
||||
const tx = eth.signTransaction(
|
||||
"44'/60'/1'/0/0",
|
||||
'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
|
||||
);
|
||||
const tx = eth.signTransaction(
|
||||
"44'/60'/1'/0/0",
|
||||
'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
|
||||
);
|
||||
|
||||
await waitForAppScreen(sim);
|
||||
await sim.navigateAndCompareSnapshots('.', 'nanos_starkware_usdt_deposit', [13, 0]);
|
||||
await waitForAppScreen(sim);
|
||||
let clicks;
|
||||
if (model.letter === 'S') clicks = [14];
|
||||
else clicks = [10];
|
||||
// Go to the reject screen
|
||||
await sim.navigateAndCompareSnapshots('.', model.name + '_starkware_usdt_deposit', 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": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
|
||||
"s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
|
||||
"v": "1c",
|
||||
});
|
||||
}));
|
||||
|
||||
test.skip('[Nano X] Transfer Ether on Ethereum app', zemu("nanox", async (sim, eth) => {
|
||||
|
||||
// Provide USDT token info to the app
|
||||
const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
|
||||
await eth.provideERC20TokenInformation(usdt_info);
|
||||
|
||||
// Provide Stark quantum
|
||||
const quantization = new BigNumber(1);
|
||||
await eth.starkProvideQuantum_v2(
|
||||
"0xdac17f958d2ee523a2206206994597c13d831ec7",
|
||||
"erc20",
|
||||
quantization,
|
||||
null
|
||||
)
|
||||
|
||||
const tx = eth.signTransaction(
|
||||
"44'/60'/1'/0/0",
|
||||
'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
|
||||
);
|
||||
|
||||
await waitForAppScreen(sim);
|
||||
await sim.navigateAndCompareSnapshots('.', 'nanox_starkware_usdt_deposit', [9, 0]);
|
||||
|
||||
await expect(tx).resolves.toEqual({
|
||||
"r": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
|
||||
"s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
|
||||
"v": "1c",
|
||||
});
|
||||
}));
|
||||
await expect(tx).resolves.toEqual({
|
||||
"r": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
|
||||
"s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
|
||||
"v": "1c",
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||