Skip to content

Commit

Permalink
Fix Rust lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamc1 committed Sep 12, 2023
1 parent f079358 commit a994534
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions lib/ain-evm/src/core.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::cmp::Ordering;
use std::{path::PathBuf, sync::Arc};

use anyhow::format_err;
Expand Down Expand Up @@ -273,20 +274,24 @@ impl EVMCoreService {
debug!("[validate_raw_tx] prepay_fee : {:x?}", prepay_fee);

// Should be queued for now and don't go through VM validation
if signed_tx.nonce() > nonce {
return Ok(ValidateTxInfo {
signed_tx,
prepay_fee,
higher_nonce: true,
lower_nonce: false,
});
} else if signed_tx.nonce() < nonce {
return Ok(ValidateTxInfo {
signed_tx,
prepay_fee,
higher_nonce: false,
lower_nonce: true,
});
match signed_tx.nonce().cmp(&nonce) {
Ordering::Greater => {
return Ok(ValidateTxInfo {
signed_tx,
prepay_fee,
higher_nonce: true,
lower_nonce: false,
});
}
Ordering::Less => {
return Ok(ValidateTxInfo {
signed_tx,
prepay_fee,
higher_nonce: false,
lower_nonce: true,
});
}
_ => {}
}

// Validate tx prepay fees with account balance
Expand Down

0 comments on commit a994534

Please sign in to comment.