Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions txindex_common/src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use bitcoin::hashes::Hash;
pub use bitcoin::network::Network as BNetwork;
use serde::Serialize;

Expand Down Expand Up @@ -83,23 +82,6 @@ impl Network {


pub fn genesis_hash(network: Network) -> BlockHash {
return bitcoin_genesis_hash(network.into());
bitcoin::blockdata::constants::genesis_block(BNetwork::from(network))
.block_hash()
}

pub fn bitcoin_genesis_hash(network: BNetwork) -> bitcoin::BlockHash {
match network {
BNetwork::Bitcoin => BlockHash::from_byte_array(hex_literal::hex!(
"9156352c1818b32e90c9e792efd6a11a82fe7956a630f03bbee236cedae3911a"
)),
BNetwork::Testnet => BlockHash::from_byte_array(hex_literal::hex!(
"9e555073d0c4f36456db8951f449704d544d2826d9aa60636b40374626780abb"
)),
BNetwork::Regtest => BlockHash::from_byte_array(hex_literal::hex!(
"a573e91c1772076c0d40f70e4408c83a31705f296ae6e7629d4adcb5a360213d"
)),
BNetwork::Signet => BlockHash::from_byte_array(hex_literal::hex!(
"1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"
)),
_ => panic!("unknown network {:?}", network),
}
}