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 15, 2024
1 parent 272bbfb commit 490a9be
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 @@ -116,10 +116,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.clear_previous_proposals().await;

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

/// Clear all the proposals from the previous height.
async fn clear_previous_proposals(&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 490a9be

Please sign in to comment.