From 4a650050325a8c5d2b02fb5c1f6c3ec55e7fbe7d Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:30:37 +0000 Subject: [PATCH 1/2] Default generate retries --- src/bitcoin.rs | 7 +++++++ src/framework.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bitcoin.rs b/src/bitcoin.rs index 0110606..378244c 100644 --- a/src/bitcoin.rs +++ b/src/bitcoin.rs @@ -158,6 +158,13 @@ impl BitcoinNode { .context("Failed to spawn bitcoind process") .map(SpawnOutput::Child) } + + pub async fn generate( + &self, + block_num: u64, + ) -> bitcoincore_rpc::Result> { + RpcApi::generate(self, block_num, None).await + } } #[async_trait] diff --git a/src/framework.rs b/src/framework.rs index 8eec3c3..948eb77 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -261,7 +261,7 @@ impl TestFramework { da.fund_wallet(NodeKind::Bitcoin.to_string(), blocks_to_fund) .await?; - da.generate(blocks_to_mature, None).await?; + da.generate(blocks_to_mature).await?; self.initial_da_height = da.get_block_count().await?; Ok(()) } From 7bb9f207bb17fbcb0e95d73f5ef074361e9dc5ae Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:50:59 +0000 Subject: [PATCH 2/2] Apply changes --- tests/bitcoin.rs | 2 +- tests/docker.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bitcoin.rs b/tests/bitcoin.rs index e21f176..424fbf6 100644 --- a/tests/bitcoin.rs +++ b/tests/bitcoin.rs @@ -44,7 +44,7 @@ impl TestCase for BasicSyncTest { f.bitcoin_nodes.disconnect_nodes().await?; // Generate some blocks on node0 - da0.generate(5, None).await?; + da0.generate(5).await?; let height0 = da0.get_block_count().await?; let height1 = da1.get_block_count().await?; diff --git a/tests/docker.rs b/tests/docker.rs index c97b187..7380d59 100644 --- a/tests/docker.rs +++ b/tests/docker.rs @@ -40,7 +40,7 @@ impl TestCase for DockerIntegrationTest { // Wait for blob inscribe tx to be in mempool da.wait_mempool_len(1, None).await?; - da.generate(FINALITY_DEPTH, None).await?; + da.generate(FINALITY_DEPTH).await?; let finalized_height = da.get_finalized_height().await?; batch_prover