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
  • Loading branch information
ArniStarkware committed Dec 16, 2024
1 parent 8fbf802 commit 1f2e9c0
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 1f2e9c0

Please sign in to comment.