Skip to content

Commit

Permalink
pybindings clippy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Aug 1, 2024
1 parent 9e90b23 commit ff4d611
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions wheel/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ use clvmr::serde::{node_from_bytes, node_from_bytes_backrefs};
use clvmr::ChiaDialect;

use chia_bls::{
hash_to_g2 as native_hash_to_g2, BlsCache, DerivableKey, GTElement, PublicKey, SecretKey,
Signature,
hash_to_g2 as native_hash_to_g2, BlsCache, DerivableKey, GTElement, PairingInfo, PublicKey,
SecretKey, Signature,
};

#[pyfunction]
Expand Down Expand Up @@ -369,16 +369,12 @@ pub fn py_validate_clvm_and_signature(
constants: &ConsensusConstants,
peak_height: u32,
cache: Option<BlsCache>,
) -> PyResult<(OwnedSpendBundleConditions, Vec<([u8; 32], Vec<u8>)>, f32)> {
let real_cache = if let Some(unwrapped_cache) = cache {
unwrapped_cache
} else {
BlsCache::default()
};
) -> PyResult<(OwnedSpendBundleConditions, Vec<PairingInfo>, f32)> {
let real_cache = cache.unwrap_or_default();
let (owned_conditions, additions, duration) = validate_clvm_and_signature(
new_spend,
max_cost,
&constants,
constants,
peak_height,
&Arc::new(Mutex::new(real_cache)), // TODO: use cache properly
)
Expand Down Expand Up @@ -408,12 +404,9 @@ pub fn py_get_conditions_from_spendbundle(

#[pyfunction]
#[pyo3(name = "get_flags_for_height_and_constants")]
pub fn py_get_flags_for_height_and_constants(
height: u32,
constants: &ConsensusConstants,
) -> PyResult<u32> {
pub fn py_get_flags_for_height_and_constants(height: u32, constants: &ConsensusConstants) -> u32 {
let flags = get_flags_for_height_and_constants(height, constants);
Ok(flags)
flags
}

#[pymodule]
Expand Down

0 comments on commit ff4d611

Please sign in to comment.