Add support for EIP2718 (enveloppe) and EIP2930 (acess list tx); Display chain ID when different from 1 (ethereum mainnet)

This commit is contained in:
pscott
2021-04-21 16:56:17 +02:00
parent 5dd99c3d48
commit 970f0355dd
14 changed files with 419 additions and 146 deletions

View File

@@ -44,10 +44,8 @@ void handleSign(uint8_t p1,
// EIP 2718: TransactionType might be present before the TransactionPayload.
uint8_t txType = *workBuffer;
if (txType >= MIN_TX_TYPE && txType <= MAX_TX_TYPE) {
PRINTF("Transaction type: %u\n", txType);
// Enumerate through all supported txTypes here...
if (txType == LEGACY_TX) {
if (txType == EIP2930) {
txContext.txType = txType;
workBuffer++;
dataLength--;
@@ -55,6 +53,8 @@ void handleSign(uint8_t p1,
PRINTF("Transaction type not supported\n");
THROW(0x6501);
}
} else {
txContext.txType = LEGACY;
}
initTx(&txContext, &global_sha3, &tmpContent.txContent, customProcessor, NULL);
} else if (p1 != P1_MORE) {
@@ -67,7 +67,7 @@ void handleSign(uint8_t p1,
PRINTF("Signature not initialized\n");
THROW(0x6985);
}
if (txContext.currentField == TX_RLP_NONE) {
if (txContext.currentField == RLP_NONE) {
PRINTF("Parser not initialized\n");
THROW(0x6985);
}