Skip to content

Commit

Permalink
Simplfy iteration through derived transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
intoverflow committed Dec 15, 2023
1 parent 707b89b commit 098d82d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/optimism/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ impl<D: BatcherDb> DeriveMachine<D> {
// The first transaction MUST be a L1 attributes deposited transaction,
// followed by an array of zero-or-more user-deposited transactions.
let l1_attributes_tx = self.derive_l1_attributes_deposited_tx(&op_batch);
let derived_transactions: Vec<_> = once(l1_attributes_tx.to_rlp())
let derived_transactions = once(l1_attributes_tx.to_rlp())
.chain(deposits)
.chain(op_batch.essence.transactions.iter().map(|tx| tx.to_vec()))
.collect();
.enumerate();

let mut tx_trie = MptNode::default();
for (tx_no, tx) in derived_transactions.into_iter().enumerate() {
for (tx_no, tx) in derived_transactions {
let trie_key = tx_no.to_rlp();
tx_trie.insert(&trie_key, tx)?;
}
Expand Down

0 comments on commit 098d82d

Please sign in to comment.