feat(testenv): add genesis_hash method

This gets the genesis hash of the env blockchain.
This commit is contained in:
志宇 2024-03-26 20:12:51 +08:00
parent 886d72e3d5
commit 494d253493
No known key found for this signature in database
GPG Key ID: F6345C9837C2BDE8

View File

@ -250,6 +250,12 @@ impl TestEnv {
})) }))
.expect("must craft tip") .expect("must craft tip")
} }
/// Get the genesis hash of the blockchain.
pub fn genesis_hash(&self) -> anyhow::Result<BlockHash> {
let hash = self.bitcoind.client.get_block_hash(0)?;
Ok(hash)
}
} }
#[cfg(test)] #[cfg(test)]