feat(testenv): add genesis_hash method

This gets the genesis hash of the env blockchain.
This commit is contained in:
志宇 committed 2024-04-16 18:01:51 +08:00
1 parent 886d72e3d5
commit 494d253493
1 file changed
+6
+6
View File
@@ -250,6 +250,12 @@ impl TestEnv {
}))
.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)]