Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apaillier-ledger committed Feb 13, 2024
1 parent 9ad8b38 commit 6b512bc
Show file tree
Hide file tree
Showing 50 changed files with 0 additions and 108 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/ragger/snapshots/nanox/domain_name_unknown_chain/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/ragger/snapshots/nanox/domain_name_unknown_chain/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/ragger/snapshots/stax/domain_name_unknown_chain/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
84 changes: 0 additions & 84 deletions tests/speculos/test_sign_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,90 +83,6 @@ def test_sign_simple(cmd):
assert v == 0x26 # 38
assert r.hex() == "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49"
assert s.hex() == "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd"


def test_sign_dai_coin_type_on_network_5234(cmd):
result: list = []

# DAI coin type
bip32_path="44'/700'/1'/0/0"

transaction = Transaction(
txType=0xEB,
nonce=0,
gasPrice=0x0306dc4200,
gasLimit=0x5208,
to="0x5a321744667052affa8386ed49e00ef223cbffc3",
value=0x6f9c9e7bf61818,
chainID=5243,
)

with cmd.simple_sign_tx(bip32_path=bip32_path, transaction=transaction, result=result) as ex:
sleep(0.5)

if cmd.model == "nanos":
# Review transaction
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00000.png")
cmd.client.press_and_release('right')

# Amount 1/3, 2/3, 3/3
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00001.png")
cmd.client.press_and_release('right')
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00002.png")
cmd.client.press_and_release('right')
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00003.png")
cmd.client.press_and_release('right')

# Address 1/3, 2/3, 3/3
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00004.png")
cmd.client.press_and_release('right')
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00005.png")
cmd.client.press_and_release('right')
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00006.png")
cmd.client.press_and_release('right')

# Network 5243
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00007.png")
cmd.client.press_and_release('right')

# Max Fees
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00008.png")
cmd.client.press_and_release('right')

# Accept and send
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00009.png")
cmd.client.press_and_release('both')

if cmd.model == "nanox" or cmd.model == "nanosp":
# Review transaction
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00000.png")
cmd.client.press_and_release('right')

# Amount
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00001.png")
cmd.client.press_and_release('right')

# Address
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00002.png")
cmd.client.press_and_release('right')

# Network 5243
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00003.png")
cmd.client.press_and_release('right')

# Max Fees
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00004.png")
cmd.client.press_and_release('right')

# Accept and send
compare_screenshot(cmd, f"screenshots/sign/{PATH_IMG[cmd.model]}/dai_coin_type_on_network_5234/00005.png")
cmd.client.press_and_release('both')

v, r, s = result

assert v == 0x1A # 26
assert r.hex() == "7ebfa5d5cac1e16bb1f1a8c67706b5c6019c0f198df6bb44e742a9de72330961"
assert s.hex() == "537419d8d1443d38ea87943c110789decb43b8f4fea8fae256fe842f669da634"


def test_sign_reject(cmd):
Expand Down
Binary file modified tests/zemu/snapshots/nanos_starkware_usdt_deposit/00012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

This file was deleted.

Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

This file was deleted.

Diff not rendered.
22 changes: 0 additions & 22 deletions tests/zemu/src/send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,3 @@ nano_models.forEach(function(model) {
await expect(tx).rejects.toEqual(new TransportStatusError(0x6807));
}));
});

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',
);

await waitForAppScreen(sim);
let clicks;
if (model.letter === 'S') clicks = 10;
else clicks = 6;
await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum_5234_network', [clicks, -1, 0]);

await expect(tx).resolves.toEqual({
"r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
"s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
"v": "2908",
});
}));
});

0 comments on commit 6b512bc

Please sign in to comment.