mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove needless clippy lint (#14550)
This commit is contained in:
@ -324,13 +324,11 @@ mod tests {
|
||||
block2.set_hash(block2_hash);
|
||||
|
||||
// Create a receipt for the transaction in block1.
|
||||
#[allow(clippy::needless_update)]
|
||||
let receipt1 = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
cumulative_gas_used: 12345,
|
||||
logs: vec![],
|
||||
success: true,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
// Wrap the receipt in a `Receipts` structure, as expected in the `ExecutionOutcome`.
|
||||
@ -385,13 +383,11 @@ mod tests {
|
||||
old_block1.set_hash(B256::new([0x01; 32]));
|
||||
|
||||
// Create a receipt for a transaction in the reverted block.
|
||||
#[allow(clippy::needless_update)]
|
||||
let old_receipt = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
cumulative_gas_used: 54321,
|
||||
logs: vec![],
|
||||
success: false,
|
||||
..Default::default()
|
||||
};
|
||||
let old_receipts = vec![vec![old_receipt.clone()]];
|
||||
|
||||
@ -416,13 +412,11 @@ mod tests {
|
||||
new_block1.set_hash(B256::new([0x02; 32]));
|
||||
|
||||
// Create a receipt for a transaction in the new committed block.
|
||||
#[allow(clippy::needless_update)]
|
||||
let new_receipt = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
cumulative_gas_used: 12345,
|
||||
logs: vec![],
|
||||
success: true,
|
||||
..Default::default()
|
||||
};
|
||||
let new_receipts = vec![vec![new_receipt.clone()]];
|
||||
|
||||
|
||||
@ -338,13 +338,11 @@ where
|
||||
}
|
||||
|
||||
cumulative_gas_used += exec_result.result.gas_used();
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
receipts.push(Receipt {
|
||||
tx_type: tx.tx_type(),
|
||||
success: exec_result.result.is_success(),
|
||||
cumulative_gas_used,
|
||||
logs: exec_result.result.into_logs().into_iter().collect(),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
// append transaction to the list of executed transactions
|
||||
|
||||
@ -110,7 +110,6 @@ mod tests {
|
||||
fn test_parse_deposit_from_log() {
|
||||
let receipts = vec![
|
||||
// https://etherscan.io/tx/0xa5239d4c542063d29022545835815b78b09f571f2bf1c8427f4765d6f5abbce9
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
// these don't matter
|
||||
tx_type: TxType::Legacy,
|
||||
@ -119,10 +118,8 @@ mod tests {
|
||||
logs: serde_json::from_str(
|
||||
r#"[{"address":"0x00000000219ab540356cbb839cbe05303d7705fa","topics":["0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"],"data":"0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030998c8086669bf65e24581cda47d8537966e9f5066fc6ffdcba910a1bfb91eae7a4873fcce166a1c4ea217e6b1afd396200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000001c340fb72ed14d4eaa71f7633ee9e33b88d4f3900000000000000000000000000000000000000000000000000000000000000080040597307000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006098ddbffd700c1aac324cfdf0492ff289223661eb26718ce3651ba2469b22f480d56efab432ed91af05a006bde0c1ea68134e0acd8cacca0c13ad1f716db874b44abfcc966368019753174753bca3af2ea84bc569c46f76592a91e97f311eddec0000000000000000000000000000000000000000000000000000000000000008e474160000000000000000000000000000000000000000000000000000000000","blockHash":"0x8d1289c5a7e0965b1d1bb75cdc4c3f73dda82d4ebb94ff5b98d1389cebd53b56","blockNumber":"0x12f0d8d","transactionHash":"0xa5239d4c542063d29022545835815b78b09f571f2bf1c8427f4765d6f5abbce9","transactionIndex":"0xc4","logIndex":"0x18f","removed":false}]"#
|
||||
).unwrap(),
|
||||
..Default::default()
|
||||
},
|
||||
// https://etherscan.io/tx/0xd9734d4e3953bcaa939fd1c1d80950ee54aeecc02eef6ae8179f47f5b7103338
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
// these don't matter
|
||||
tx_type: TxType::Legacy,
|
||||
@ -131,7 +128,6 @@ mod tests {
|
||||
logs: serde_json::from_str(
|
||||
r#"[{"address":"0x00000000219ab540356cbb839cbe05303d7705fa","topics":["0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"],"data":"0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030a1a2ba870a90e889aa594a0cc1c6feffb94c2d8f65646c937f1f456a315ef649533e25a4614d8f4f66ebdb06481b90af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000a0f04a231efbc29e1db7d086300ff550211c2f6000000000000000000000000000000000000000000000000000000000000000800405973070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060ad416d590e1a7f52baff770a12835b68904efad22cc9f8ba531e50cbbd26f32b9c7373cf6538a0577f501e4d3e3e63e208767bcccaae94e1e3720bfb734a286f9c017d17af46536545ccb7ca94d71f295e71f6d25bf978c09ada6f8d3f7ba0390000000000000000000000000000000000000000000000000000000000000008e374160000000000000000000000000000000000000000000000000000000000","blockHash":"0x8d1289c5a7e0965b1d1bb75cdc4c3f73dda82d4ebb94ff5b98d1389cebd53b56","blockNumber":"0x12f0d8d","transactionHash":"0xd9734d4e3953bcaa939fd1c1d80950ee54aeecc02eef6ae8179f47f5b7103338","transactionIndex":"0x7c","logIndex":"0xe2","removed":false}]"#,
|
||||
).unwrap(),
|
||||
..Default::default()
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -216,7 +216,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_default_spec() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
|
||||
@ -232,7 +231,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_custom_cfg() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
|
||||
@ -250,7 +248,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_custom_block_and_tx() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
|
||||
@ -272,7 +269,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_spec_id() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
|
||||
@ -290,7 +286,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_and_default_inspector() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
|
||||
@ -305,7 +300,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_inspector_and_custom_cfg() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
|
||||
@ -322,7 +316,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_inspector_and_custom_block_tx() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
|
||||
@ -340,7 +333,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn test_evm_with_env_inspector_and_spec_id() {
|
||||
let evm_config = EthEvmConfig::new(MAINNET.clone());
|
||||
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
|
||||
|
||||
@ -327,13 +327,11 @@ where
|
||||
cumulative_gas_used += gas_used;
|
||||
|
||||
// Push transaction changeset and calculate header bloom filter for receipt.
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
receipts.push(Receipt {
|
||||
tx_type: tx.tx_type(),
|
||||
success: result.is_success(),
|
||||
cumulative_gas_used,
|
||||
logs: result.into_logs().into_iter().collect(),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
// update add to total fees
|
||||
|
||||
@ -245,14 +245,12 @@ mod test {
|
||||
let MockReceipt { tx_type, status, cumulative_gas_used, logs, block_number: number } =
|
||||
exported_receipt;
|
||||
|
||||
#[allow(clippy::needless_update)]
|
||||
let receipt = Receipt {
|
||||
tx_type: TxType::try_from(tx_type.to_be_bytes()[0])
|
||||
.map_err(|err| FileClientError::Rlp(err.into(), vec![tx_type]))?,
|
||||
success: status != 0,
|
||||
cumulative_gas_used,
|
||||
logs,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Ok(Self { receipt, number })
|
||||
@ -386,13 +384,12 @@ mod test {
|
||||
.unwrap(),
|
||||
};
|
||||
|
||||
// #[allow(clippy::needless_update)] not recognised, ..Default::default() needed so optimism
|
||||
// feature must not be brought into scope
|
||||
let mut receipt = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
success: true,
|
||||
cumulative_gas_used: 202819,
|
||||
..Default::default()
|
||||
logs: vec![],
|
||||
};
|
||||
receipt.logs = vec![log_1, log_2, log_3];
|
||||
|
||||
@ -438,13 +435,11 @@ mod test {
|
||||
.unwrap(),
|
||||
};
|
||||
|
||||
// #[allow(clippy::needless_update)] not recognised, ..Default::default() needed so optimism
|
||||
// feature must not be brought into scope
|
||||
let mut receipt = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
success: true,
|
||||
cumulative_gas_used: 116237,
|
||||
..Default::default()
|
||||
logs: vec![],
|
||||
};
|
||||
receipt.logs = vec![log_1, log_2];
|
||||
|
||||
@ -490,8 +485,6 @@ mod test {
|
||||
.unwrap(),
|
||||
};
|
||||
|
||||
// #[allow(clippy::needless_update)] not recognised, ..Default::default() needed so optimism
|
||||
// feature must not be brought into scope
|
||||
let mut receipt = Receipt {
|
||||
tx_type: TxType::Legacy,
|
||||
success: true,
|
||||
@ -528,7 +521,6 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn receipts_codec() {
|
||||
// rig
|
||||
|
||||
|
||||
@ -105,7 +105,6 @@ mod tests {
|
||||
|
||||
// Test vector from: https://eips.ethereum.org/EIPS/eip-2481
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn encode_receipts() {
|
||||
let expected = hex!("f90172820457f9016cf90169f901668001b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85ff85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff");
|
||||
let mut data = vec![];
|
||||
@ -127,7 +126,6 @@ mod tests {
|
||||
),
|
||||
],
|
||||
success: false,
|
||||
..Default::default()
|
||||
},
|
||||
logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(),
|
||||
},
|
||||
@ -139,7 +137,6 @@ mod tests {
|
||||
|
||||
// Test vector from: https://eips.ethereum.org/EIPS/eip-2481
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn decode_receipts() {
|
||||
let data = hex!("f90172820457f9016cf90169f901668001b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85ff85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff");
|
||||
let request = RequestPair::<Receipts>::decode(&mut &data[..]).unwrap();
|
||||
@ -164,7 +161,6 @@ mod tests {
|
||||
),
|
||||
],
|
||||
success: false,
|
||||
..Default::default()
|
||||
},
|
||||
logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(),
|
||||
},
|
||||
|
||||
@ -330,7 +330,6 @@ pub(crate) mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::needless_update)]
|
||||
fn receipts_codec() {
|
||||
// rig
|
||||
|
||||
|
||||
@ -101,7 +101,6 @@ where
|
||||
db.basic(caller).map_err(Into::into)?.map(|acc| acc.nonce).unwrap_or_default()
|
||||
};
|
||||
|
||||
#[allow(clippy::needless_update)]
|
||||
let env = TxEnv {
|
||||
tx_type,
|
||||
gas_limit,
|
||||
|
||||
@ -115,13 +115,11 @@ where
|
||||
result: ExecutionResult<HaltReasonFor<Self::Evm>>,
|
||||
cumulative_gas_used: u64,
|
||||
) -> reth_provider::ProviderReceipt<Self::Provider> {
|
||||
#[allow(clippy::needless_update)]
|
||||
Receipt {
|
||||
tx_type: tx.tx_type(),
|
||||
success: result.is_success(),
|
||||
cumulative_gas_used,
|
||||
logs: result.into_logs().into_iter().collect(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,9 +207,7 @@ fn block1(number: BlockNumber) -> (RecoveredBlock<reth_primitives::Block>, Execu
|
||||
.revert_account_info(number, account2, Some(None))
|
||||
.state_storage(account1, HashMap::from_iter([(slot, (U256::ZERO, U256::from(10)))]))
|
||||
.build(),
|
||||
vec![vec![
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
vec![vec![Receipt {
|
||||
tx_type: TxType::Eip2930,
|
||||
success: true,
|
||||
cumulative_gas_used: 300,
|
||||
@ -218,9 +216,7 @@ fn block1(number: BlockNumber) -> (RecoveredBlock<reth_primitives::Block>, Execu
|
||||
vec![B256::with_last_byte(1), B256::with_last_byte(2)],
|
||||
Bytes::default(),
|
||||
)],
|
||||
..Default::default()
|
||||
},
|
||||
]],
|
||||
}]],
|
||||
number,
|
||||
Vec::new(),
|
||||
);
|
||||
@ -265,9 +261,7 @@ fn block2(
|
||||
)
|
||||
.revert_storage(number, account, Vec::from([(slot, U256::from(10))]))
|
||||
.build(),
|
||||
vec![vec![
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
vec![vec![Receipt {
|
||||
tx_type: TxType::Eip1559,
|
||||
success: false,
|
||||
cumulative_gas_used: 400,
|
||||
@ -276,9 +270,7 @@ fn block2(
|
||||
vec![B256::with_last_byte(3), B256::with_last_byte(4)],
|
||||
Bytes::default(),
|
||||
)],
|
||||
..Default::default()
|
||||
},
|
||||
]],
|
||||
}]],
|
||||
number,
|
||||
Vec::new(),
|
||||
);
|
||||
@ -332,9 +324,7 @@ fn block3(
|
||||
}
|
||||
let execution_outcome = ExecutionOutcome::new(
|
||||
bundle_state_builder.build(),
|
||||
vec![vec![
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
vec![vec![Receipt {
|
||||
tx_type: TxType::Eip1559,
|
||||
success: true,
|
||||
cumulative_gas_used: 400,
|
||||
@ -343,9 +333,7 @@ fn block3(
|
||||
vec![B256::with_last_byte(3), B256::with_last_byte(4)],
|
||||
Bytes::default(),
|
||||
)],
|
||||
..Default::default()
|
||||
},
|
||||
]],
|
||||
}]],
|
||||
number,
|
||||
Vec::new(),
|
||||
);
|
||||
@ -419,9 +407,7 @@ fn block4(
|
||||
}
|
||||
let execution_outcome = ExecutionOutcome::new(
|
||||
bundle_state_builder.build(),
|
||||
vec![vec![
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
vec![vec![Receipt {
|
||||
tx_type: TxType::Eip1559,
|
||||
success: true,
|
||||
cumulative_gas_used: 400,
|
||||
@ -430,9 +416,7 @@ fn block4(
|
||||
vec![B256::with_last_byte(3), B256::with_last_byte(4)],
|
||||
Bytes::default(),
|
||||
)],
|
||||
..Default::default()
|
||||
},
|
||||
]],
|
||||
}]],
|
||||
number,
|
||||
Vec::new(),
|
||||
);
|
||||
@ -503,9 +487,7 @@ fn block5(
|
||||
}
|
||||
let execution_outcome = ExecutionOutcome::new(
|
||||
bundle_state_builder.build(),
|
||||
vec![vec![
|
||||
#[allow(clippy::needless_update)] // side-effect of optimism fields
|
||||
Receipt {
|
||||
vec![vec![Receipt {
|
||||
tx_type: TxType::Eip1559,
|
||||
success: true,
|
||||
cumulative_gas_used: 400,
|
||||
@ -514,9 +496,7 @@ fn block5(
|
||||
vec![B256::with_last_byte(3), B256::with_last_byte(4)],
|
||||
Bytes::default(),
|
||||
)],
|
||||
..Default::default()
|
||||
},
|
||||
]],
|
||||
}]],
|
||||
number,
|
||||
Vec::new(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user