Skip to content

Commit

Permalink
refactor: simplify type annotations in transaction validation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lancevincentsalera committed Feb 27, 2025
1 parent 389999e commit 33e84bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/ledger/u5c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ fn map_conway_pparams(pparams: &Params) -> ConwayProtParams {
},
},
max_tx_ex_units: primitives::ExUnits {
mem: max_execution_units_per_transaction.memory as u64,
steps: max_execution_units_per_transaction.steps as u64,
mem: max_execution_units_per_transaction.memory,
steps: max_execution_units_per_transaction.steps,
},
max_block_ex_units: primitives::ExUnits {
mem: max_execution_units_per_block.memory as u64,
steps: max_execution_units_per_block.steps as u64,
mem: max_execution_units_per_block.memory,
steps: max_execution_units_per_block.steps,
},
max_value_size: params.max_value_size as u32,
collateral_percentage: params.collateral_percentage as u32,
Expand Down
5 changes: 2 additions & 3 deletions src/pipeline/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Stage {
}
}

async fn validate_tx<'a>(&self, tx: &MultiEraTx<'a>) -> Result<(), anyhow::Error> {
async fn validate_tx(&self, tx: &MultiEraTx<'_>) -> Result<(), anyhow::Error> {
let (block_slot, block_hash_vec) = self.u5c_adapter.fetch_tip().await.or_retry()?;
let block_hash_vec: [u8; 32] = block_hash_vec.try_into().unwrap();
let block_hash: Hash<32> = Hash::from(block_hash_vec);
Expand Down Expand Up @@ -97,7 +97,7 @@ impl Stage {
Ok(())
}

async fn evaluate_tx<'a>(&self, tx: &MultiEraTx<'a>) -> Result<EvalReport, anyhow::Error> {
async fn evaluate_tx(&self, tx: &MultiEraTx<'_>) -> Result<EvalReport, anyhow::Error> {
let era = tx.era();

let pparams = self.u5c_adapter.fetch_pparams(era).await.or_retry()?;
Expand Down Expand Up @@ -181,7 +181,6 @@ impl gasket::framework::Worker<Stage> for Worker {

#[cfg(test)]
mod ingest_tests {

use std::sync::Arc;

use crate::ledger::u5c::U5cDataAdapterImpl;
Expand Down

0 comments on commit 33e84bc

Please sign in to comment.