From 89a85b605ebec9ff9ae999f0bcc43906f6267188 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Thu, 5 Dec 2024 09:10:50 +0100 Subject: [PATCH] Make formatter happy --- ouroboros-praos/benches/benchmark.rs | 13 ++++++++----- ouroboros-praos/src/consensus/mod.rs | 14 +++++++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ouroboros-praos/benches/benchmark.rs b/ouroboros-praos/benches/benchmark.rs index a6076ac..90a7592 100644 --- a/ouroboros-praos/benches/benchmark.rs +++ b/ouroboros-praos/benches/benchmark.rs @@ -4,7 +4,7 @@ use ouroboros::ledger::{MockLedgerState, PoolId, PoolSigma}; use ouroboros::validator::Validator; use ouroboros_praos::consensus::BlockValidator; use pallas_crypto::hash::Hash; -use pallas_math::math::{FixedDecimal, FixedPrecision}; +use pallas_math::math::FixedDecimal; use pallas_traverse::MultiEraHeader; fn validate_conway_block() { @@ -56,15 +56,18 @@ fn validate_conway_block() { .expect_latest_opcert_sequence_number() .returning(|_| None); - let block_validator = BlockValidator::new(babbage_header, &ledger_state, &epoch_nonce, &active_slots_coeff); + let block_validator = BlockValidator::new( + babbage_header, + &ledger_state, + &epoch_nonce, + &active_slots_coeff, + ); assert_eq!(block_validator.validate().is_ok(), expected); } } fn benchmark_validate_conway_block(c: &mut Criterion) { - c.bench_function("validate_conway_block", |b| { - b.iter(|| validate_conway_block()) - }); + c.bench_function("validate_conway_block", |b| b.iter(validate_conway_block)); } criterion_group!(benches, benchmark_validate_conway_block); diff --git a/ouroboros-praos/src/consensus/mod.rs b/ouroboros-praos/src/consensus/mod.rs index 51e413a..a7f0c8f 100644 --- a/ouroboros-praos/src/consensus/mod.rs +++ b/ouroboros-praos/src/consensus/mod.rs @@ -167,7 +167,11 @@ impl<'b> BlockValidator<'b> { }) } - fn validate_operational_certificate(&self, issuer_vkey: &[u8], pool_id: &PoolId) -> Result<(), ValidationError> { + fn validate_operational_certificate( + &self, + issuer_vkey: &[u8], + pool_id: &PoolId, + ) -> Result<(), ValidationError> { // Verify the Operational Certificate signature let opcert_signature = Signature::try_from( self.header @@ -445,8 +449,12 @@ mod tests { .expect_latest_opcert_sequence_number() .returning(|_| None); - let block_validator = - BlockValidator::new(babbage_header, &ledger_state, &epoch_nonce, &active_slots_coeff); + let block_validator = BlockValidator::new( + babbage_header, + &ledger_state, + &epoch_nonce, + &active_slots_coeff, + ); assert_eq!(block_validator.validate().is_ok(), expected); } }