Skip to content

Commit fb7733e

Browse files
committed
Revert "Add zemu test"
This reverts commit 67baf53.
1 parent ffa9722 commit fb7733e

File tree

1 file changed

+1
-54
lines changed

1 file changed

+1
-54
lines changed

tests_zemu/tests/test.js

+1-54
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ describe('Basic checks', function () {
368368
const exampleTransferBlob = "f9023ff9023bb90195696d706f72742046756e6769626c65546f6b656e2066726f6d203078656538323835366266323065326161360a7472616e73616374696f6e28616d6f756e743a205546697836342c20746f3a204164647265737329207b0a6c6574207661756c743a204046756e6769626c65546f6b656e2e5661756c740a70726570617265287369676e65723a20417574684163636f756e7429207b0a73656c662e7661756c74203c2d207369676e65720a2e626f72726f773c267b46756e6769626c65546f6b656e2e50726f76696465727d3e2866726f6d3a202f73746f726167652f666c6f77546f6b656e5661756c7429210a2e776974686472617728616d6f756e743a20616d6f756e74290a7d0a65786563757465207b0a6765744163636f756e7428746f290a2e6765744361706162696c697479282f7075626c69632f666c6f77546f6b656e526563656976657229210a2e626f72726f773c267b46756e6769626c65546f6b656e2e52656365697665727d3e2829210a2e6465706f7369742866726f6d3a203c2d73656c662e7661756c74290a7d0a7df861b07b2274797065223a22554669783634222c2276616c7565223a223138343436373434303733372e39353531363135227daf7b2274797065223a2241646472657373222c2276616c7565223a22307866386436653035383662306132306337227da0f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b2a88f8d6e0586b0a20c7040a88f8d6e0586b0a20c7c988f8d6e0586b0a20c7c0"
369369
const exampleCreateBlob = "f90289f90261b8a97472616e73616374696f6e287075626c69634b6579733a205b537472696e675d29207b0a70726570617265287369676e65723a20417574684163636f756e7429207b0a6c65742061636374203d20417574684163636f756e742870617965723a207369676e6572290a666f72206b657920696e207075626c69634b657973207b0a616363742e6164645075626c69634b6579286b65792e6465636f64654865782829290a7d0a7d0a7df90173b901707b2274797065223a224172726179222c2276616c7565223a5b7b2274797065223a22537472696e67222c2276616c7565223a2266383435623834303934343838613739356130373730306336666238336530363663663537646664383766393263653730636263383163623362643366656132646637623637303733623730653336623434663335373862343364363464336661613265386534313565663663326235666534333930643561373865323338353831633665346263333033303330227d2c7b2274797065223a22537472696e67222c2276616c7565223a2266383435623834303934343838613739356130373730306336666238336530363663663537646664383766393263653730636263383163623362643366656132646637623637303733623730653336623434663335373862343364363464336661613265386534313565663663326235666534333930643561373865323338353831633665346263333033303331227d5d7da0f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b2a88f8d6e0586b0a20c7040a88f8d6e0586b0a20c7c988f8d6e0586b0a20c7e4e38004a0f7225388c1d69d57e6251c9fda50cbbf9e05131e5adb81e5aa0422402f048162"
370370
const exampleAddKeyBlob = "f90186f9015eb86e7472616e73616374696f6e287075626c69634b65793a20537472696e6729207b0a70726570617265287369676e65723a20417574684163636f756e7429207b0a7369676e65722e6164645075626c69634b6579287075626c69634b65792e6465636f64654865782829290a7d0a7df8acb8aa7b2274797065223a22537472696e67222c2276616c7565223a2266383435623834303934343838613739356130373730306336666238336530363663663537646664383766393263653730636263383163623362643366656132646637623637303733623730653336623434663335373862343364363464336661613265386534313565663663326235666534333930643561373865323338353831633665346263333033303330227da0f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b2a88f8d6e0586b0a20c7040a88f8d6e0586b0a20c7c988f8d6e0586b0a20c7e4e38004a0f7225388c1d69d57e6251c9fda50cbbf9e05131e5adb81e5aa0422402f048162"
371-
const exampleRegisterNodeBlob = "f904fef904d6b902da696d706f7274204c6f636b6564546f6b656e732066726f6d203078393565303139613137643065323364370a696d706f7274205374616b696e6750726f78792066726f6d203078376161643932653561303731356432310a0a7472616e73616374696f6e2869643a20537472696e672c20726f6c653a2055496e74382c206e6574776f726b696e67416464726573733a20537472696e672c206e6574776f726b696e674b65793a20537472696e672c207374616b696e674b65793a20537472696e672c20616d6f756e743a2055466978363429207b0a0a202020206c657420686f6c6465725265663a20264c6f636b6564546f6b656e732e546f6b656e486f6c6465720a0a2020202070726570617265286163636f756e743a20417574684163636f756e7429207b0a202020202020202073656c662e686f6c646572526566203d206163636f756e742e626f72726f773c264c6f636b6564546f6b656e732e546f6b656e486f6c6465723e2866726f6d3a204c6f636b6564546f6b656e732e546f6b656e486f6c64657253746f7261676550617468290a2020202020202020202020203f3f2070616e69632822436f756c64206e6f7420626f72726f772072656620746f20546f6b656e486f6c64657222290a202020207d0a0a2020202065786563757465207b0a20202020202020206c6574206e6f6465496e666f203d205374616b696e6750726f78792e4e6f6465496e666f2869643a2069642c20726f6c653a20726f6c652c206e6574776f726b696e67416464726573733a206e6574776f726b696e67416464726573732c206e6574776f726b696e674b65793a206e6574776f726b696e674b65792c207374616b696e674b65793a207374616b696e674b6579290a0a202020202020202073656c662e686f6c6465725265662e6372656174654e6f64655374616b6572286e6f6465496e666f3a206e6f6465496e666f2c20616d6f756e743a20616d6f756e74290a202020207d0a7d0af901b6b85c7b2274797065223a22537472696e67222c2276616c7565223a2266303837343230346162326632666631633131323432316334396265393630386363666334386635653839306638396138666535306538663563623336643964227d9c7b2274797065223a2255496e7438222c2276616c7565223a2233227db85c7b2274797065223a22537472696e67222c2276616c7565223a2266303837343230346162326632666631633131323432316334396265393630386363666334386635653839306638396138666535306538663563623336643964227db85c7b2274797065223a22537472696e67222c2276616c7565223a2266303837343230346162326632666631633131323432316334396265393630386363666334386635653839306638396138666535306538663563623336643964227db85c7b2274797065223a22537472696e67222c2276616c7565223a2266303837343230346162326632666631633131323432316334396265393630386363666334386635653839306638396138666535306538663563623336643964227da07b2274797065223a22554669783634222c2276616c7565223a2231302e30227da0f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b2a8899a8ac2c71d4f6bd040a8899a8ac2c71d4f6bdc98899a8ac2c71d4f6bde4e38004a0f7225388c1d69d57e6251c9fda50cbbf9e05131e5adb81e5aa0422402f048162"
372-
371+
373372
it('sign secp256k1 basic & verify SHA2-256 - transfer', async function () {
374373
const sim = new Zemu(APP_PATH);
375374
try {
@@ -890,58 +889,6 @@ describe('Basic checks', function () {
890889
}
891890
});
892891

893-
894-
it('sign p256 basic & verify SHA2-256 - register node', async function () {
895-
const sim = new Zemu(APP_PATH);
896-
try {
897-
await sim.start(simOptions);
898-
const app = new FlowApp(sim.getTransport());
899-
900-
const scheme = FlowApp.Signature.P256 | FlowApp.Hash.SHA2_256;
901-
const path = `m/44'/539'/${scheme}'/0/0`;
902-
903-
const txBlob = Buffer.from(
904-
exampleRegisterNodeBlob,
905-
"hex",
906-
);
907-
908-
const pkResponse = await app.getAddressAndPubKey(path);
909-
console.log(pkResponse);
910-
expect(pkResponse.returnCode).toEqual(0x9000);
911-
expect(pkResponse.errorMessage).toEqual("No errors");
912-
913-
// do not wait here..
914-
const signatureRequest = app.sign(path, txBlob);
915-
// Wait until we are not in the main menu
916-
await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot());
917-
918-
await sim.compareSnapshotsAndAccept(".", "sign_p256_basic_verify_registerNode_sha2_256", 16);
919-
920-
let resp = await signatureRequest;
921-
console.log(resp);
922-
923-
expect(resp.returnCode).toEqual(0x9000);
924-
expect(resp.errorMessage).toEqual("No errors");
925-
926-
// Prepare digest
927-
const hasher = new jsSHA("SHA-256", "UINT8ARRAY");
928-
hasher.update(txBlob)
929-
const digest = hasher.getHash("HEX");
930-
931-
// Verify signature
932-
const ec = new EC("p256");
933-
const sig = resp.signatureDER.toString("hex");
934-
const pk = pkResponse.publicKey.toString("hex");
935-
console.log(digest);
936-
console.log(sig);
937-
console.log(pk);
938-
const signatureOk = ec.verify(digest, sig, pk, 'hex');
939-
expect(signatureOk).toEqual(true);
940-
} finally {
941-
await sim.close();
942-
}
943-
});
944-
945892
it('sign p256 basic & verify SHA3-256 - transfer', async function () {
946893
const sim = new Zemu(APP_PATH);
947894
try {

0 commit comments

Comments
 (0)