Skip to content

Commit

Permalink
chore: add test cases to cover reported issue #166
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Oct 23, 2024
1 parent 82aa7f3 commit e19c914
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testvectors/manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,5 +720,13 @@
"params": ["d0e30db0"]
},
"encoded_tx_hex": "8a0056040a6c297aed654816dc5d211c956de816ba923475d255011eaf1c8a4bbfeeb0870b1745b1f57503470b71160849000de0b6b3a76400001a00da3a90440001899344000185751ae525aa154544d0e30db0"
},
{
"description": "Issue #166",
"encoded_tx": "notAvailable",
"valid": true,
"error": "",
"testnet": false,
"encoded_tx_hex": "8A005502972DE5CB57E5208A9FEF1887B39B2BE0EBDA5FEE5501539A38D7116E30F44985EFF6E99A2D5FBADF951901401A044A58AB44000189DD44000185BF025901E88456040ADC451DCFCE6429224C835B09E60FFAD5EBBBC9F0401AE525AA155901C75901C4AC9650D800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000C0000000000000000000000000000000000000000000000000000000000000004443AEEEB2000000000000000000000000FF00000000000000000000000000000000023319000000000000000000000000000000000000000000000000000000000000000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084F654B137000000000000000000000000FF000000000000000000000000000000000233190000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003E800000000000000000000000000000000000000000000000000000000"
}
]
29 changes: 29 additions & 0 deletions tests_zemu/tests/standard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,4 +617,33 @@ describe('Standard', function () {
await sim.close();
}
});

// https://github.com/Zondax/ledger-filecoin/issues/166
test.concurrent.each(models)('Issue #166', async function (m) {
const sim = new Zemu(m.path);
try {
await sim.start({...defaultOptions, model: m.name,});
const app = new FilecoinApp(sim.getTransport());

const txBlob = Buffer.from(
"8A005502972DE5CB57E5208A9FEF1887B39B2BE0EBDA5FEE5501539A38D7116E30F44985EFF6E99A2D5FBADF951901401A044A58AB44000189DD44000185BF025901E88456040ADC451DCFCE6429224C835B09E60FFAD5EBBBC9F0401AE525AA155901C75901C4AC9650D800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000C0000000000000000000000000000000000000000000000000000000000000004443AEEEB2000000000000000000000000FF00000000000000000000000000000000023319000000000000000000000000000000000000000000000000000000000000000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084F654B137000000000000000000000000FF000000000000000000000000000000000233190000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003E800000000000000000000000000000000000000000000000000000000",
"hex",
);

// do not wait here..
const [resp] = await Promise.all([
app.sign(PATH, txBlob),
async () => {
await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot());
await sim.compareSnapshotsAndApprove(".", `${m.prefix.toLowerCase()}-issue-166`)
}
]);

console.log(resp)
expect(resp.return_code).toEqual(0x9000);
expect(resp.error_message).toEqual("No errors");
} finally {
await sim.close();
}
});
})

0 comments on commit e19c914

Please sign in to comment.