#![allow(missing_docs)]
use hex::FromHex;
use lazy_static::lazy_static;
use std::collections::BTreeMap;
trait ReverseCollection {
fn rev(self) -> Self;
}
impl ReverseCollection for [u8; 32] {
fn rev(mut self) -> [u8; 32] {
self.reverse();
self
}
}
lazy_static! {
pub static ref BLOCKS: Vec<&'static [u8]> = MAINNET_BLOCKS
.iter()
.chain(TESTNET_BLOCKS.iter())
.map(|(_height, block)| *block)
.collect();
pub static ref CONTINUOUS_MAINNET_BLOCKS: BTreeMap<u32, &'static [u8]> = MAINNET_BLOCKS
.iter()
.enumerate()
.take_while(|(i, (height, _block))| *i == **height as usize)
.map(|(_i, (height, block))| (*height, *block))
.collect();
pub static ref CONTINUOUS_TESTNET_BLOCKS: BTreeMap<u32, &'static [u8]> = TESTNET_BLOCKS
.iter()
.enumerate()
.take_while(|(i, (height, _block))| *i == **height as usize)
.map(|(_i, (height, block))| (*height, *block))
.collect();
pub static ref MAINNET_BLOCKS: BTreeMap<u32, &'static [u8]> = [
(0, BLOCK_MAINNET_GENESIS_BYTES.as_ref()),
(1, BLOCK_MAINNET_1_BYTES.as_ref()),
(2, BLOCK_MAINNET_2_BYTES.as_ref()),
(3, BLOCK_MAINNET_3_BYTES.as_ref()),
(4, BLOCK_MAINNET_4_BYTES.as_ref()),
(5, BLOCK_MAINNET_5_BYTES.as_ref()),
(6, BLOCK_MAINNET_6_BYTES.as_ref()),
(7, BLOCK_MAINNET_7_BYTES.as_ref()),
(8, BLOCK_MAINNET_8_BYTES.as_ref()),
(9, BLOCK_MAINNET_9_BYTES.as_ref()),
(10, BLOCK_MAINNET_10_BYTES.as_ref()),
(202, BLOCK_MAINNET_202_BYTES.as_ref()),
(396, BLOCK_MAINNET_396_BYTES.as_ref()),
(347_499, BLOCK_MAINNET_347499_BYTES.as_ref()),
(347_500, BLOCK_MAINNET_347500_BYTES.as_ref()),
(347_501, BLOCK_MAINNET_347501_BYTES.as_ref()),
(415_000, BLOCK_MAINNET_415000_BYTES.as_ref()),
(419_199, BLOCK_MAINNET_419199_BYTES.as_ref()),
(419_200, BLOCK_MAINNET_419200_BYTES.as_ref()),
(419_201, BLOCK_MAINNET_419201_BYTES.as_ref()),
(419_202, BLOCK_MAINNET_419202_BYTES.as_ref()),
(434_873, BLOCK_MAINNET_434873_BYTES.as_ref()),
(653_599, BLOCK_MAINNET_653599_BYTES.as_ref()),
(653_600, BLOCK_MAINNET_653600_BYTES.as_ref()),
(653_601, BLOCK_MAINNET_653601_BYTES.as_ref()),
(902_999, BLOCK_MAINNET_902999_BYTES.as_ref()),
(903_000, BLOCK_MAINNET_903000_BYTES.as_ref()),
(903_001, BLOCK_MAINNET_903001_BYTES.as_ref()),
(949_496, BLOCK_MAINNET_949496_BYTES.as_ref()),
(975_066, BLOCK_MAINNET_975066_BYTES.as_ref()),
(982_681, BLOCK_MAINNET_982681_BYTES.as_ref()),
(1_046_399, BLOCK_MAINNET_1046399_BYTES.as_ref()),
(1_046_400, BLOCK_MAINNET_1046400_BYTES.as_ref()),
(1_046_401, BLOCK_MAINNET_1046401_BYTES.as_ref()),
(1_180_900, BLOCK_MAINNET_1180900_BYTES.as_ref()),
].iter().cloned().collect();
pub static ref MAINNET_FINAL_SPROUT_ROOTS: BTreeMap<u32, &'static [u8; 32]> = [
(0, SPROUT_FINAL_ROOT_MAINNET_0_BYTES.as_ref().try_into().unwrap()),
(396, SPROUT_FINAL_ROOT_MAINNET_396_BYTES.as_ref().try_into().unwrap()),
(347_499, SPROUT_FINAL_ROOT_MAINNET_347499_BYTES.as_ref().try_into().unwrap()),
(347_500, SPROUT_FINAL_ROOT_MAINNET_347500_BYTES.as_ref().try_into().unwrap()),
(347_501, SPROUT_FINAL_ROOT_MAINNET_347501_BYTES.as_ref().try_into().unwrap()),
].iter().cloned().collect();
pub static ref MAINNET_FINAL_SAPLING_ROOTS: BTreeMap<u32, &'static [u8; 32]> = [
(419_200, SAPLING_FINAL_ROOT_MAINNET_419200_BYTES.as_ref().try_into().unwrap()),
(419_201, SAPLING_FINAL_ROOT_MAINNET_419201_BYTES.as_ref().try_into().unwrap()),
(419_202, SAPLING_FINAL_ROOT_MAINNET_419202_BYTES.as_ref().try_into().unwrap()),
(434_873, SAPLING_FINAL_ROOT_MAINNET_434873_BYTES.as_ref().try_into().unwrap()),
(653_599, SAPLING_FINAL_ROOT_MAINNET_653599_BYTES.as_ref().try_into().unwrap()),
(653_600, SAPLING_FINAL_ROOT_MAINNET_653600_BYTES.as_ref().try_into().unwrap()),
(653_601, SAPLING_FINAL_ROOT_MAINNET_653601_BYTES.as_ref().try_into().unwrap()),
(902_999, SAPLING_FINAL_ROOT_MAINNET_902999_BYTES.as_ref().try_into().unwrap()),
(903_000, SAPLING_FINAL_ROOT_MAINNET_903000_BYTES.as_ref().try_into().unwrap()),
(903_001, SAPLING_FINAL_ROOT_MAINNET_903001_BYTES.as_ref().try_into().unwrap()),
(949_496, SAPLING_FINAL_ROOT_MAINNET_949496_BYTES.as_ref().try_into().unwrap()),
(975_066, SAPLING_FINAL_ROOT_MAINNET_975066_BYTES.as_ref().try_into().unwrap()),
(982_681, SAPLING_FINAL_ROOT_MAINNET_982681_BYTES.as_ref().try_into().unwrap()),
(1_046_399, SAPLING_FINAL_ROOT_MAINNET_1046399_BYTES.as_ref().try_into().unwrap()),
(1_046_400, SAPLING_FINAL_ROOT_MAINNET_1046400_BYTES.as_ref().try_into().unwrap()),
(1_046_401, SAPLING_FINAL_ROOT_MAINNET_1046401_BYTES.as_ref().try_into().unwrap()),
(1_180_900, SAPLING_FINAL_ROOT_MAINNET_1180900_BYTES.as_ref().try_into().unwrap()),
].iter().cloned().collect();
pub static ref TESTNET_BLOCKS: BTreeMap<u32, &'static [u8]> = [
(0, BLOCK_TESTNET_GENESIS_BYTES.as_ref()),
(1, BLOCK_TESTNET_1_BYTES.as_ref()),
(2, BLOCK_TESTNET_2_BYTES.as_ref()),
(3, BLOCK_TESTNET_3_BYTES.as_ref()),
(4, BLOCK_TESTNET_4_BYTES.as_ref()),
(5, BLOCK_TESTNET_5_BYTES.as_ref()),
(6, BLOCK_TESTNET_6_BYTES.as_ref()),
(7, BLOCK_TESTNET_7_BYTES.as_ref()),
(8, BLOCK_TESTNET_8_BYTES.as_ref()),
(9, BLOCK_TESTNET_9_BYTES.as_ref()),
(10, BLOCK_TESTNET_10_BYTES.as_ref()),
(2_259, BLOCK_TESTNET_2259_BYTES.as_ref()),
(141_042, BLOCK_TESTNET_141042_BYTES.as_ref()),
(207_499, BLOCK_TESTNET_207499_BYTES.as_ref()),
(207_500, BLOCK_TESTNET_207500_BYTES.as_ref()),
(207_501, BLOCK_TESTNET_207501_BYTES.as_ref()),
(279_999, BLOCK_TESTNET_279999_BYTES.as_ref()),
(280_000, BLOCK_TESTNET_280000_BYTES.as_ref()),
(280_001, BLOCK_TESTNET_280001_BYTES.as_ref()),
(299_187, BLOCK_TESTNET_299187_BYTES.as_ref()),
(299_188, BLOCK_TESTNET_299188_BYTES.as_ref()),
(299_189, BLOCK_TESTNET_299189_BYTES.as_ref()),
(299_201, BLOCK_TESTNET_299201_BYTES.as_ref()),
(299_202, BLOCK_TESTNET_299202_BYTES.as_ref()),
(583_999, BLOCK_TESTNET_583999_BYTES.as_ref()),
(584_000, BLOCK_TESTNET_584000_BYTES.as_ref()),
(584_001, BLOCK_TESTNET_584001_BYTES.as_ref()),
(903_799, BLOCK_TESTNET_903799_BYTES.as_ref()),
(903_800, BLOCK_TESTNET_903800_BYTES.as_ref()),
(903_801, BLOCK_TESTNET_903801_BYTES.as_ref()),
(914_678, BLOCK_TESTNET_914678_BYTES.as_ref()),
(925_483, BLOCK_TESTNET_925483_BYTES.as_ref()),
(1_028_499, BLOCK_TESTNET_1028499_BYTES.as_ref()),
(1_028_500, BLOCK_TESTNET_1028500_BYTES.as_ref()),
(1_028_501, BLOCK_TESTNET_1028501_BYTES.as_ref()),
(1_095_000, BLOCK_TESTNET_1095000_BYTES.as_ref()),
(1_101_629, BLOCK_TESTNET_1101629_BYTES.as_ref()),
(1_115_999, BLOCK_TESTNET_1115999_BYTES.as_ref()),
(1_116_000, BLOCK_TESTNET_1116000_BYTES.as_ref()),
(1_116_001, BLOCK_TESTNET_1116001_BYTES.as_ref()),
(1_326_100, BLOCK_TESTNET_1326100_BYTES.as_ref()),
(1_599_199, BLOCK_TESTNET_1599199_BYTES.as_ref()),
].iter().cloned().collect();
pub static ref TESTNET_FINAL_SPROUT_ROOTS: BTreeMap<u32, &'static [u8; 32]> = [
(0, SPROUT_FINAL_ROOT_TESTNET_0_BYTES.as_ref().try_into().unwrap()),
(2259, SPROUT_FINAL_ROOT_TESTNET_2259_BYTES.as_ref().try_into().unwrap()),
].iter().cloned().collect();
pub static ref TESTNET_FINAL_SAPLING_ROOTS: BTreeMap<u32, &'static [u8; 32]> = [
(280_000, SAPLING_FINAL_ROOT_TESTNET_280000_BYTES.as_ref().try_into().unwrap()),
(280_001, SAPLING_FINAL_ROOT_TESTNET_280001_BYTES.as_ref().try_into().unwrap()),
(299_187, SAPLING_FINAL_ROOT_TESTNET_299187_BYTES.as_ref().try_into().unwrap()),
(299_188, SAPLING_FINAL_ROOT_TESTNET_299188_BYTES.as_ref().try_into().unwrap()),
(299_189, SAPLING_FINAL_ROOT_TESTNET_299189_BYTES.as_ref().try_into().unwrap()),
(299_201, SAPLING_FINAL_ROOT_TESTNET_299201_BYTES.as_ref().try_into().unwrap()),
(299_202, SAPLING_FINAL_ROOT_TESTNET_299202_BYTES.as_ref().try_into().unwrap()),
(583_999, SAPLING_FINAL_ROOT_TESTNET_583999_BYTES.as_ref().try_into().unwrap()),
(584_000, SAPLING_FINAL_ROOT_TESTNET_584000_BYTES.as_ref().try_into().unwrap()),
(584_001, SAPLING_FINAL_ROOT_TESTNET_584001_BYTES.as_ref().try_into().unwrap()),
(903_799, SAPLING_FINAL_ROOT_TESTNET_903799_BYTES.as_ref().try_into().unwrap()),
(903_800, SAPLING_FINAL_ROOT_TESTNET_903800_BYTES.as_ref().try_into().unwrap()),
(903_801, SAPLING_FINAL_ROOT_TESTNET_903801_BYTES.as_ref().try_into().unwrap()),
(914_678, SAPLING_FINAL_ROOT_TESTNET_914678_BYTES.as_ref().try_into().unwrap()),
(925_483, SAPLING_FINAL_ROOT_TESTNET_925483_BYTES.as_ref().try_into().unwrap()),
(1_028_499, SAPLING_FINAL_ROOT_TESTNET_1028499_BYTES.as_ref().try_into().unwrap()),
(1_028_500, SAPLING_FINAL_ROOT_TESTNET_1028500_BYTES.as_ref().try_into().unwrap()),
(1_028_501, SAPLING_FINAL_ROOT_TESTNET_1028501_BYTES.as_ref().try_into().unwrap()),
(1_095_000, SAPLING_FINAL_ROOT_TESTNET_1095000_BYTES.as_ref().try_into().unwrap()),
(1_101_629, SAPLING_FINAL_ROOT_TESTNET_1101629_BYTES.as_ref().try_into().unwrap()),
(1_115_999, SAPLING_FINAL_ROOT_TESTNET_1115999_BYTES.as_ref().try_into().unwrap()),
(1_116_000, SAPLING_FINAL_ROOT_TESTNET_1116000_BYTES.as_ref().try_into().unwrap()),
(1_116_001, SAPLING_FINAL_ROOT_TESTNET_1116001_BYTES.as_ref().try_into().unwrap()),
(1_326_100, SAPLING_FINAL_ROOT_TESTNET_1326100_BYTES.as_ref().try_into().unwrap()),
(1_599_199, SAPLING_FINAL_ROOT_TESTNET_1599199_BYTES.as_ref().try_into().unwrap()),
].iter().cloned().collect();
pub static ref BLOCK_MAINNET_GENESIS_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_1_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_2_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-002.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_3_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-003.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_4_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-004.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_5_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-005.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_6_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-006.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_7_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-007.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_8_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-008.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_9_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-009.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_10_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-010.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_202_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-202.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_395_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-395.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_396_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-396.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BAD_BLOCK_MAINNET_202_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-000-202-bad.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SPROUT_FINAL_ROOT_MAINNET_0_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SPROUT_FINAL_ROOT_MAINNET_396_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6a5710d1ca7d079baf1ce6ed1ea1b0756e219e9f3ebb9c0ec5b8ca1ff81c8f06")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SPROUT_FINAL_ROOT_MAINNET_347499_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("ce01f64025aba7c0e30a29f239f0eecd3cc18e5b1e575ca018c789a99482724f")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SPROUT_FINAL_ROOT_MAINNET_347500_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("ce01f64025aba7c0e30a29f239f0eecd3cc18e5b1e575ca018c789a99482724f")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SPROUT_FINAL_ROOT_MAINNET_347501_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("db036e080299a7401fd816789b5ea1b092ba3dab21e0f1d44161fffa149c65c1")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_347499_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-347-499.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_347500_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-347-500.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_347501_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-347-501.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_415000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-415-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_419199_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-419-199.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_419200_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-419-200.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_419201_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-419-201.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_419202_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-419-202.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_419200_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_419201_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("638d7e5ba37ab7921c51a4f3ae1b32d71c605a0ed9be7477928111a637f7421b")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_419202_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("54393f89293c8af01eb985398f5a984c446dd2974bf6ab63fdacbaf32d27a107")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_434873_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-434-873.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_434873_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("56e33199bc41d146cb24d24a65db35101248a1d12fff33affef56f90081a9517")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_653599_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-653-599.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_653600_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-653-600.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_653601_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-653-601.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_653599_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("3d532d101b9171769423a9f45a65b6312e28e7aa92b627cb81810f7a6fe21c6a")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_653600_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("3d532d101b9171769423a9f45a65b6312e28e7aa92b627cb81810f7a6fe21c6a")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_653601_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("612c62e54ef55f7bf8a60281debf1df904bf1fa6d1fa65d9656302b44ea98427")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_902999_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-902-999.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_903000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-903-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_903001_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-903-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_902999_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("49df1a6e62458b0226b9d6c0c28fb7e94d9ca840582878b10d0117fd028b4e91")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_903000_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("11e48300f0e2296d5c413340b26426eddada1155155f4e959ebe307396976c79")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_903001_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("14e3c2b8af239bc4e17486573c20824292d5e1a6670dedf58bf865159e389cce")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_949496_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-949-496.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_975066_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-975-066.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_982681_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-0-982-681.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_949496_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("4db238913a86284f5bddb9bcfe76f96a46d097ec681aad1da846cc276bfa7263")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_975066_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("2f62381b6decd0e0f937f6aa23faa7d19444b784701be93ad7e4df31bd4da1f9")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_982681_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("4fd1cb6d1e5c479baa44fcb7c3a1c6fafdaa54c0456d254918cd63839805848d")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_1046399_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-1-046-399.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_1046400_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-1-046-400.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_MAINNET_1046401_BYTES: Vec<u8> =
include_bytes!("block-main-1-046-401.bin")
.to_vec();
pub static ref SAPLING_FINAL_ROOT_MAINNET_1046399_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("0f12c92f737e84142792bddc82e36481de4a7679d5778a27389793933c8742e1")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_1046400_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("0f12c92f737e84142792bddc82e36481de4a7679d5778a27389793933c8742e1")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_MAINNET_1046401_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("1cb7a61a31354384957eea0b98661e1cf85a5de8e43f0e3bef522c8b375b26cb")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_MAINNET_1180900_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-main-1-180-900.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_MAINNET_1180900_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("4a51c1b879f49637873ac4b261e9c625e16d9400b22d8aa4f27cd6fd1138ddda")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_GENESIS_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_1_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_2_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-002.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_3_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-003.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_4_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-004.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_5_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-005.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_6_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-006.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_7_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-007.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_8_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-008.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_9_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-009.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_10_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-000-010.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_2259_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-002-259.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_141042_BYTES: Vec<u8> = include_bytes!("block-test-0-141-042.bin").to_vec();
pub static ref SPROUT_FINAL_ROOT_TESTNET_0_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SPROUT_FINAL_ROOT_TESTNET_2259_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("2985231c8b3fb5624299fd7289c33667b0270a3fcde420c9047a6bad41f07733")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_207499_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-207-499.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_207500_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-207-500.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_207501_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-207-501.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_279999_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-279-999.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_280000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-280-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_280001_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-280-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_280000_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_280001_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_299187_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-299-187.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_299188_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-299-188.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_299189_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-299-189.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_299201_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-299-201.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_299202_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-299-202.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_299187_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6815df99f9f7ec9486a0b3a4e992ff9348dba7101c2ac91be41ceab392aa5521")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_299188_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6815df99f9f7ec9486a0b3a4e992ff9348dba7101c2ac91be41ceab392aa5521")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_299189_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6815df99f9f7ec9486a0b3a4e992ff9348dba7101c2ac91be41ceab392aa5521")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_299201_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6815df99f9f7ec9486a0b3a4e992ff9348dba7101c2ac91be41ceab392aa5521")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_299202_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("6815df99f9f7ec9486a0b3a4e992ff9348dba7101c2ac91be41ceab392aa5521")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_583999_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-583-999.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_584000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-584-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_584001_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-584-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_583999_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("13746c0c426cdddd05f85d86231f8bc647f5b024277c606c309ef707d85fd652")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_584000_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("13746c0c426cdddd05f85d86231f8bc647f5b024277c606c309ef707d85fd652")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_584001_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("13746c0c426cdddd05f85d86231f8bc647f5b024277c606c309ef707d85fd652")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_903799_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-903-799.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_903800_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-903-800.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_903801_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-903-801.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_903799_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("626444395cd5963d3dba2652ee5bd73ef57555cca4d9f0d52e887a3bf44488e2")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_903800_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("626444395cd5963d3dba2652ee5bd73ef57555cca4d9f0d52e887a3bf44488e2")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_903801_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("626444395cd5963d3dba2652ee5bd73ef57555cca4d9f0d52e887a3bf44488e2")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_914678_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-914-678.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_925483_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-0-925-483.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_914678_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("0ba286a3fb00d8a63b6ea52064bcc58ffb859aaa881745157d9a67d20afd7a8d")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_925483_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("271370ff86c2a9cc452334098d3337cddffc478e66a356dc0c00aebb58a4b6ac")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1028499_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-028-499.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_1028500_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-028-500.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_1028501_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-028-501.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1028499_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("580adc0253cd0545250039267b7b49445ca0550df735920b7466bba1a64f7cf7")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_1028500_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("580adc0253cd0545250039267b7b49445ca0550df735920b7466bba1a64f7cf7")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_1028501_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("580adc0253cd0545250039267b7b49445ca0550df735920b7466bba1a64f7cf7")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1095000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-095-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1095000_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("1781d73666ceb7675323130defd5fae426f1ee7d5fbb83adc9393aa8ff7e8a8d")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1101629_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-101-629.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1101629_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("14c7c827cd05c73c052c2a9faa6d7fc7b45ec2e386d8894eb65c420175c43745")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1115999_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-115-999.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_1116000_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-116-000.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref BLOCK_TESTNET_1116001_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-116-001.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1115999_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("14b41a6dd7cd3c113d98f72543c4f57ff4e444bd5995366e0da420169c861f37")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_1116000_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("14b41a6dd7cd3c113d98f72543c4f57ff4e444bd5995366e0da420169c861f37")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_FINAL_ROOT_TESTNET_1116001_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("14b41a6dd7cd3c113d98f72543c4f57ff4e444bd5995366e0da420169c861f37")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1326100_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-326-100.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1326100_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("2b30b19f4254709fe365bd0b381b2e3d9d0c933eb4dba4dd1d07f0f6e196a183")
.expect("final root bytes are in valid hex representation").rev();
pub static ref BLOCK_TESTNET_1599199_BYTES: Vec<u8> =
<Vec<u8>>::from_hex(include_str!("block-test-1-599-199.txt").trim())
.expect("Block bytes are in valid hex representation");
pub static ref SAPLING_FINAL_ROOT_TESTNET_1599199_BYTES: [u8; 32] =
<[u8; 32]>::from_hex("4de75d10def701ad22ecc17517a3adc8789ea8c214ac5bfc917b8924377e6c89")
.expect("final root bytes are in valid hex representation").rev();
pub static ref SAPLING_TREESTATE_MAINNET_419201_STRING: String =
String::from(include_str!("sapling-treestate-main-0-419-201.txt"));
}
#[cfg(test)]
mod test {
use super::*;
use std::collections::HashSet;
use crate::init;
#[test]
fn block_test_vectors_unique() {
let _init_guard = init();
let block_count = BLOCKS.len();
let block_set: HashSet<_> = BLOCKS.iter().collect();
assert_eq!(
block_count,
block_set.len(),
"block test vectors must be unique"
);
}
#[test]
fn block_test_vectors_count() {
let _init_guard = init();
assert!(
MAINNET_BLOCKS.len() > 30,
"there should be a reasonable number of mainnet block test vectors"
);
assert!(
TESTNET_BLOCKS.len() > 30,
"there should be a reasonable number of testnet block test vectors"
);
assert!(
MAINNET_FINAL_SAPLING_ROOTS.len() > 10,
"there should be a reasonable number of mainnet final sapling root test vectors"
);
assert!(
TESTNET_FINAL_SAPLING_ROOTS.len() > 10,
"there should be a reasonable number of testnet final sapling root test vectors"
);
}
}