Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Dec 14, 2023
1 parent 62e56fb commit 765d8bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/bin/dolos/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn run(config: &super::Config, args: &Args) -> miette::Result<()> {

for (ref_, output) in utxos.iter() {
let txin = pallas::ledger::primitives::byron::TxIn::Variant0(
pallas::codec::utils::CborWrap((ref_.0.clone(), ref_.1 as u32)),
pallas::codec::utils::CborWrap((ref_.0, ref_.1 as u32)),
);

let key = MultiEraInput::Byron(
Expand Down
6 changes: 3 additions & 3 deletions src/storage/applydb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pallas::{
};
use serde::{Deserialize, Serialize};
use std::{
collections::{HashMap, HashSet},
collections::{hash_map::Entry, HashMap, HashSet},
path::Path,
sync::Arc,
};
Expand Down Expand Up @@ -332,12 +332,12 @@ impl ApplyDB {

let utxo_ref = UtxoRef(hash, idx);

if !utxos.contains_key(&utxo_ref) {
if let Entry::Vacant(e) = utxos.entry(utxo_ref) {
let utxo = self
.get_utxo(hash, idx)?
.ok_or(Error::MissingUtxo(hash, idx))?;

utxos.insert(utxo_ref, utxo);
e.insert(utxo);
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/sync/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ impl Stage {
pub fn execute_phase1_validation(&self, block: &MultiEraBlock<'_>) -> Result<(), WorkerError> {
let mut utxos = HashMap::new();
self.ledger
.resolve_inputs_for_block(&block, &mut utxos)
.resolve_inputs_for_block(block, &mut utxos)
.or_panic()?;

let mut utxos2 = UTxOs::new();

for (ref_, output) in utxos.iter() {
let txin = pallas::ledger::primitives::byron::TxIn::Variant0(
pallas::codec::utils::CborWrap((ref_.0.clone(), ref_.1 as u32)),
pallas::codec::utils::CborWrap((ref_.0, ref_.1 as u32)),
);

let key = MultiEraInput::Byron(
Expand All @@ -106,7 +106,7 @@ impl Stage {
.or_panic()?;

for tx in block.txs().iter() {
let res = validate(&tx, &utxos2, &pparams);
let res = validate(tx, &utxos2, pparams);

if let Err(err) = res {
warn!(?err, "validation error");
Expand Down
4 changes: 2 additions & 2 deletions src/sync/pparams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fn apply_era_hardfork(
new_protocol: u64,
) -> Result<MultiEraProtParams, WorkerError> {
match new_protocol {
1 => pparams_from_byron_genesis(&genesis.byron),
2 | 3 | 4 => pparams_from_shelley_genesis(&genesis.shelley),
1 => pparams_from_byron_genesis(genesis.byron),
2..=4 => pparams_from_shelley_genesis(genesis.shelley),
x => {
unimplemented!("don't know how to handle hardfork for protocol {x}");
}
Expand Down

0 comments on commit 765d8bb

Please sign in to comment.