Skip to content

Commit

Permalink
Merge pull request #737 from Chia-Network/clippy-fixes
Browse files Browse the repository at this point in the history
Fix clippy warnings and py-bindings on chia-consensus
  • Loading branch information
Rigidity authored Sep 28, 2024
2 parents 38fa90c + 2adf7e8 commit 947e340
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 deletions.
7 changes: 6 additions & 1 deletion crates/chia-consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ repository = "https://github.com/Chia-Network/chia_rs"
workspace = true

[features]
py-bindings = ["dep:pyo3", "dep:chia_py_streamable_macro"]
py-bindings = [
"dep:pyo3",
"dep:chia_py_streamable_macro",
"chia-traits/py-bindings",
"chia-protocol/py-bindings"
]

[dependencies]
clvmr = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion crates/chia-consensus/benches/run-generator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use chia_consensus::consensus_constants::TEST_CONSTANTS;
use chia_consensus::gen::conditions::MempoolVisitor;
use chia_consensus::gen::flags::ALLOW_BACKREFS;
use chia_consensus::gen::run_block_generator::{run_block_generator, run_block_generator2};
use clvmr::serde::{node_from_bytes, node_to_bytes_backrefs};
Expand Down
66 changes: 33 additions & 33 deletions crates/chia-consensus/src/gen/solution_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,24 +453,24 @@ mod tests {
#[case(0x7fff)]
#[case(0x8000)]
#[case(0xffff)]
#[case(0x7fffff)]
#[case(0x800000)]
#[case(0xffffff)]
#[case(0x7fffffff)]
#[case(0x80000000)]
#[case(0xffffffff)]
#[case(0x7fffffffff)]
#[case(0x8000000000)]
#[case(0xffffffffff)]
#[case(0x7fffffffffff)]
#[case(0x800000000000)]
#[case(0xffffffffffff)]
#[case(0x7fffffffffffff)]
#[case(0x80000000000000)]
#[case(0xffffffffffffff)]
#[case(0x7fffffffffffffff)]
#[case(0x8000000000000000)]
#[case(0xffffffffffffffff)]
#[case(0x7f_ffff)]
#[case(0x80_0000)]
#[case(0xff_ffff)]
#[case(0x7fff_ffff)]
#[case(0x8000_0000)]
#[case(0xffff_ffff)]
#[case(0x7f_ffff_ffff)]
#[case(0x80_0000_0000)]
#[case(0xff_ffff_ffff)]
#[case(0x7fff_ffff_ffff)]
#[case(0x8000_0000_0000)]
#[case(0xffff_ffff_ffff)]
#[case(0x7f_ffff_ffff_ffff)]
#[case(0x80_0000_0000_0000)]
#[case(0xff_ffff_ffff_ffff)]
#[case(0x7fff_ffff_ffff_ffff)]
#[case(0x8000_0000_0000_0000)]
#[case(0xffff_ffff_ffff_ffff)]
#[case(0x7)]
#[case(0x8)]
#[case(0xf)]
Expand All @@ -480,21 +480,21 @@ mod tests {
#[case(0x7ffff)]
#[case(0x80000)]
#[case(0xfffff)]
#[case(0x7ffffff)]
#[case(0x8000000)]
#[case(0xfffffff)]
#[case(0x7ffffffff)]
#[case(0x800000000)]
#[case(0xfffffffff)]
#[case(0x7ffffffffff)]
#[case(0x80000000000)]
#[case(0xfffffffffff)]
#[case(0x7ffffffffffff)]
#[case(0x8000000000000)]
#[case(0xfffffffffffff)]
#[case(0x7ffffffffffffff)]
#[case(0x800000000000000)]
#[case(0xfffffffffffffff)]
#[case(0x7ff_ffff)]
#[case(0x800_0000)]
#[case(0xfff_ffff)]
#[case(0x7_ffff_ffff)]
#[case(0x8_0000_0000)]
#[case(0xf_ffff_ffff)]
#[case(0x7ff_ffff_ffff)]
#[case(0x800_0000_0000)]
#[case(0xfff_ffff_ffff)]
#[case(0x7_ffff_ffff_ffff)]
#[case(0x8_0000_0000_0000)]
#[case(0xf_ffff_ffff_ffff)]
#[case(0x7ff_ffff_ffff_ffff)]
#[case(0x800_0000_0000_0000)]
#[case(0xfff_ffff_ffff_ffff)]
fn test_clvm_bytes_len(#[case] n: u64) {
let len = clvm_bytes_len(n);
let mut a = Allocator::new();
Expand Down

0 comments on commit 947e340

Please sign in to comment.