mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: make clippy happy (#3827)
This commit is contained in:
@ -190,6 +190,7 @@ mod tests {
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
fn collect_table_entries<DB, T>(
|
||||
tx: &<DB as DatabaseGAT<'_>>::TX,
|
||||
) -> Result<Vec<(T::Key, T::Value)>, InitDatabaseError>
|
||||
|
||||
@ -35,7 +35,7 @@ pub(crate) async fn dump_execution_stage<DB: Database>(
|
||||
/// Imports all the tables that can be copied over a range.
|
||||
fn import_tables_with_range<DB: Database>(
|
||||
output_db: &DatabaseEnv,
|
||||
db_tool: &mut DbTool<'_, DB>,
|
||||
db_tool: &DbTool<'_, DB>,
|
||||
from: u64,
|
||||
to: u64,
|
||||
) -> eyre::Result<()> {
|
||||
|
||||
@ -131,7 +131,7 @@ pub(crate) fn setup<DB: Database>(
|
||||
from: u64,
|
||||
to: u64,
|
||||
output_db: &PathBuf,
|
||||
db_tool: &mut DbTool<'_, DB>,
|
||||
db_tool: &DbTool<'_, DB>,
|
||||
) -> eyre::Result<(DatabaseEnv, u64)> {
|
||||
assert!(from < to, "FROM block should be bigger than TO block.");
|
||||
|
||||
|
||||
@ -325,7 +325,7 @@ struct OrderedSealedBlock(SealedBlock);
|
||||
|
||||
impl PartialOrd for OrderedSealedBlock {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
self.0.number.partial_cmp(&other.0.number)
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -328,7 +328,7 @@ mod tests {
|
||||
assert_eq!(b, vec[..]);
|
||||
assert_eq!(vec[..], b);
|
||||
|
||||
let wrong_vec = vec![1, 3, 52, 137];
|
||||
let wrong_vec = [1, 3, 52, 137];
|
||||
assert_ne!(b, wrong_vec[..]);
|
||||
assert_ne!(wrong_vec[..], b);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ impl TracingInspector {
|
||||
///
|
||||
/// This expects an existing [CallTrace], in other words, this panics if not within the context
|
||||
/// of a call.
|
||||
fn start_step<DB: Database>(&mut self, interp: &mut Interpreter, data: &mut EVMData<'_, DB>) {
|
||||
fn start_step<DB: Database>(&mut self, interp: &Interpreter, data: &EVMData<'_, DB>) {
|
||||
let trace_idx = self.last_trace_idx();
|
||||
let trace = &mut self.traces.arena[trace_idx];
|
||||
|
||||
@ -283,8 +283,8 @@ impl TracingInspector {
|
||||
/// Invoked on [Inspector::step_end].
|
||||
fn fill_step_on_step_end<DB: Database>(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
interp: &Interpreter,
|
||||
data: &EVMData<'_, DB>,
|
||||
status: InstructionResult,
|
||||
) {
|
||||
let StackStep { trace_idx, step_idx } =
|
||||
|
||||
@ -48,7 +48,7 @@ fn bench_decode(c: &mut Criterion) {
|
||||
});
|
||||
c.bench_function("decode_u256", |b| {
|
||||
b.iter(|| {
|
||||
let data = vec![
|
||||
let data = [
|
||||
0xa0, 0x80, 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0x09, 0x10, 0x20, 0x30, 0x40,
|
||||
0x50, 0x60, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x12, 0xf0,
|
||||
|
||||
@ -30,7 +30,7 @@ pub async fn launch_auth(secret: JwtSecret) -> AuthServerHandle {
|
||||
MAINNET.clone(),
|
||||
beacon_engine_handle,
|
||||
spawn_test_payload_service().into(),
|
||||
Box::new(TokioTaskExecutor::default()),
|
||||
Box::<TokioTaskExecutor>::default(),
|
||||
);
|
||||
let module = AuthRpcModule::new(engine_api);
|
||||
module.start_server(config).await.unwrap()
|
||||
|
||||
@ -12,10 +12,7 @@ pub struct TxGasAndReward {
|
||||
|
||||
impl PartialOrd for TxGasAndReward {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
// compare only the reward
|
||||
// see:
|
||||
// <https://github.com/ethereum/go-ethereum/blob/ee8e83fa5f6cb261dad2ed0a7bbcde4930c41e6c/eth/gasprice/feehistory.go#L85>
|
||||
self.reward.partial_cmp(&other.reward)
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -885,8 +885,7 @@ mod tests {
|
||||
let tx = db.tx().unwrap();
|
||||
let factory = HashedPostStateCursorFactory::new(&tx, &hashed_post_state);
|
||||
let expected =
|
||||
[(address, db_storage.into_iter().chain(post_state_storage.into_iter()).collect())]
|
||||
.into_iter();
|
||||
[(address, db_storage.into_iter().chain(post_state_storage).collect())].into_iter();
|
||||
assert_storage_cursor_order(&factory, expected);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user