Revert "ethereum: add EthereumSignTx.prefix"

This reverts commit 2866e6fe88.
This commit is contained in:
Pavol Rusnak 2017-04-30 03:26:57 +02:00
parent aafd61ec8b
commit 13f03d3880
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
5 changed files with 6 additions and 24 deletions

View File

@ -438,8 +438,6 @@ void ethereum_signing_init(EthereumSignTx *msg, const HDNode *node)
msg->to.size = 0;
if (!msg->has_nonce)
msg->nonce.size = 0;
if (!msg->has_prefix)
msg->prefix.size = 0;
/* eip-155 chain id */
if (msg->has_chain_id) {
@ -514,9 +512,6 @@ void ethereum_signing_init(EthereumSignTx *msg, const HDNode *node)
layoutProgress("Signing", 0);
if (msg->has_prefix) {
rlp_length += rlp_calculate_length(msg->prefix.size, msg->prefix.bytes[0]);
}
rlp_length += rlp_calculate_length(msg->nonce.size, msg->nonce.bytes[0]);
rlp_length += rlp_calculate_length(msg->gas_price.size, msg->gas_price.bytes[0]);
rlp_length += rlp_calculate_length(msg->gas_limit.size, msg->gas_limit.bytes[0]);
@ -534,9 +529,6 @@ void ethereum_signing_init(EthereumSignTx *msg, const HDNode *node)
layoutProgress("Signing", 100);
if (msg->has_prefix) {
hash_rlp_field(msg->prefix.bytes, msg->prefix.size);
}
hash_rlp_field(msg->nonce.bytes, msg->nonce.size);
hash_rlp_field(msg->gas_price.bytes, msg->gas_price.size);
hash_rlp_field(msg->gas_limit.bytes, msg->gas_limit.size);

View File

@ -100,7 +100,6 @@ EthereumSignTx.gas_limit max_size:32
EthereumSignTx.to max_size:20
EthereumSignTx.value max_size:32
EthereumSignTx.data_initial_chunk max_size:1024
EthereumSignTx.prefix max_size:32
EthereumTxRequest.signature_r max_size:32
EthereumTxRequest.signature_s max_size:32

View File

@ -325,7 +325,7 @@ const pb_field_t TxAck_fields[2] = {
PB_LAST_FIELD
};
const pb_field_t EthereumSignTx_fields[11] = {
const pb_field_t EthereumSignTx_fields[10] = {
PB_FIELD2( 1, UINT32 , REPEATED, STATIC , FIRST, EthereumSignTx, address_n, address_n, 0),
PB_FIELD2( 2, BYTES , OPTIONAL, STATIC , OTHER, EthereumSignTx, nonce, address_n, 0),
PB_FIELD2( 3, BYTES , OPTIONAL, STATIC , OTHER, EthereumSignTx, gas_price, nonce, 0),
@ -335,7 +335,6 @@ const pb_field_t EthereumSignTx_fields[11] = {
PB_FIELD2( 7, BYTES , OPTIONAL, STATIC , OTHER, EthereumSignTx, data_initial_chunk, value, 0),
PB_FIELD2( 8, UINT32 , OPTIONAL, STATIC , OTHER, EthereumSignTx, data_length, data_initial_chunk, 0),
PB_FIELD2( 9, UINT32 , OPTIONAL, STATIC , OTHER, EthereumSignTx, chain_id, data_length, 0),
PB_FIELD2( 10, BYTES , OPTIONAL, STATIC , OTHER, EthereumSignTx, prefix, chain_id, 0),
PB_LAST_FIELD
};

View File

@ -444,11 +444,6 @@ typedef struct {
uint8_t bytes[1024];
} EthereumSignTx_data_initial_chunk_t;
typedef struct {
size_t size;
uint8_t bytes[32];
} EthereumSignTx_prefix_t;
typedef struct _EthereumSignTx {
size_t address_n_count;
uint32_t address_n[8];
@ -468,8 +463,6 @@ typedef struct _EthereumSignTx {
uint32_t data_length;
bool has_chain_id;
uint32_t chain_id;
bool has_prefix;
EthereumSignTx_prefix_t prefix;
} EthereumSignTx;
typedef struct {
@ -879,7 +872,7 @@ extern const uint32_t SignTx_lock_time_default;
#define SignTx_init_default {0, 0, false, "Bitcoin", false, 1u, false, 0u}
#define TxRequest_init_default {false, (RequestType)0, false, TxRequestDetailsType_init_default, false, TxRequestSerializedType_init_default}
#define TxAck_init_default {false, TransactionType_init_default}
#define EthereumSignTx_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, {0, {0}}}
#define EthereumSignTx_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0}
#define EthereumTxRequest_init_default {false, 0, false, 0, false, {0, {0}}, false, {0, {0}}}
#define EthereumTxAck_init_default {false, {0, {0}}}
#define SignIdentity_init_default {false, IdentityType_init_default, false, {0, {0}}, false, "", false, ""}
@ -943,7 +936,7 @@ extern const uint32_t SignTx_lock_time_default;
#define SignTx_init_zero {0, 0, false, "", false, 0, false, 0}
#define TxRequest_init_zero {false, (RequestType)0, false, TxRequestDetailsType_init_zero, false, TxRequestSerializedType_init_zero}
#define TxAck_init_zero {false, TransactionType_init_zero}
#define EthereumSignTx_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, {0, {0}}}
#define EthereumSignTx_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0}
#define EthereumTxRequest_init_zero {false, 0, false, 0, false, {0, {0}}, false, {0, {0}}}
#define EthereumTxAck_init_zero {false, {0, {0}}}
#define SignIdentity_init_zero {false, IdentityType_init_zero, false, {0, {0}}, false, "", false, ""}
@ -1032,7 +1025,6 @@ extern const uint32_t SignTx_lock_time_default;
#define EthereumSignTx_data_initial_chunk_tag 7
#define EthereumSignTx_data_length_tag 8
#define EthereumSignTx_chain_id_tag 9
#define EthereumSignTx_prefix_tag 10
#define EthereumTxAck_data_chunk_tag 1
#define EthereumTxRequest_data_length_tag 1
#define EthereumTxRequest_signature_v_tag 2
@ -1181,7 +1173,7 @@ extern const pb_field_t TxSize_fields[2];
extern const pb_field_t SignTx_fields[6];
extern const pb_field_t TxRequest_fields[4];
extern const pb_field_t TxAck_fields[2];
extern const pb_field_t EthereumSignTx_fields[11];
extern const pb_field_t EthereumSignTx_fields[10];
extern const pb_field_t EthereumTxRequest_fields[5];
extern const pb_field_t EthereumTxAck_fields[2];
extern const pb_field_t SignIdentity_fields[5];
@ -1247,7 +1239,7 @@ extern const pb_field_t DebugLinkFlashErase_fields[2];
#define SignTx_size 43
#define TxRequest_size (18 + TxRequestDetailsType_size + TxRequestSerializedType_size)
#define TxAck_size (6 + TransactionType_size)
#define EthereumSignTx_size 1279
#define EthereumSignTx_size 1245
#define EthereumTxRequest_size 80
#define EthereumTxAck_size 1027
#define SignIdentity_size (558 + IdentityType_size)

@ -1 +1 @@
Subproject commit 2148e5ff8d76444f82f8e4c833157df7de8eaba5
Subproject commit fe6e62c11f7dca8cb601e53c5865f15f770fd079