From 2ce9fd74e25603884e506443f09d1329f8c618c4 Mon Sep 17 00:00:00 2001 From: Hugo C <911307+hugocaillard@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:06:12 +0100 Subject: [PATCH] fix: avoid empty deployment batches (#1665) --- components/clarinet-deployments/src/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/clarinet-deployments/src/lib.rs b/components/clarinet-deployments/src/lib.rs index 6ccbcacb3..7127048cb 100644 --- a/components/clarinet-deployments/src/lib.rs +++ b/components/clarinet-deployments/src/lib.rs @@ -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; + } } }