Skip to content

Commit

Permalink
feat(testenv): add genesis_hash method
Browse files Browse the repository at this point in the history
This gets the genesis hash of the env blockchain.
  • Loading branch information
evanlinjin committed Apr 2, 2024
1 parent 5141d9f commit fbf6313
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/testenv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit fbf6313

Please sign in to comment.