From 494d253493f1bc914adba16a28ccf1bc0a0f4ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Tue, 26 Mar 2024 20:12:51 +0800 Subject: [PATCH] feat(testenv): add `genesis_hash` method This gets the genesis hash of the env blockchain. --- crates/testenv/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/testenv/src/lib.rs b/crates/testenv/src/lib.rs index b0147d0fc..2edd06eb2 100644 --- a/crates/testenv/src/lib.rs +++ b/crates/testenv/src/lib.rs @@ -250,6 +250,12 @@ impl TestEnv { })) .expect("must craft tip") } + + /// Get the genesis hash of the blockchain. + pub fn genesis_hash(&self) -> anyhow::Result { + let hash = self.bitcoind.client.get_block_hash(0)?; + Ok(hash) + } } #[cfg(test)]