Skip to content

Commit

Permalink
fix: avoid empty deployment batches (#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard authored Feb 6, 2025
1 parent e3569f3 commit 2ce9fd7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/clarinet-deployments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,14 @@ pub async fn generate_default_deployment(
let mut batch_count = 0;
for (epoch, epoch_transactions) in transactions {
for txs in epoch_transactions.chunks(tx_chain_limit) {
batches.push(TransactionsBatchSpecification {
id: batch_count,
transactions: txs.to_vec(),
epoch: Some(epoch),
});
batch_count += 1;
if !txs.is_empty() {
batches.push(TransactionsBatchSpecification {
id: batch_count,
transactions: txs.to_vec(),
epoch: Some(epoch),
});
batch_count += 1;
}
}
}

Expand Down

0 comments on commit 2ce9fd7

Please sign in to comment.