Skip to content

Commit

Permalink
chore: make clippy happy (paradigmxyz#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Jun 21, 2023
1 parent b1c77b3 commit 4dd9c9b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
18 changes: 8 additions & 10 deletions crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions crates/net/downloaders/src/bodies/bodies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions crates/stages/src/stages/sender_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions crates/stages/src/stages/tx_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4dd9c9b

Please sign in to comment.