Port 'send_bsc.test' from 'zemu' to 'ragger'

This commit is contained in:
Charles-Edouard de la Vergne
2024-04-03 17:28:17 +02:00
parent 4fce1d4afd
commit d1cdc6b1f2
32 changed files with 20 additions and 30 deletions

View File

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

View File

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 337 B

View File

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View File

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

View File

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 497 B

View File

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 504 B

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

View File

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

View File

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 377 B

View File

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

View File

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 349 B

View File

@@ -0,0 +1 @@
../nanox/test_legacy_send_bsc

View File

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

View File

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 585 B

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

View File

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -126,9 +126,9 @@ def test_legacy(firmware: Firmware, backend: BackendInterface, navigator: Naviga
# Legacy Zemu Send: Transfer Ether on Ethereum app
def test_legacy_send(firmware: Firmware,
backend: BackendInterface,
navigator: Navigator,
test_name: str):
backend: BackendInterface,
navigator: Navigator,
test_name: str):
tx_params: dict = {
"nonce": NONCE2,
"gasPrice": Web3.to_wei(GAS_PRICE, "gwei"),
@@ -153,6 +153,22 @@ def test_legacy_send_error(backend: BackendInterface):
common_fail(backend, tx_params, StatusWord.EXCEPTION_OVERFLOW, path=BIP32_PATH2)
# Legacy Zemu Send BSC: Transfer bsc
def test_legacy_send_bsc(firmware: Firmware,
backend: BackendInterface,
navigator: Navigator,
test_name: str):
tx_params: dict = {
"nonce": 1,
"gasPrice": Web3.to_wei(5, 'gwei'),
"gas": GAS_LIMIT,
"to": ADDR2,
"value": 31415926913374232,
"chainId": 56
}
common(firmware, backend, navigator, tx_params, test_name, BIP32_PATH2)
def test_1559(firmware: Firmware, backend: BackendInterface, navigator: Navigator):
tx_params: dict = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

View File

@@ -1 +0,0 @@
00009.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

View File

@@ -1 +0,0 @@
00005.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

View File

@@ -1,25 +0,0 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
import { waitForAppScreen, zemu, nano_models } from './test.fixture';
nano_models.forEach(function(model) {
test('[Nano ' + model.letter + '] Transfer bsc', zemu(model, async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'EB0185012A05F200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880388080',
);
await waitForAppScreen(sim);
let clicks;
if (model.letter === 'S') clicks = 10;
else clicks = 6;
await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_bsc', [clicks, -1, 0]);
await expect(tx).resolves.toEqual({
"r": "f667cc34e9815df4f052fb3463cdbe355fff5c1acf4e919b3539806521a059ad",
"s": "6b35492b7108d9d9e1cc7aede536ed6b3173197b56dd873cbc3b43e041d6f407",
"v": "93",
});
}));
});