Manually rustfmt code inside lazy_static!

This commit is contained in:
teor 2020-09-29 17:22:26 +10:00 committed by Deirdre Connolly
parent 58041d8a49
commit 1a7e43a31d
3 changed files with 82 additions and 49 deletions

View File

@ -141,8 +141,10 @@ mod tests {
use zebra_test::prelude::*;
lazy_static::lazy_static! {
pub static ref SCRIPT_PUBKEY: Vec<u8> = <Vec<u8>>::from_hex("76a914f47cac1e6fec195c055994e8064ffccce0044dd788ac").unwrap();
pub static ref SCRIPT_TX: Vec<u8> = <Vec<u8>>::from_hex("0400008085202f8901fcaf44919d4a17f6181a02a7ebe0420be6f7dad1ef86755b81d5a9567456653c010000006a473044022035224ed7276e61affd53315eca059c92876bc2df61d84277cafd7af61d4dbf4002203ed72ea497a9f6b38eb29df08e830d99e32377edb8a574b8a289024f0241d7c40121031f54b095eae066d96b2557c1f99e40e967978a5fd117465dbec0986ca74201a6feffffff020050d6dc0100000017a9141b8a9bda4b62cd0d0582b55455d0778c86f8628f870d03c812030000001976a914e4ff5512ffafe9287992a1cd177ca6e408e0300388ac62070d0095070d000000000000000000000000").expect("Block bytes are in valid hex representation");
pub static ref SCRIPT_PUBKEY: Vec<u8> = <Vec<u8>>::from_hex("76a914f47cac1e6fec195c055994e8064ffccce0044dd788ac")
.unwrap();
pub static ref SCRIPT_TX: Vec<u8> = <Vec<u8>>::from_hex("0400008085202f8901fcaf44919d4a17f6181a02a7ebe0420be6f7dad1ef86755b81d5a9567456653c010000006a473044022035224ed7276e61affd53315eca059c92876bc2df61d84277cafd7af61d4dbf4002203ed72ea497a9f6b38eb29df08e830d99e32377edb8a574b8a289024f0241d7c40121031f54b095eae066d96b2557c1f99e40e967978a5fd117465dbec0986ca74201a6feffffff020050d6dc0100000017a9141b8a9bda4b62cd0d0582b55455d0778c86f8628f870d03c812030000001976a914e4ff5512ffafe9287992a1cd177ca6e408e0300388ac62070d0095070d000000000000000000000000")
.expect("Block bytes are in valid hex representation");
}
#[test]

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,11 @@ use std::iter::FromIterator;
lazy_static! {
/// All block test vectors
pub static ref BLOCKS: Vec<&'static [u8]> = MAINNET_BLOCKS.iter().chain(TESTNET_BLOCKS.iter()).map(|(_height, block)| *block).collect();
pub static ref BLOCKS: Vec<&'static [u8]> = MAINNET_BLOCKS
.iter()
.chain(TESTNET_BLOCKS.iter())
.map(|(_height, block)| *block)
.collect();
// Update these lists of blocks when you add new block test vectors to
// this file
@ -102,23 +106,32 @@ lazy_static! {
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())
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())
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())
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())
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())
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())
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())
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())
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())
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");
// zcash-cli getblock 10 0 > block-main-0-000-010.txt
pub static ref BLOCK_MAINNET_10_BYTES: Vec<u8> =
@ -210,23 +223,32 @@ lazy_static! {
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())
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())
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())
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())
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())
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())
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())
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())
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())
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");
// zcash-cli -testnet getblock 10 0 > block-test-0-000-010.txt
pub static ref BLOCK_TESTNET_10_BYTES: Vec<u8> =