Add MAX and MIN tx types
This commit is contained in:
@@ -265,9 +265,13 @@ static parserStatus_e processTxInternal(txContext_t *context) {
|
||||
}
|
||||
// EIP 2718: TransactionType might be present before the TransactionPayload.
|
||||
if (*context->workBuffer > 0x00 && *context->workBuffer < 0x7f) {
|
||||
PRINTF("TX TYPE: %u\n", context->txType);
|
||||
if (*context->workBuffer < MIN_TX_TYPE || *context->workBuffer > MAX_TX_TYPE ) {
|
||||
PRINTF("Transaction type not supported\n");
|
||||
return USTREAM_FAULT;
|
||||
}
|
||||
context->txType = *context->workBuffer;
|
||||
context->workBuffer++;
|
||||
PRINTF("TX TYPE: %u\n", context->txType);
|
||||
}
|
||||
if (!context->processingField) {
|
||||
PRINTF("PROCESSING FIELD\n");
|
||||
|
||||
@@ -55,8 +55,10 @@ typedef enum rlpTxField_e {
|
||||
|
||||
// EIP 2718 TransactionType
|
||||
typedef enum txType_e {
|
||||
LegacyTransaction = 1,
|
||||
BerlinTransaction = 2
|
||||
MIN_TX_TYPE,
|
||||
LEGACY_TX,
|
||||
BERLIN_TX,
|
||||
MAX_TX_TYPE,
|
||||
} txType_e;
|
||||
|
||||
typedef enum parserStatus_e {
|
||||
|
||||
Reference in New Issue
Block a user