Skip to content

Commit

Permalink
add missing files to cmakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Sep 5, 2024
1 parent 7e916a4 commit b0bc0b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ file(GLOB_RECURSE LIB_SRC
${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/hexutils.c
${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/zxmacros.c
${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/zxformat.c
${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/buffering.c
####
${CMAKE_CURRENT_SOURCE_DIR}/app/src/buffering_json.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/tx.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/items.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/items_format.c
Expand Down
7 changes: 5 additions & 2 deletions app/src/common/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include "zxmacros.h"

#define TEMPLATE_JSON_BUFFER_SIZE 1024
#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX)
#if !defined(TARGET_NANOS)
#define RAM_BUFFER_SIZE 8192
#define FLASH_BUFFER_SIZE 16384 - TEMPLATE_JSON_BUFFER_SIZE
#elif defined(TARGET_NANOS)
#else
#define RAM_BUFFER_SIZE 256
#define FLASH_BUFFER_SIZE 8192 - TEMPLATE_JSON_BUFFER_SIZE
#endif
Expand All @@ -45,6 +45,9 @@ typedef struct {
#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX)
storage_t NV_CONST N_appdata_impl __attribute__((aligned(64)));
#define N_appdata (*(NV_VOLATILE storage_t *)PIC(&N_appdata_impl))
#else
storage_t N_appdata_impl __attribute__((aligned(64)));
#define N_appdata (*(storage_t *)PIC(&N_appdata_impl))
#endif

static parser_context_t ctx_parsed_tx;
Expand Down
2 changes: 1 addition & 1 deletion app/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ parser_error_t parser_parse(parser_context_t *ctx, const uint8_t *data, size_t d
parser_createJsonTemplate(ctx);
ctx->json = &tx_obj_json;
ctx->buffer = tx_json_get_buffer();
ctx->bufferLen = tx_json_get_buffer_length();
ctx->bufferLen = (uint16_t)tx_json_get_buffer_length();

CHECK_ERROR(_read_json_tx(ctx));
}
Expand Down
4 changes: 0 additions & 4 deletions tests_zemu/tests/transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ describe.each(TRANSACTIONS_TEST_CASES)('Tx transfer', function (data) {

const decodedHash = decodeHash(signatureResponse.hash)

console.log('Pubkey: ', pubKey.toString('hex'))
console.log('Signature: ', signatureResponse.signature.toString('hex'))
console.log('Decoded Hash: ', decodedHash.toString('hex'))

// Now verify the signature
const valid = ed25519.verify(signatureResponse.signature, decodedHash, pubKey)
expect(valid).toEqual(true)
Expand Down

0 comments on commit b0bc0b2

Please sign in to comment.