Skip to content

Commit

Permalink
debug: better error codes about parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr committed May 27, 2022
1 parent 096e376 commit eb30f28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/handler/sign_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int handler_sign_tx(buffer_t *cdata, uint8_t chunk, bool more) {
parser_status_e status = transaction_deserialize(&buf, &G_context.tx_info.transaction);
PRINTF("Parsing status: %d.\n", status);
if (status != PARSING_OK) {
return io_send_sw(SW_TX_PARSING_FAIL);
return io_send_sw(SW_TX_PARSING_FAIL + status);
}

// Hash
Expand Down
2 changes: 1 addition & 1 deletion src/sw.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/**
* Status word for fail of transaction parsing.
*/
#define SW_TX_PARSING_FAIL 0xB005
#define SW_TX_PARSING_FAIL 0xB010
/**
* Status word for fail of transaction hash.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define MAX_MEMO_LEN 465 // 510 - ADDRESS_LEN - 2*SIZE(U64) - SIZE(MAX_VARINT)

typedef enum {
PARSING_OK = 1,
PARSING_OK = 0,
SEQ_PARSING_ERROR = -1,
TIMEOUT_PARSING_ERROR = -2,
TO_PARSING_ERROR = -3,
Expand Down

0 comments on commit eb30f28

Please sign in to comment.