From e8561d8f9e83950c08b093ef116edb93075baec3 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 22 Jun 2020 19:34:11 -0700 Subject: [PATCH] rename zebra-test-vectors to zebra-test --- Cargo.lock | 28 +++++++++---------- Cargo.toml | 2 +- zebra-chain/Cargo.toml | 2 +- zebra-chain/src/block/tests.rs | 10 +++---- zebra-chain/src/equihash_solution.rs | 2 +- zebra-consensus/Cargo.toml | 2 +- zebra-consensus/src/checkpoint.rs | 10 +++---- zebra-consensus/src/verify.rs | 6 ++-- zebra-state/Cargo.toml | 2 +- zebra-state/src/lib.rs | 6 ++-- {zebra-test-vectors => zebra-test}/Cargo.toml | 5 ++-- zebra-test/src/lib.rs | 1 + .../src/lib.rs => zebra-test/src/vectors.rs | 0 13 files changed, 39 insertions(+), 37 deletions(-) rename {zebra-test-vectors => zebra-test}/Cargo.toml (66%) create mode 100644 zebra-test/src/lib.rs rename zebra-test-vectors/src/lib.rs => zebra-test/src/vectors.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index dfa7b001..fbc8d8a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49806b9dadc843c61e7c97e72490ad7f7220ae249012fbda9ad0609457c0543" +checksum = "602d785912f476e480434627e8732e6766b760c045bbf897d9dfaa9f4fbd399c" dependencies = [ "gimli", ] @@ -57,9 +57,9 @@ checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "c259a748ac706ba73d609b73fc13469e128337f9a6b2fb3cc82d100f8dd8d511" dependencies = [ "memchr", ] @@ -423,9 +423,9 @@ dependencies = [ [[package]] name = "dtoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" [[package]] name = "ed25519-zebra" @@ -804,9 +804,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "jubjub" @@ -1657,9 +1657,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff2db2112d6c761e12522c65f7768548bd6e8cd23d2a9dae162520626629bd6" +checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" dependencies = [ "libc", "signal-hook-registry", @@ -2329,7 +2329,7 @@ dependencies = [ "sha2", "thiserror", "x25519-dalek", - "zebra-test-vectors", + "zebra-test", ] [[package]] @@ -2350,7 +2350,7 @@ dependencies = [ "tracing-subscriber", "zebra-chain", "zebra-state", - "zebra-test-vectors", + "zebra-test", ] [[package]] @@ -2408,11 +2408,11 @@ dependencies = [ "tracing-futures", "tracing-subscriber", "zebra-chain", - "zebra-test-vectors", + "zebra-test", ] [[package]] -name = "zebra-test-vectors" +name = "zebra-test" version = "0.1.0" dependencies = [ "hex", diff --git a/Cargo.toml b/Cargo.toml index 4243c625..b3481e42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ "zebra-consensus", "zebra-rpc", "zebra-client", - "zebra-test-vectors", + "zebra-test", "zebrad", ] diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index 9ec810a9..ad7226d1 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -33,4 +33,4 @@ redjubjub = "0.1" [dev-dependencies] proptest = "0.10" proptest-derive = "0.2.0" -zebra-test-vectors = { path = "../zebra-test-vectors/" } +zebra-test = { path = "../zebra-test/" } diff --git a/zebra-chain/src/block/tests.rs b/zebra-chain/src/block/tests.rs index fa1ade14..7c633b9f 100644 --- a/zebra-chain/src/block/tests.rs +++ b/zebra-chain/src/block/tests.rs @@ -105,22 +105,22 @@ fn blockheaderhash_from_blockheader() { fn deserialize_blockheader() { // https://explorer.zcha.in/blocks/415000 let _header = - BlockHeader::zcash_deserialize(&zebra_test_vectors::HEADER_MAINNET_415000_BYTES[..]) + BlockHeader::zcash_deserialize(&zebra_test::vectors::HEADER_MAINNET_415000_BYTES[..]) .expect("blockheader test vector should deserialize"); } #[test] fn deserialize_block() { - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..]) + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..]) .expect("block test vector should deserialize"); - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_1_BYTES[..]) + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_1_BYTES[..]) .expect("block test vector should deserialize"); // https://explorer.zcha.in/blocks/415000 - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..]) + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..]) .expect("block test vector should deserialize"); // https://explorer.zcha.in/blocks/434873 // this one has a bad version field - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_434873_BYTES[..]) + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_434873_BYTES[..]) .expect("block test vector should deserialize"); } diff --git a/zebra-chain/src/equihash_solution.rs b/zebra-chain/src/equihash_solution.rs index 477c05e5..5e58b4fa 100644 --- a/zebra-chain/src/equihash_solution.rs +++ b/zebra-chain/src/equihash_solution.rs @@ -122,7 +122,7 @@ mod tests { #[test] fn equihash_solution_test_vector() { let solution_bytes = - &zebra_test_vectors::HEADER_MAINNET_415000_BYTES[EQUIHASH_SOLUTION_BLOCK_OFFSET..]; + &zebra_test::vectors::HEADER_MAINNET_415000_BYTES[EQUIHASH_SOLUTION_BLOCK_OFFSET..]; let solution = EquihashSolution::zcash_deserialize(solution_bytes) .expect("Test vector EquihashSolution should deserialize"); diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index 1247ff74..ccdb7b8b 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -14,7 +14,7 @@ futures-util = "0.3.5" tower = "0.3.1" [dev-dependencies] -zebra-test-vectors = { path = "../zebra-test-vectors/" } +zebra-test = { path = "../zebra-test/" } spandoc = { git = "https://github.com/yaahc/spandoc.git" } tokio = { version = "0.2.21", features = ["full"] } tracing = "0.1.15" diff --git a/zebra-consensus/src/checkpoint.rs b/zebra-consensus/src/checkpoint.rs index 6611971e..f21a4fa7 100644 --- a/zebra-consensus/src/checkpoint.rs +++ b/zebra-consensus/src/checkpoint.rs @@ -166,7 +166,7 @@ mod tests { #[spandoc::spandoc] async fn checkpoint_single_item_list() -> Result<(), Report> { let block0 = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; let hash0: BlockHeaderHash = block0.as_ref().into(); // Make a checkpoint list containing only the genesis block @@ -216,7 +216,7 @@ mod tests { #[spandoc::spandoc] async fn checkpoint_list_empty_fail() -> Result<(), Report> { let block0 = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; let mut state_service = Box::new(zebra_state::in_memory::init()); let mut checkpoint_verifier = super::init( @@ -263,9 +263,9 @@ mod tests { #[spandoc::spandoc] async fn checkpoint_not_present_fail() -> Result<(), Report> { let block0 = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; let block415000 = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..])?; // Make a checkpoint list containing only the genesis block let genesis_checkpoint_list: HashMap = @@ -332,7 +332,7 @@ mod tests { #[spandoc::spandoc] async fn checkpoint_wrong_hash_fail() -> Result<(), Report> { let block0 = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?; // Make a checkpoint list containing the genesis block height, // but use the wrong hash diff --git a/zebra-consensus/src/verify.rs b/zebra-consensus/src/verify.rs index 119ec9ae..428b7b37 100644 --- a/zebra-consensus/src/verify.rs +++ b/zebra-consensus/src/verify.rs @@ -131,7 +131,7 @@ mod tests { #[spandoc::spandoc] async fn verify() -> Result<(), Report> { let block = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..])?; let hash: BlockHeaderHash = block.as_ref().into(); let state_service = Box::new(zebra_state::in_memory::init()); @@ -158,7 +158,7 @@ mod tests { #[spandoc::spandoc] async fn round_trip() -> Result<(), Report> { let block = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..])?; let hash: BlockHeaderHash = block.as_ref().into(); let mut state_service = zebra_state::in_memory::init(); @@ -202,7 +202,7 @@ mod tests { install_tracing(); let block = - Arc::::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..])?; + Arc::::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..])?; let hash: BlockHeaderHash = block.as_ref().into(); let mut state_service = zebra_state::in_memory::init(); diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index 52314ca1..41af166e 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -18,7 +18,7 @@ serde = { version = "1", features = ["serde_derive"] } [dev-dependencies] tokio = { version = "0.2.21", features = ["full"] } -zebra-test-vectors = { path = "../zebra-test-vectors/" } +zebra-test = { path = "../zebra-test" } spandoc = { git = "https://github.com/yaahc/spandoc.git" } tracing = "0.1.15" tracing-futures = "0.2.4" diff --git a/zebra-state/src/lib.rs b/zebra-state/src/lib.rs index 19d88fc4..8fd565f5 100644 --- a/zebra-state/src/lib.rs +++ b/zebra-state/src/lib.rs @@ -146,7 +146,7 @@ mod tests { >, { let block: Arc<_> = - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_415000_BYTES[..])?.into(); + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_415000_BYTES[..])?.into(); let hash = block.as_ref().into(); let response = service @@ -205,9 +205,9 @@ mod tests { install_tracing(); let block0: Arc<_> = - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?.into(); + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES[..])?.into(); let block1: Arc<_> = - Block::zcash_deserialize(&zebra_test_vectors::BLOCK_MAINNET_1_BYTES[..])?.into(); + Block::zcash_deserialize(&zebra_test::vectors::BLOCK_MAINNET_1_BYTES[..])?.into(); let block0_hash: BlockHeaderHash = block0.as_ref().into(); let block1_hash: BlockHeaderHash = block1.as_ref().into(); diff --git a/zebra-test-vectors/Cargo.toml b/zebra-test/Cargo.toml similarity index 66% rename from zebra-test-vectors/Cargo.toml rename to zebra-test/Cargo.toml index 2222a715..41b888a2 100644 --- a/zebra-test-vectors/Cargo.toml +++ b/zebra-test/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "zebra-test-vectors" +name = "zebra-test" version = "0.1.0" -authors = ["Jane Lusby "] +authors = ["Zcash Foundation "] +license = "MIT OR Apache-2.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-test/src/lib.rs b/zebra-test/src/lib.rs new file mode 100644 index 00000000..c31ddd2d --- /dev/null +++ b/zebra-test/src/lib.rs @@ -0,0 +1 @@ +pub mod vectors; diff --git a/zebra-test-vectors/src/lib.rs b/zebra-test/src/vectors.rs similarity index 100% rename from zebra-test-vectors/src/lib.rs rename to zebra-test/src/vectors.rs