Skip to content

Remove sign data cap #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ file(GLOB_RECURSE LIB_SRC
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_impl.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_impl_eth.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_data_cap.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_client_deal.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/fil_utils.c
${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_raw_bytes.c
Expand Down
4 changes: 2 additions & 2 deletions app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the major version of this release
APPVERSION_M=1
APPVERSION_M=2
# This is the minor version of this release
APPVERSION_N=0
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=0
10 changes: 0 additions & 10 deletions app/src/apdu_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,6 @@ handleSign(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx)
tx_context_fil();
break;

case INS_SIGN_DATACAP:
ZEMU_LOGF(50, "HandleSignDatacap\n")
tx_context_datacap();
break;

case INS_CLIENT_DEAL:
ZEMU_LOGF(50, "HandleSignClientDeal\n")
tx_context_client_deal();
Expand Down Expand Up @@ -542,11 +537,6 @@ handleApdu(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx)
handleSign(flags, tx, rx);
break;
}
case INS_SIGN_DATACAP: {
CHECK_PIN_VALIDATED()
handleSign(flags, tx, rx);
break;
}
case INS_CLIENT_DEAL: {
CHECK_PIN_VALIDATED()
handleSign(flags, tx, rx);
Expand Down
1 change: 0 additions & 1 deletion app/src/coin.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ typedef enum {
#define INS_GET_ADDR_SECP256K1 0x01
#define INS_SIGN_SECP256K1 0x02
#define INS_SIGN_ETH 0x04
#define INS_SIGN_DATACAP 0x05
#define INS_CLIENT_DEAL 0x06
#define INS_SIGN_RAW_BYTES 0x07
#define INS_GET_ADDR_ETH 0x02
Expand Down
3 changes: 0 additions & 3 deletions app/src/common/parser_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ typedef enum {
parser_invalid_rlp_data,
parser_invalid_chain_id,
parser_invalid_rs_values,
parser_invalid_datacap_tx,
parser_invalid_cid,
parser_invalid_deal_duration,
parser_invalid_prefix,
parser_invalid_datacap_prefix,
// Customs
parser_expert_mode_required,
} parser_error_t;
Expand All @@ -82,7 +80,6 @@ typedef enum {
typedef enum {
fil_tx = 0,
eth_tx,
datacap_tx,
clientdeal_tx,
raw_bytes,
} tx_type_t;
Expand Down
4 changes: 0 additions & 4 deletions app/src/common/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ void tx_context_eth() {
ctx_parsed_tx.tx_type = eth_tx;
}

void tx_context_datacap() {
ctx_parsed_tx.tx_type = datacap_tx;
}

void tx_context_client_deal() {
ctx_parsed_tx.tx_type = clientdeal_tx;
}
Expand Down
1 change: 0 additions & 1 deletion app/src/common/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// transaction initializer for the buffer and transaction type.
void tx_context_fil();
void tx_context_eth();
void tx_context_datacap();
void tx_context_client_deal();
void tx_context_raw_bytes();

Expand Down
17 changes: 0 additions & 17 deletions app/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "common/parser_common.h"
#include "fil_utils.h"
#include "parser_client_deal.h"
#include "parser_data_cap.h"
#include "parser_impl.h"
#include "parser_impl_eth.h"
#include "parser_raw_bytes.h"
Expand Down Expand Up @@ -85,10 +84,6 @@ parser_error_t parser_parse(parser_context_t *ctx, const uint8_t *data,
CHECK_PARSER_ERR(parser_init(ctx, data, dataLen))
return _readEth(ctx, &eth_tx_obj);
}
case datacap_tx: {
CHECK_PARSER_ERR(parser_init(ctx, data, dataLen))
return _readDataCap(ctx, &parser_tx_obj.rem_datacap_tx);
}
case clientdeal_tx: {
CHECK_PARSER_ERR(parser_init(ctx, data, dataLen))
return _readClientDeal(ctx, &parser_tx_obj.client_deal_tx);
Expand Down Expand Up @@ -118,10 +113,6 @@ parser_error_t parser_validate(const parser_context_t *ctx) {
CHECK_PARSER_ERR(_validateTxEth())
break;
}
case datacap_tx: {
CHECK_PARSER_ERR(_validateDataCap(ctx))
break;
}
case clientdeal_tx: {
CHECK_PARSER_ERR(_validateClientDeal(ctx))
break;
Expand Down Expand Up @@ -161,10 +152,6 @@ parser_error_t parser_getNumItems(const parser_context_t *ctx,
CHECK_PARSER_ERR(_getNumItemsEth(num_items));
break;
}
case datacap_tx: {
*num_items = _getNumItemsDataCap(ctx);
break;
}
case clientdeal_tx: {
*num_items = _getNumItemsClientDeal(ctx);
break;
Expand Down Expand Up @@ -375,10 +362,6 @@ parser_error_t parser_getItem(const parser_context_t *ctx, uint8_t displayIdx,
return _getItemEth(ctx, displayIdx, outKey, outKeyLen, outVal, outValLen,
pageIdx, pageCount);
}
case datacap_tx: {
return _getItemDataCap(ctx, displayIdx, outKey, outKeyLen, outVal,
outValLen, pageIdx, pageCount);
}
case clientdeal_tx: {
return _getItemClientDeal(ctx, displayIdx, outKey, outKeyLen, outVal,
outValLen, pageIdx, pageCount);
Expand Down
190 changes: 0 additions & 190 deletions app/src/parser_data_cap.c

This file was deleted.

41 changes: 0 additions & 41 deletions app/src/parser_data_cap.h

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/parser_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,12 @@ const char *parser_getErrorDescription(parser_error_t err) {
return "Invalid eth chainId";
case parser_invalid_rs_values:
return "Invalid rs values";
case parser_invalid_datacap_tx:
return "Invalid remove allowance tx";
case parser_invalid_cid:
return "Invalid CID";
case parser_invalid_deal_duration:
return "Client deal duration must be >= 518400";
case parser_invalid_prefix:
return "Invalid raw-bytes prefix";
case parser_invalid_datacap_prefix:
return "Invalid datacap prefix";
case parser_expert_mode_required:
return "ExpertModeRequired";
default:
Expand Down
Loading
Loading