Port 'contract_data_warning.test' from 'zemu' to 'ragger'
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 419 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
1
tests/ragger/snapshots/nanosp/test_legacy_contract
Symbolic link
@@ -0,0 +1 @@
|
||||
../nanox/test_legacy_contract
|
||||
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
@@ -201,6 +201,31 @@ def test_legacy_chainid2(firmware: Firmware,
|
||||
common(firmware, backend, navigator, tx_params, test_name, BIP32_PATH2)
|
||||
|
||||
|
||||
# Legacy Zemu contract data warning: Try to blind sign with setting disabled
|
||||
def test_legacy_contract(firmware: Firmware,
|
||||
backend: BackendInterface,
|
||||
navigator: Navigator,
|
||||
test_name: str):
|
||||
|
||||
buffer = bytes.fromhex("058000002c8000003c800000010000000000000000f849208506fc23ac008303dc3194f650c3d88d12db855b8bf7d11be6c55a4e07dcc980a4a1712d6800000000000000000000000000000000000000000000000000000000000acbc7018080")
|
||||
app_client = EthAppClient(backend)
|
||||
|
||||
try:
|
||||
with app_client.send_raw(0xe0, 0x04, 0x00, 0x00, buffer):
|
||||
if firmware.device.startswith("nano"):
|
||||
# No screens recorded on Stax
|
||||
moves = [
|
||||
NavInsID.RIGHT_CLICK,
|
||||
NavInsID.BOTH_CLICK
|
||||
]
|
||||
navigator.navigate_and_compare(ROOT_SNAPSHOT_PATH,
|
||||
test_name,
|
||||
moves)
|
||||
|
||||
except ExceptionRAPDU as e:
|
||||
assert e.status == StatusWord.INVALID_DATA
|
||||
|
||||
|
||||
def test_1559(firmware: Firmware, backend: BackendInterface, navigator: Navigator):
|
||||
tx_params: dict = {
|
||||
"nonce": NONCE,
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import 'core-js/stable';
|
||||
import 'regenerator-runtime/runtime';
|
||||
import { TransportStatusError } from "@ledgerhq/errors";
|
||||
import { waitForAppScreen, zemu, nano_models } from './test.fixture';
|
||||
import Zemu from '@zondax/zemu';
|
||||
|
||||
nano_models.forEach(function(model) {
|
||||
test('[Nano ' + model.letter + '] Try to blind sign with setting disabled', zemu(model, async (sim, eth) => {
|
||||
// we can't use eth.signTransaction because it detects that contract data is disabled and fails early
|
||||
let transport = await sim.getTransport();
|
||||
let buffer = Buffer.from("058000002c8000003c800000010000000000000000f849208506fc23ac008303dc3194f650c3d88d12db855b8bf7d11be6c55a4e07dcc980a4a1712d6800000000000000000000000000000000000000000000000000000000000acbc7018080", "hex");
|
||||
let tx = transport.send(0xe0, 0x04, 0x00, 0x00, buffer);
|
||||
|
||||
await expect(tx).rejects.toEqual(new TransportStatusError(0x6a80));
|
||||
|
||||
await Zemu.sleep(1000);
|
||||
await waitForAppScreen(sim);
|
||||
let clicks;
|
||||
if (model.letter === 'S') clicks = [1, 0];
|
||||
else clicks = [0];
|
||||
await sim.navigateAndCompareSnapshots('.', model.name + '_try_to_blind_sign_with_setting_disabled', clicks);
|
||||
}));
|
||||
});
|
||||