From 4dd9c9b25a4dc4c5dbc8777ac7c633757521495a Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Tue, 20 Jun 2023 22:07:14 -0400 Subject: [PATCH] chore: make clippy happy (#3291) --- crates/consensus/beacon/src/engine/mod.rs | 18 ++++++++---------- crates/net/downloaders/src/bodies/bodies.rs | 4 ++-- crates/stages/src/stages/sender_recovery.rs | 7 +++---- crates/stages/src/stages/tx_lookup.rs | 8 ++++---- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/crates/consensus/beacon/src/engine/mod.rs b/crates/consensus/beacon/src/engine/mod.rs index ca681adb0bb9..909cf36747ca 100644 --- a/crates/consensus/beacon/src/engine/mod.rs +++ b/crates/consensus/beacon/src/engine/mod.rs @@ -758,21 +758,19 @@ where head: Header, state: ForkchoiceState, ) -> OnForkChoiceUpdated { - // 7. Client software MUST ensure that payloadAttributes.timestamp is - // greater than timestamp of a block referenced by - // forkchoiceState.headBlockHash. If this condition isn't held client - // software MUST respond with -38003: `Invalid payload attributes` and - // MUST NOT begin a payload build process. In such an event, the - // forkchoiceState update MUST NOT be rolled back. + // 7. Client software MUST ensure that payloadAttributes.timestamp is greater than timestamp + // of a block referenced by forkchoiceState.headBlockHash. If this condition isn't held + // client software MUST respond with -38003: `Invalid payload attributes` and MUST NOT + // begin a payload build process. In such an event, the forkchoiceState update MUST NOT + // be rolled back. if attrs.timestamp <= head.timestamp.into() { return OnForkChoiceUpdated::invalid_payload_attributes() } // 8. Client software MUST begin a payload build process building on top of - // forkchoiceState.headBlockHash and identified via buildProcessId value - // if payloadAttributes is not null and the forkchoice state has been - // updated successfully. The build process is specified in the Payload - // building section. + // forkchoiceState.headBlockHash and identified via buildProcessId value if + // payloadAttributes is not null and the forkchoice state has been updated successfully. + // The build process is specified in the Payload building section. let attributes = PayloadBuilderAttributes::new(state.head_block_hash, attrs); // send the payload to the builder and return the receiver for the pending payload id, diff --git a/crates/net/downloaders/src/bodies/bodies.rs b/crates/net/downloaders/src/bodies/bodies.rs index 9d8287674faa..acc61f65b0ca 100644 --- a/crates/net/downloaders/src/bodies/bodies.rs +++ b/crates/net/downloaders/src/bodies/bodies.rs @@ -88,8 +88,8 @@ where /// This method is going to return the batch as soon as one of the conditions below /// is fulfilled: /// 1. The number of non-empty headers in the batch equals requested. - /// 2. The total number of headers in the batch (both empty and non-empty) - /// is greater than or equal to the stream batch size. + /// 2. The total number of headers in the batch (both empty and non-empty) is greater than + /// or equal to the stream batch size. /// 3. Downloader reached the end of the range /// /// NOTE: The batches returned have a variable length. diff --git a/crates/stages/src/stages/sender_recovery.rs b/crates/stages/src/stages/sender_recovery.rs index 2fe297e4be67..ba60007ac7ae 100644 --- a/crates/stages/src/stages/sender_recovery.rs +++ b/crates/stages/src/stages/sender_recovery.rs @@ -368,11 +368,10 @@ mod tests { /// # Panics /// - /// 1. If there are any entries in the [tables::TxSenders] table above - /// a given block number. + /// 1. If there are any entries in the [tables::TxSenders] table above a given block number. /// - /// 2. If the is no requested block entry in the bodies table, - /// but [tables::TxSenders] is not empty. + /// 2. If the is no requested block entry in the bodies table, but [tables::TxSenders] is + /// not empty. fn ensure_no_senders_by_block(&self, block: BlockNumber) -> Result<(), TestRunnerError> { let body_result = self.tx.inner_rw().block_body_indices(block); match body_result { diff --git a/crates/stages/src/stages/tx_lookup.rs b/crates/stages/src/stages/tx_lookup.rs index 5f3cd7056b23..d59209007efa 100644 --- a/crates/stages/src/stages/tx_lookup.rs +++ b/crates/stages/src/stages/tx_lookup.rs @@ -327,11 +327,11 @@ mod tests { /// # Panics /// - /// 1. If there are any entries in the [tables::TxHashNumber] table above - /// a given block number. + /// 1. If there are any entries in the [tables::TxHashNumber] table above a given block + /// number. /// - /// 2. If the is no requested block entry in the bodies table, - /// but [tables::TxHashNumber] is not empty. + /// 2. If the is no requested block entry in the bodies table, but [tables::TxHashNumber] is + /// not empty. fn ensure_no_hash_by_block(&self, number: BlockNumber) -> Result<(), TestRunnerError> { let body_result = self.tx.inner_rw().block_body_indices(number); match body_result {