mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
chore: make clippy happy (#3291)
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user