fix: consensus validation method typo (#2432)

This commit is contained in:
Roman Krasiuk
2023-04-27 17:04:50 +03:00
committed by GitHub
parent 0d20d34eaf
commit 576f33b151
7 changed files with 8 additions and 7 deletions

View File

@ -151,7 +151,7 @@ impl AppendableChain {
{
externals.consensus.validate_header_with_total_difficulty(&block, U256::MAX)?;
externals.consensus.validate_header(&block)?;
externals.consensus.validate_header_agains_parent(&block, parent_block)?;
externals.consensus.validate_header_against_parent(&block, parent_block)?;
externals.consensus.validate_block(&block)?;
let (unseal, senders) = block.into_components();

View File

@ -54,7 +54,7 @@ impl Consensus for AutoSealConsensus {
Ok(())
}
fn validate_header_agains_parent(
fn validate_header_against_parent(
&self,
_header: &SealedHeader,
_parent: &SealedHeader,

View File

@ -28,7 +28,7 @@ impl Consensus for BeaconConsensus {
Ok(())
}
fn validate_header_agains_parent(
fn validate_header_against_parent(
&self,
header: &SealedHeader,
parent: &SealedHeader,

View File

@ -25,7 +25,7 @@ pub trait Consensus: Debug + Send + Sync {
/// **This should not be called for the genesis block**.
///
/// Note: Validating header against its parent does not include other Consensus validations.
fn validate_header_agains_parent(
fn validate_header_against_parent(
&self,
header: &SealedHeader,
parent: &SealedHeader,

View File

@ -79,7 +79,7 @@ pub fn validate_header_download(
ensure_parent(header, parent)?;
// validate header against parent
consensus
.validate_header_agains_parent(header, parent)
.validate_header_against_parent(header, parent)
.map_err(|error| DownloadError::HeaderValidation { hash: parent.hash(), error })?;
// validate header standalone
consensus

View File

@ -156,7 +156,7 @@ impl Stream for TestDownload {
}
let empty = SealedHeader::default();
if let Err(error) = this.consensus.validate_header_agains_parent(&empty, &empty) {
if let Err(error) = this.consensus.validate_header_against_parent(&empty, &empty) {
this.done = true;
return Poll::Ready(Some(Err(DownloadError::HeaderValidation {
hash: empty.hash(),
@ -314,7 +314,7 @@ impl Consensus for TestConsensus {
}
}
fn validate_header_agains_parent(
fn validate_header_against_parent(
&self,
header: &SealedHeader,
parent: &SealedHeader,

View File

@ -170,6 +170,7 @@ where
cursor_header.insert(header_number, header)?;
cursor_canonical.insert(header_number, header_hash)?;
}
Ok(latest)
}
}