Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from semiotic-ai/joseph/tru-269-move-flat-file…
Browse files Browse the repository at this point in the history
…s-decoder-protobuffer-tx-to-reth-tx-conversion

refactor: use sf-protos type conversions
  • Loading branch information
suchapalaver authored Aug 22, 2024
2 parents 6bbf462 + a46d148 commit 42c5b10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 1 addition & 22 deletions src/transactions/tx_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,7 @@ pub enum TransactionTypeError {
Missing,
}

fn tx_to_reth_tx(tx_type: Type) -> TxType {
use TxType::*;
use Type::*;

match tx_type {
TrxTypeLegacy => Legacy,
TrxTypeAccessList => Eip2930,
TrxTypeDynamicFee => Eip1559,
TrxTypeBlob => todo!(),
TrxTypeArbitrumDeposit => unimplemented!(),
TrxTypeArbitrumUnsigned => unimplemented!(),
TrxTypeArbitrumContract => unimplemented!(),
TrxTypeArbitrumRetry => unimplemented!(),
TrxTypeArbitrumSubmitRetryable => unimplemented!(),
TrxTypeArbitrumInternal => unimplemented!(),
TrxTypeArbitrumLegacy => unimplemented!(),
TrxTypeOptimismDeposit => unimplemented!(),
}
}

pub fn map_tx_type(tx_type: &i32) -> Result<TxType, TransactionTypeError> {
let tx_type = Type::try_from(*tx_type).map_err(|_| TransactionTypeError::Missing)?; // 1
let tx_type = tx_to_reth_tx(tx_type);
Ok(tx_type)
Ok(TxType::from(tx_type))
}

0 comments on commit 42c5b10

Please sign in to comment.