Skip to content

Commit 494d253

Browse files
committed
feat(testenv): add genesis_hash method
This gets the genesis hash of the env blockchain.
1 parent 886d72e commit 494d253

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/testenv/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ impl TestEnv {
250250
}))
251251
.expect("must craft tip")
252252
}
253+
254+
/// Get the genesis hash of the blockchain.
255+
pub fn genesis_hash(&self) -> anyhow::Result<BlockHash> {
256+
let hash = self.bitcoind.client.get_block_hash(0)?;
257+
Ok(hash)
258+
}
253259
}
254260

255261
#[cfg(test)]

0 commit comments

Comments
 (0)