Skip to content

Commit

Permalink
Default Bitcoin generate retries handling (#53)
Browse files Browse the repository at this point in the history
* Default generate retries

* Apply changes
  • Loading branch information
jfldde authored Nov 20, 2024
1 parent b3b2a1a commit 5baaef3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<bitcoin::BlockHash>> {
RpcApi::generate(self, block_num, None).await
}
}

#[async_trait]
Expand Down
2 changes: 1 addition & 1 deletion src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
2 changes: 1 addition & 1 deletion tests/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion tests/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5baaef3

Please sign in to comment.