From fe61055f70c2c9167ebcf12b78a2f389b09bbc2e Mon Sep 17 00:00:00 2001 From: Mariusz Pilarek Date: Mon, 14 Oct 2024 12:13:42 +0200 Subject: [PATCH] Fixed formatting, added cfg param 'zcash_unstable' for clippy --- zebra-chain/Cargo.toml | 3 +++ zebra-consensus/src/block/tests.rs | 12 ++++-------- zebra-network/Cargo.toml | 3 +++ zebra-rpc/Cargo.toml | 3 +++ zebra-state/Cargo.toml | 3 +++ zebrad/Cargo.toml | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index 952621a766a..b35dafb5b5b 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -180,3 +180,6 @@ required-features = ["bench"] [[bench]] name = "redpallas" harness = false + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("nsm"))'] } diff --git a/zebra-consensus/src/block/tests.rs b/zebra-consensus/src/block/tests.rs index f1ab54699d0..a0e2683e39e 100644 --- a/zebra-consensus/src/block/tests.rs +++ b/zebra-consensus/src/block/tests.rs @@ -305,8 +305,7 @@ fn subsidy_is_valid_for_network(network: Network) -> Result<(), Report> { // TODO: first halving, second halving, third halving, and very large halvings if height >= canopy_activation_height { let expected_block_subsidy = - subsidy::general::block_subsidy(height, &network) - .expect("valid block subsidy"); + subsidy::general::block_subsidy(height, &network).expect("valid block subsidy"); check::subsidy_is_valid(&block, &network, expected_block_subsidy) .expect("subsidies should pass for this block"); @@ -344,8 +343,7 @@ fn coinbase_validation_failure() -> Result<(), Report> { let expected = BlockError::NoTransactions; assert_eq!(expected, result); - let result = - check::subsidy_is_valid(&block, &network, expected_block_subsidy).unwrap_err(); + let result = check::subsidy_is_valid(&block, &network, expected_block_subsidy).unwrap_err(); let expected = BlockError::Transaction(TransactionError::Subsidy(SubsidyError::NoCoinbase)); assert_eq!(expected, result); @@ -371,8 +369,7 @@ fn coinbase_validation_failure() -> Result<(), Report> { let expected = BlockError::Transaction(TransactionError::CoinbasePosition); assert_eq!(expected, result); - let result = - check::subsidy_is_valid(&block, &network, expected_block_subsidy).unwrap_err(); + let result = check::subsidy_is_valid(&block, &network, expected_block_subsidy).unwrap_err(); let expected = BlockError::Transaction(TransactionError::Subsidy(SubsidyError::NoCoinbase)); assert_eq!(expected, result); @@ -433,8 +430,7 @@ fn funding_stream_validation_for_network(network: Network) -> Result<(), Report> if height >= canopy_activation_height { let block = Block::zcash_deserialize(&block[..]).expect("block should deserialize"); let expected_block_subsidy = - subsidy::general::block_subsidy(height, &network) - .expect("valid block subsidy"); + subsidy::general::block_subsidy(height, &network).expect("valid block subsidy"); // Validate let result = check::subsidy_is_valid(&block, &network, expected_block_subsidy); diff --git a/zebra-network/Cargo.toml b/zebra-network/Cargo.toml index 8f79815b2d9..88bdf504725 100644 --- a/zebra-network/Cargo.toml +++ b/zebra-network/Cargo.toml @@ -97,3 +97,6 @@ toml = "0.8.19" zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] } zebra-test = { path = "../zebra-test/" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("nsm"))'] } diff --git a/zebra-rpc/Cargo.toml b/zebra-rpc/Cargo.toml index a28c3e5fa9b..da6fa80d8cc 100644 --- a/zebra-rpc/Cargo.toml +++ b/zebra-rpc/Cargo.toml @@ -142,3 +142,6 @@ zebra-state = { path = "../zebra-state", version = "1.0.0-beta.42", features = [ ] } zebra-test = { path = "../zebra-test", version = "1.0.0-beta.42" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("nsm"))'] } diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index 9fd9da7a235..1d5c357fa8f 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -116,3 +116,6 @@ tokio = { version = "1.41.0", features = ["full", "tracing", "test-util"] } zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.42", features = ["proptest-impl"] } zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.42" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("nsm"))'] } diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index c3729bd3f8c..393d668d28d 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -301,4 +301,4 @@ zebra-grpc = { path = "../zebra-grpc", version = "0.1.0-alpha.9" } zebra-utils = { path = "../zebra-utils", version = "1.0.0-beta.42" } [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)', 'cfg(zcash_unstable, values("nsm"))'] }