Copies Regtest genesis block from zcashd

This commit is contained in:
Arya 2024-04-19 15:36:44 -04:00
parent a8b4e278b7
commit 97b43cb8ff
3 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,7 @@ mod header;
mod height;
mod serialize;
pub mod genesis;
pub mod merkle;
#[cfg(any(test, feature = "proptest-impl"))]

View File

@ -0,0 +1,16 @@
//! Regtest genesis block
use hex::FromHex;
use crate::{block::Block, serialization::ZcashDeserializeInto};
/// Genesis block for Regtest, copied from zcashd via `getblock 0 0` RPC method
pub fn regtest_genesis_block() -> Block {
let regtest_genesis_block_bytes =
<Vec<u8>>::from_hex(include_str!("genesis/block-regtest-0-000-000.txt").trim())
.expect("Block bytes are in valid hex representation");
regtest_genesis_block_bytes
.zcash_deserialize_into()
.expect("hard-coded Regtest genesis block data must deserialize successfully")
}

View File

@ -0,0 +1 @@
040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac40000000000000000000000000000000000000000000000000000000000000000dae5494d0f0f0f2009000000000000000000000000000000000000000000000000000000000000002401936b7db1eb4ac39f151b8704642d0a8bda13ec547d54cd5e43ba142fc6d8877cab07b30101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000