Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
chore(clippy): make clippy happy (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jul 28, 2022
1 parent b354102 commit 2a14e55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions ethers-core/src/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,23 +764,27 @@ mod tests {
#[test]
fn test_next_block_base_fee() {
// <https://etherscan.io/block/14402566>
let mut block_14402566 = Block::<TxHash>::default();
block_14402566.number = Some(U64::from(14402566u64));
block_14402566.base_fee_per_gas = Some(U256::from(36_803_013_756u128));
block_14402566.gas_limit = U256::from(30_087_887u128);
block_14402566.gas_used = U256::from(2_023_848u128);
let block_14402566: Block<TxHash> = Block {
number: Some(U64::from(14402566u64)),
base_fee_per_gas: Some(U256::from(36_803_013_756u128)),
gas_limit: U256::from(30_087_887u128),
gas_used: U256::from(2_023_848u128),
..Default::default()
};

assert_eq!(block_14402566.base_fee_per_gas, Some(U256::from(36_803_013_756u128)));
assert_eq!(block_14402566.gas_target(), U256::from(15_043_943u128));
// next block decreasing base fee https://etherscan.io/block/14402567
assert_eq!(block_14402566.next_block_base_fee(), Some(U256::from(32_821_521_542u128)));

// https://etherscan.io/block/14402712
let mut block_14402712 = Block::<TxHash>::default();
block_14402712.number = Some(U64::from(14402712u64));
block_14402712.base_fee_per_gas = Some(U256::from(24_870_031_149u128));
block_14402712.gas_limit = U256::from(30_000_000u128);
block_14402712.gas_used = U256::from(29_999_374u128);
let block_14402712: Block<TxHash> = Block {
number: Some(U64::from(14402712u64)),
base_fee_per_gas: Some(U256::from(24_870_031_149u128)),
gas_limit: U256::from(30_000_000u128),
gas_used: U256::from(29_999_374u128),
..Default::default()
};

assert_eq!(block_14402712.base_fee_per_gas, Some(U256::from(24_870_031_149u128)));
assert_eq!(block_14402712.gas_target(), U256::from(15_000_000u128));
Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/types/transaction/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ mod tests {

let addresses = raw_addresses
.iter()
.map(|addr| NameOrAddress::Address(Address::from_str(*addr).unwrap()));
.map(|addr| NameOrAddress::Address(Address::from_str(addr).unwrap()));

// decoding will do sender recovery and we don't expect any of these to error, so we should
// check that the address matches for each decoded transaction
Expand Down

0 comments on commit 2a14e55

Please sign in to comment.