Skip to content

Commit

Permalink
feat: increase params buffer size (#167)
Browse files Browse the repository at this point in the history
* chore: add test cases to cover reported issue #166

* feat: increase str buf len

* chore: set deps correctly

* feat: update snapshots, skip nano s
  • Loading branch information
emmanuelm41 authored Oct 24, 2024
1 parent f36a8d3 commit da2bd06
Show file tree
Hide file tree
Showing 85 changed files with 39 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/fil_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ extern "C" {

#define MAX_PREFIX_LEN 40

#if defined(TARGET_NANOS)
#define STR_BUF_LEN 200
#else
#define STR_BUF_LEN 1256
#endif

// special CBOR type that holds
// a CID, bellow the custom tag for this type
#define TAG_CID 42
Expand Down
8 changes: 7 additions & 1 deletion app/src/parser_txdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ extern "C" {
#include "rlp.h"

#define MAX_SUPPORT_METHOD UINT64_MAX
#define MAX_PARAMS_BUFFER_SIZE 200

#if defined(TARGET_NANOS)
#define MAX_PARAMS_BUFFER_SIZE 200
#else
#define MAX_PARAMS_BUFFER_SIZE 1256
#endif

#define ETH_ADDRESS_LEN 20
#define MAX_CHAIN_LEN UINT64_MAX

Expand Down
Binary file added tests_zemu/snapshots/fl-issue-166/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/fl-issue-166/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests_zemu/snapshots/sp-issue-166/00013.png
Binary file added tests_zemu/snapshots/sp-issue-166/00014.png
Binary file added tests_zemu/snapshots/sp-issue-166/00015.png
Binary file added tests_zemu/snapshots/sp-issue-166/00016.png
Binary file added tests_zemu/snapshots/sp-issue-166/00017.png
Binary file added tests_zemu/snapshots/sp-issue-166/00018.png
Binary file added tests_zemu/snapshots/sp-issue-166/00019.png
Binary file added tests_zemu/snapshots/sp-issue-166/00020.png
Binary file added tests_zemu/snapshots/sp-issue-166/00021.png
Binary file added tests_zemu/snapshots/sp-issue-166/00022.png
Binary file added tests_zemu/snapshots/sp-issue-166/00023.png
Binary file added tests_zemu/snapshots/sp-issue-166/00024.png
Binary file added tests_zemu/snapshots/sp-issue-166/00025.png
Binary file added tests_zemu/snapshots/sp-issue-166/00026.png
Binary file added tests_zemu/snapshots/sp-issue-166/00027.png
Binary file added tests_zemu/snapshots/sp-issue-166/00028.png
Binary file added tests_zemu/snapshots/st-issue-166/00000.png
Binary file added tests_zemu/snapshots/st-issue-166/00001.png
Binary file added tests_zemu/snapshots/st-issue-166/00002.png
Binary file added tests_zemu/snapshots/st-issue-166/00003.png
Binary file added tests_zemu/snapshots/st-issue-166/00004.png
Binary file added tests_zemu/snapshots/st-issue-166/00005.png
Binary file added tests_zemu/snapshots/st-issue-166/00006.png
Binary file added tests_zemu/snapshots/st-issue-166/00007.png
Binary file added tests_zemu/snapshots/st-issue-166/00008.png
Binary file added tests_zemu/snapshots/st-issue-166/00009.png
Binary file added tests_zemu/snapshots/st-issue-166/00010.png
Binary file added tests_zemu/snapshots/st-issue-166/00011.png
Binary file added tests_zemu/snapshots/x-issue-166/00000.png
Binary file added tests_zemu/snapshots/x-issue-166/00001.png
Binary file added tests_zemu/snapshots/x-issue-166/00002.png
Binary file added tests_zemu/snapshots/x-issue-166/00003.png
Binary file added tests_zemu/snapshots/x-issue-166/00004.png
Binary file added tests_zemu/snapshots/x-issue-166/00005.png
Binary file added tests_zemu/snapshots/x-issue-166/00006.png
Binary file added tests_zemu/snapshots/x-issue-166/00007.png
Binary file added tests_zemu/snapshots/x-issue-166/00008.png
Binary file added tests_zemu/snapshots/x-issue-166/00009.png
Binary file added tests_zemu/snapshots/x-issue-166/00010.png
Binary file added tests_zemu/snapshots/x-issue-166/00011.png
Binary file added tests_zemu/snapshots/x-issue-166/00012.png
Binary file added tests_zemu/snapshots/x-issue-166/00013.png
Binary file added tests_zemu/snapshots/x-issue-166/00014.png
Binary file added tests_zemu/snapshots/x-issue-166/00015.png
Binary file added tests_zemu/snapshots/x-issue-166/00016.png
Binary file added tests_zemu/snapshots/x-issue-166/00017.png
Binary file added tests_zemu/snapshots/x-issue-166/00018.png
Binary file added tests_zemu/snapshots/x-issue-166/00019.png
Binary file added tests_zemu/snapshots/x-issue-166/00020.png
Binary file added tests_zemu/snapshots/x-issue-166/00021.png
Binary file added tests_zemu/snapshots/x-issue-166/00022.png
Binary file added tests_zemu/snapshots/x-issue-166/00023.png
Binary file added tests_zemu/snapshots/x-issue-166/00024.png
Binary file added tests_zemu/snapshots/x-issue-166/00025.png
Binary file added tests_zemu/snapshots/x-issue-166/00026.png
Binary file added tests_zemu/snapshots/x-issue-166/00027.png
Binary file added tests_zemu/snapshots/x-issue-166/00028.png
27 changes: 27 additions & 0 deletions tests_zemu/tests/standard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,4 +617,31 @@ describe('Standard', function () {
await sim.close();
}
});

// https://github.com/Zondax/ledger-filecoin/issues/166
test.concurrent.each(models.filter(m => m.name != "nanos"))('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 signatureRequest = app.sign(PATH, txBlob);
// // Wait until we are not in the main menu
await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot());
await sim.compareSnapshotsAndApprove(".", `${m.prefix.toLowerCase()}-issue-166`)

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

0 comments on commit da2bd06

Please sign in to comment.