Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ncitron committed Jan 11, 2024
1 parent bb85a83 commit cd31c63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/derive/stages/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Iterator for Attributes {
fn next(&mut self) -> Option<Self::Item> {
self.block_input_iter
.next()
.map(|input| input.as_full_epoch(&self.state).unwrap())
.map(|input| input.with_full_epoch(&self.state).unwrap())
.map(|batch| self.derive_attributes(batch))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/derive/stages/block_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct BlockInput<E: EpochType> {
}

impl BlockInput<u64> {
pub fn as_full_epoch(self, state: &Arc<RwLock<State>>) -> Result<BlockInput<Epoch>> {
pub fn with_full_epoch(self, state: &Arc<RwLock<State>>) -> Result<BlockInput<Epoch>> {
let state = state.read().map_err(|_| eyre::eyre!("lock poisoned"))?;
let epoch = state
.epoch_by_number(self.epoch)
Expand Down
9 changes: 2 additions & 7 deletions src/derive/stages/span_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,9 @@ fn decode_transactions(

let legacy_tx_count = tx_datas
.iter()
.filter(|tx| {
if matches!(tx, TxData::Legacy { .. }) {
true
} else {
false
}
})
.filter(|tx| matches!(tx, TxData::Legacy { .. }))
.count() as u64;

let (protected_bits, data) = decode_bitlist(data, legacy_tx_count);

let mut txs = Vec::new();
Expand Down

0 comments on commit cd31c63

Please sign in to comment.