fix(build): Stop using a test-only method in production code (#4000)
* Make proptest-impl features consistently depend on each other * Use a non-test method for consensus checks * Make proptest dependencies the same between crates
This commit is contained in:
parent
a12d5df695
commit
d767f43fd9
|
@ -5757,6 +5757,7 @@ dependencies = [
|
||||||
"jsonrpc-derive",
|
"jsonrpc-derive",
|
||||||
"jsonrpc-http-server",
|
"jsonrpc-http-server",
|
||||||
"proptest",
|
"proptest",
|
||||||
|
"proptest-derive",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl"]
|
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
blake2b_simd = "1.0.0"
|
blake2b_simd = "1.0.0"
|
||||||
|
|
|
@ -495,7 +495,7 @@ where
|
||||||
crate::block::check::equihash_solution_is_valid(&block.header)?;
|
crate::block::check::equihash_solution_is_valid(&block.header)?;
|
||||||
|
|
||||||
// don't do precalculation until the block passes basic difficulty checks
|
// don't do precalculation until the block passes basic difficulty checks
|
||||||
let block = FinalizedBlock::with_hash_and_height(block, hash, height);
|
let block = FinalizedBlock::with_hash(block, hash);
|
||||||
|
|
||||||
crate::block::check::merkle_root_validity(
|
crate::block::check::merkle_root_validity(
|
||||||
self.network,
|
self.network,
|
||||||
|
|
|
@ -7,6 +7,10 @@ edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zebra-chain = { path = "../zebra-chain" }
|
zebra-chain = { path = "../zebra-chain" }
|
||||||
zebra-network = { path = "../zebra-network" }
|
zebra-network = { path = "../zebra-network" }
|
||||||
|
@ -35,8 +39,12 @@ tracing-futures = "0.2.5"
|
||||||
hex = { version = "0.4.3", features = ["serde"] }
|
hex = { version = "0.4.3", features = ["serde"] }
|
||||||
serde = { version = "1.0.136", features = ["serde_derive"] }
|
serde = { version = "1.0.136", features = ["serde_derive"] }
|
||||||
|
|
||||||
|
proptest = { version = "0.10.1", optional = true }
|
||||||
|
proptest-derive = { version = "0.3.0", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
proptest = "0.10.1"
|
proptest = "0.10.1"
|
||||||
|
proptest-derive = "0.3.0"
|
||||||
serde_json = "1.0.79"
|
serde_json = "1.0.79"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.30"
|
||||||
tokio = { version = "1.16.1", features = ["full", "test-util"] }
|
tokio = { version = "1.16.1", features = ["full", "test-util"] }
|
||||||
|
|
|
@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
proptest-impl = ["proptest", "proptest-derive", "zebra-test"]
|
proptest-impl = ["proptest", "proptest-derive", "zebra-test", "zebra-chain/proptest-impl"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
|
|
|
@ -9,6 +9,16 @@ repository = "https://github.com/ZcashFoundation/zebra"
|
||||||
# when run in the workspace directory
|
# when run in the workspace directory
|
||||||
default-run = "zebrad"
|
default-run = "zebrad"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl", "zebra-consensus/proptest-impl", "zebra-network/proptest-impl"]
|
||||||
|
|
||||||
|
enable-sentry = []
|
||||||
|
test_sync_to_mandatory_checkpoint_mainnet = []
|
||||||
|
test_sync_to_mandatory_checkpoint_testnet = []
|
||||||
|
test_sync_past_mandatory_checkpoint_mainnet = []
|
||||||
|
test_sync_past_mandatory_checkpoint_testnet = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zebra-chain = { path = "../zebra-chain" }
|
zebra-chain = { path = "../zebra-chain" }
|
||||||
zebra-consensus = { path = "../zebra-consensus/" }
|
zebra-consensus = { path = "../zebra-consensus/" }
|
||||||
|
@ -53,6 +63,9 @@ sentry = { version = "0.23.0", default-features = false, features = ["backtrace"
|
||||||
num-integer = "0.1.44"
|
num-integer = "0.1.44"
|
||||||
rand = { version = "0.8.5", package = "rand" }
|
rand = { version = "0.8.5", package = "rand" }
|
||||||
|
|
||||||
|
proptest = { version = "0.10.1", optional = true }
|
||||||
|
proptest-derive = { version = "0.3.0", optional = true }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
vergen = { version = "7.0.0", default-features = false, features = ["cargo", "git"] }
|
vergen = { version = "7.0.0", default-features = false, features = ["cargo", "git"] }
|
||||||
|
|
||||||
|
@ -74,10 +87,3 @@ zebra-consensus = { path = "../zebra-consensus/", features = ["proptest-impl"] }
|
||||||
zebra-network = { path = "../zebra-network", features = ["proptest-impl"] }
|
zebra-network = { path = "../zebra-network", features = ["proptest-impl"] }
|
||||||
zebra-state = { path = "../zebra-state", features = ["proptest-impl"] }
|
zebra-state = { path = "../zebra-state", features = ["proptest-impl"] }
|
||||||
zebra-test = { path = "../zebra-test" }
|
zebra-test = { path = "../zebra-test" }
|
||||||
|
|
||||||
[features]
|
|
||||||
enable-sentry = []
|
|
||||||
test_sync_to_mandatory_checkpoint_mainnet = []
|
|
||||||
test_sync_to_mandatory_checkpoint_testnet = []
|
|
||||||
test_sync_past_mandatory_checkpoint_mainnet = []
|
|
||||||
test_sync_past_mandatory_checkpoint_testnet = []
|
|
||||||
|
|
Loading…
Reference in New Issue