Skip to content

Commit

Permalink
refactor(starknet_batcher): create method clear previous proposals fo…
Browse files Browse the repository at this point in the history
…r code dedup (#2670)
  • Loading branch information
ArniStarkware authored Dec 16, 2024
1 parent 8fbf802 commit 0a60f8f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/starknet_batcher/src/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ impl Batcher {
});
}

// Clear all the proposals from the previous height.
self.proposal_manager.reset().await;
self.propose_tx_streams.clear();
self.validate_tx_streams.clear();
self.abort_active_height().await;

info!("Starting to work on height {}.", input.height);
self.active_height = Some(input.height);
Expand Down Expand Up @@ -234,6 +231,13 @@ impl Batcher {
}
}

/// Clear all the proposals from the previous height.
async fn abort_active_height(&mut self) {
self.proposal_manager.reset().await;
self.propose_tx_streams.clear();
self.validate_tx_streams.clear();
}

async fn handle_send_txs_request(
&mut self,
proposal_id: ProposalId,
Expand Down

0 comments on commit 0a60f8f

Please sign in to comment.