Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Brechtpd committed Jun 25, 2024
1 parent 6e38c86 commit 35f1c99
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/src/preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ fn get_transactions_from_block(block: &Block) -> RaikoResult<Vec<TxEnvelope>> {
match &block.transactions {
BlockTransactions::Full(txs) => {
for tx in txs {
transactions.push(from_block_tx(tx)?);
transactions.push(TxEnvelope::try_from(tx.clone()).unwrap());
}
},
_ => unreachable!("Block is too old, please connect to an archive node or use a block that is at most 128 blocks old."),
Expand All @@ -600,10 +600,6 @@ fn get_transactions_from_block(block: &Block) -> RaikoResult<Vec<TxEnvelope>> {
Ok(transactions)
}

fn from_block_tx(tx: &AlloyRpcTransaction) -> RaikoResult<TxEnvelope> {
Ok(TxEnvelope::try_from(tx.clone()).unwrap())
}

#[cfg(test)]
mod test {
use ethers_core::types::Transaction;
Expand Down

0 comments on commit 35f1c99

Please sign in to comment.