mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(clippy): enable if_then_some_else_none lint (#11679)
Signed-off-by: jsvisa <delweng@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -212,14 +212,12 @@ where
|
||||
let block = payload.block();
|
||||
|
||||
let cancun_fields =
|
||||
if self.provider.chain_spec().is_cancun_active_at_timestamp(block.timestamp) {
|
||||
Some(CancunPayloadFields {
|
||||
self.provider.chain_spec().is_cancun_active_at_timestamp(block.timestamp).then(|| {
|
||||
CancunPayloadFields {
|
||||
parent_beacon_block_root: block.parent_beacon_block_root.unwrap(),
|
||||
versioned_hashes: block.blob_versioned_hashes().into_iter().copied().collect(),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
self.to_engine.send(BeaconEngineMessage::NewPayload {
|
||||
|
||||
@ -31,16 +31,14 @@ where
|
||||
timestamp,
|
||||
prev_randao: B256::random(),
|
||||
suggested_fee_recipient: Address::random(),
|
||||
withdrawals: if self.chain_spec.is_shanghai_active_at_timestamp(timestamp) {
|
||||
Some(Default::default())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
parent_beacon_block_root: if self.chain_spec.is_cancun_active_at_timestamp(timestamp) {
|
||||
Some(B256::random())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
withdrawals: self
|
||||
.chain_spec
|
||||
.is_shanghai_active_at_timestamp(timestamp)
|
||||
.then(Default::default),
|
||||
parent_beacon_block_root: self
|
||||
.chain_spec
|
||||
.is_cancun_active_at_timestamp(timestamp)
|
||||
.then(B256::random),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user