mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: make clippy happy (#3291)
This commit is contained in:
@ -758,21 +758,19 @@ where
|
|||||||
head: Header,
|
head: Header,
|
||||||
state: ForkchoiceState,
|
state: ForkchoiceState,
|
||||||
) -> OnForkChoiceUpdated {
|
) -> OnForkChoiceUpdated {
|
||||||
// 7. Client software MUST ensure that payloadAttributes.timestamp is
|
// 7. Client software MUST ensure that payloadAttributes.timestamp is greater than timestamp
|
||||||
// greater than timestamp of a block referenced by
|
// of a block referenced by forkchoiceState.headBlockHash. If this condition isn't held
|
||||||
// forkchoiceState.headBlockHash. If this condition isn't held client
|
// client software MUST respond with -38003: `Invalid payload attributes` and MUST NOT
|
||||||
// software MUST respond with -38003: `Invalid payload attributes` and
|
// begin a payload build process. In such an event, the forkchoiceState update MUST NOT
|
||||||
// MUST NOT begin a payload build process. In such an event, the
|
// be rolled back.
|
||||||
// forkchoiceState update MUST NOT be rolled back.
|
|
||||||
if attrs.timestamp <= head.timestamp.into() {
|
if attrs.timestamp <= head.timestamp.into() {
|
||||||
return OnForkChoiceUpdated::invalid_payload_attributes()
|
return OnForkChoiceUpdated::invalid_payload_attributes()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 8. Client software MUST begin a payload build process building on top of
|
// 8. Client software MUST begin a payload build process building on top of
|
||||||
// forkchoiceState.headBlockHash and identified via buildProcessId value
|
// forkchoiceState.headBlockHash and identified via buildProcessId value if
|
||||||
// if payloadAttributes is not null and the forkchoice state has been
|
// payloadAttributes is not null and the forkchoice state has been updated successfully.
|
||||||
// updated successfully. The build process is specified in the Payload
|
// The build process is specified in the Payload building section.
|
||||||
// building section.
|
|
||||||
let attributes = PayloadBuilderAttributes::new(state.head_block_hash, attrs);
|
let attributes = PayloadBuilderAttributes::new(state.head_block_hash, attrs);
|
||||||
|
|
||||||
// send the payload to the builder and return the receiver for the pending payload id,
|
// 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
|
/// This method is going to return the batch as soon as one of the conditions below
|
||||||
/// is fulfilled:
|
/// is fulfilled:
|
||||||
/// 1. The number of non-empty headers in the batch equals requested.
|
/// 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)
|
/// 2. The total number of headers in the batch (both empty and non-empty) is greater than
|
||||||
/// is greater than or equal to the stream batch size.
|
/// or equal to the stream batch size.
|
||||||
/// 3. Downloader reached the end of the range
|
/// 3. Downloader reached the end of the range
|
||||||
///
|
///
|
||||||
/// NOTE: The batches returned have a variable length.
|
/// NOTE: The batches returned have a variable length.
|
||||||
|
|||||||
@ -368,11 +368,10 @@ mod tests {
|
|||||||
|
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// 1. If there are any entries in the [tables::TxSenders] table above
|
/// 1. If there are any entries in the [tables::TxSenders] table above a given block number.
|
||||||
/// a given block number.
|
|
||||||
///
|
///
|
||||||
/// 2. If the is no requested block entry in the bodies table,
|
/// 2. If the is no requested block entry in the bodies table, but [tables::TxSenders] is
|
||||||
/// but [tables::TxSenders] is not empty.
|
/// not empty.
|
||||||
fn ensure_no_senders_by_block(&self, block: BlockNumber) -> Result<(), TestRunnerError> {
|
fn ensure_no_senders_by_block(&self, block: BlockNumber) -> Result<(), TestRunnerError> {
|
||||||
let body_result = self.tx.inner_rw().block_body_indices(block);
|
let body_result = self.tx.inner_rw().block_body_indices(block);
|
||||||
match body_result {
|
match body_result {
|
||||||
|
|||||||
@ -327,11 +327,11 @@ mod tests {
|
|||||||
|
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// 1. If there are any entries in the [tables::TxHashNumber] table above
|
/// 1. If there are any entries in the [tables::TxHashNumber] table above a given block
|
||||||
/// a given block number.
|
/// number.
|
||||||
///
|
///
|
||||||
/// 2. If the is no requested block entry in the bodies table,
|
/// 2. If the is no requested block entry in the bodies table, but [tables::TxHashNumber] is
|
||||||
/// but [tables::TxHashNumber] is not empty.
|
/// not empty.
|
||||||
fn ensure_no_hash_by_block(&self, number: BlockNumber) -> Result<(), TestRunnerError> {
|
fn ensure_no_hash_by_block(&self, number: BlockNumber) -> Result<(), TestRunnerError> {
|
||||||
let body_result = self.tx.inner_rw().block_body_indices(number);
|
let body_result = self.tx.inner_rw().block_body_indices(number);
|
||||||
match body_result {
|
match body_result {
|
||||||
|
|||||||
Reference in New Issue
Block a user