Skip to content

Commit

Permalink
Fixed formatting, added cfg param 'zcash_unstable' for clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mariopil committed Nov 4, 2024
1 parent ac0cf4e commit fe61055
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
3 changes: 3 additions & 0 deletions zebra-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))'] }
12 changes: 4 additions & 8 deletions zebra-consensus/src/block/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions zebra-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))'] }
3 changes: 3 additions & 0 deletions zebra-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))'] }
3 changes: 3 additions & 0 deletions zebra-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))'] }
2 changes: 1 addition & 1 deletion zebrad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))'] }

0 comments on commit fe61055

Please sign in to comment.