Updated ERC 1155 test

Removed hacky workaround. Also now properly waits for the promise of the last APDU.
This commit is contained in:
Alexandre Paillier
2022-02-08 18:00:19 +01:00
parent c2aadf0aad
commit 6be9b49228
5 changed files with 10 additions and 18 deletions

View File

@@ -16,17 +16,12 @@ test('[Nano ' + model.letter + '] Transfer ERC-1155', zemu(model, async (sim, et
await send_apdu(eth.transport, set_plugin);
await send_apdu(eth.transport, provide_nft_info);
await send_apdu(eth.transport, sign_first);
send_apdu(eth.transport, sign_more);
let sign_promise = send_apdu(eth.transport, sign_more);
await waitForAppScreen(sim, current_screen);
// Go to the reject screen
await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_transfer', [10]);
// 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();
// Sleep so it has time to send the response APDU
await Zemu.sleep(500);
await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_transfer', [10, -1, 0]);
await sign_promise;
}));
test('[Nano ' + model.letter + '] Batch transfer ERC-1155', zemu(model, async (sim, eth) => {
@@ -44,15 +39,10 @@ test('[Nano ' + model.letter + '] Batch transfer ERC-1155', zemu(model, async (s
await send_apdu(eth.transport, sign_first);
await send_apdu(eth.transport, sign_more_1);
await send_apdu(eth.transport, sign_more_2);
send_apdu(eth.transport, sign_more_3);
let sign_promise = send_apdu(eth.transport, sign_more_3);
await waitForAppScreen(sim, current_screen);
// Go to the reject screen
await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_batch_transfer', [8]);
// 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();
// Sleep so it has time to send the response APDU
await Zemu.sleep(500);
await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_batch_transfer', [8, -1, 0]);
await sign_promise;
}));