Skip to content

Commit

Permalink
fix: Rust (clippy) linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MaicoLeberle committed Dec 13, 2023
1 parent 5f91ea9 commit 6bb6b8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/bin/dolos/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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
8 changes: 4 additions & 4 deletions src/storage/applydb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,11 @@ impl ApplyDB {

let utxo_ref = UtxoRef(hash, idx);

if !utxos.contains_key(&utxo_ref) {
if let std::collections::hash_map::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 Expand Up @@ -434,7 +433,8 @@ impl ApplyDB {
prot_magic: self.prot_magic,
network_id: self.network_id,
})
} else if block_slot >= 4492800 && block_slot < 40348902 {
} else if (4492800..39916974).contains(&block_slot) {
// The ShelleyMA era spans from block slot 4492800 to 39916974
Ok(Environment {
prot_params: MultiEraProtParams::Byron(ByronProtParams {
fee_policy: FeePolicy {
Expand Down
6 changes: 3 additions & 3 deletions src/sync/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ pub fn execute_phase1_validation(
) -> Result<(), WorkerError> {
let mut utxos = HashMap::new();
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 @@ -39,7 +39,7 @@ pub fn execute_phase1_validation(
let env = ledger.get_active_pparams(block.slot()).or_panic()?;

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

if let Err(err) = res {
warn!(?err, "validation error");
Expand Down

0 comments on commit 6bb6b8d

Please sign in to comment.