Skip to content

Commit

Permalink
add a pairinginfo type to make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Aug 1, 2024
1 parent 7e59c45 commit 19331c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/chia-bls/src/bls_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ impl Default for BlsCache {
}
}

pub type PairingInfo = ([u8; 32], Vec<u8>);
type AggregateVerifyResult = (bool, Vec<PairingInfo>);

impl BlsCache {
pub fn new(cache_size: NonZeroUsize) -> Self {
Self {
Expand All @@ -52,7 +55,7 @@ impl BlsCache {
&mut self,
pks_msgs: impl IntoIterator<Item = (Pk, Msg)>,
sig: &Signature,
) -> (bool, Vec<([u8; 32], Vec<u8>)>) {
) -> AggregateVerifyResult {
let mut added: Vec<([u8; 32], Vec<u8>)> = Vec::new();
let iter = pks_msgs.into_iter().map(|(pk, msg)| -> GTElement {
// Hash pubkey + message
Expand Down
1 change: 1 addition & 0 deletions crates/chia-bls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod signature;
#[cfg(feature = "py-bindings")]
mod parse_hex;

pub use bls_cache::PairingInfo;
pub use bls_cache::BlsCache;
pub use derive_keys::*;
pub use error::{Error, Result};
Expand Down
3 changes: 2 additions & 1 deletion crates/chia-consensus/src/spendbundle_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::gen::owned_conditions::OwnedSpendBundleConditions;
use crate::gen::validation_error::ErrorCode;
use crate::spendbundle_conditions::get_conditions_from_spendbundle;
use chia_bls::BlsCache;
use chia_bls::PairingInfo;
use chia_protocol::SpendBundle;
use clvmr::{ENABLE_BLS_OPS_OUTSIDE_GUARD, ENABLE_FIXED_DIV};
use std::sync::{Arc, Mutex};
Expand All @@ -26,7 +27,7 @@ pub fn validate_clvm_and_signature(
) -> Result<
(
OwnedSpendBundleConditions,
Vec<([u8; 32], Vec<u8>)>,
Vec<PairingInfo>,
Duration,
),
ErrorCode,
Expand Down

0 comments on commit 19331c3

Please sign in to comment.