From: 志宇 Date: Tue, 26 Mar 2024 12:12:51 +0000 (+0800) Subject: feat(testenv): add `genesis_hash` method X-Git-Tag: v1.0.0-alpha.10~4^2~9 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/ffi/struct.Keypair.html?a=commitdiff_plain;h=494d253493f1bc914adba16a28ccf1bc0a0f4ec8;p=bdk feat(testenv): add `genesis_hash` method This gets the genesis hash of the env blockchain. --- diff --git a/crates/testenv/src/lib.rs b/crates/testenv/src/lib.rs index b0147d0f..2edd06eb 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)]