Skip to content

Commit 86a164a

Browse files
committed
Merge branch 'main' into add-k256-seq-pub-key
2 parents e22b1e7 + 56abf56 commit 86a164a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/bitcoin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use super::{
2424
};
2525
use crate::{log_provider::LogPathProvider, node::NodeKind};
2626

27-
pub const FINALITY_DEPTH: u64 = 30;
27+
pub const DEFAULT_FINALITY_DEPTH: u64 = 5;
2828

2929
pub struct BitcoinNode {
3030
spawn_output: SpawnOutput,
@@ -98,8 +98,8 @@ impl BitcoinNode {
9898
Ok(())
9999
}
100100

101-
pub async fn get_finalized_height(&self) -> Result<u64> {
102-
Ok(self.get_block_count().await? - FINALITY_DEPTH + 1)
101+
pub async fn get_finalized_height(&self, finality_depth: Option<u64>) -> Result<u64> {
102+
Ok(self.get_block_count().await? - finality_depth.unwrap_or(DEFAULT_FINALITY_DEPTH) + 1)
103103
}
104104

105105
async fn wait_for_shutdown(&self) -> Result<()> {

tests/docker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use async_trait::async_trait;
22
use bitcoincore_rpc::RpcApi;
33
use citrea_e2e::{
4-
bitcoin::FINALITY_DEPTH,
4+
bitcoin::DEFAULT_FINALITY_DEPTH,
55
config::{TestCaseConfig, TestCaseDockerConfig},
66
framework::TestFramework,
77
test_case::{TestCase, TestCaseRunner},
@@ -40,8 +40,8 @@ impl TestCase for DockerIntegrationTest {
4040
// Wait for blob inscribe tx to be in mempool
4141
da.wait_mempool_len(1, None).await?;
4242

43-
da.generate(FINALITY_DEPTH).await?;
44-
let finalized_height = da.get_finalized_height().await?;
43+
da.generate(DEFAULT_FINALITY_DEPTH).await?;
44+
let finalized_height = da.get_finalized_height(None).await?;
4545

4646
batch_prover
4747
.wait_for_l1_height(finalized_height, None)

0 commit comments

Comments
 (0)