refactor: Consensus trait error type (#13655)

This commit is contained in:
Tin Chung
2025-01-07 23:11:42 +07:00
committed by GitHub
parent b2c00418df
commit f7f2012156
33 changed files with 122 additions and 98 deletions

View File

@ -116,18 +116,17 @@ where
H: BlockHeader,
B: BlockBody,
{
type Error = ConsensusError;
fn validate_body_against_header(
&self,
body: &B,
header: &SealedHeader<H>,
) -> Result<(), ConsensusError> {
) -> Result<(), Self::Error> {
validate_body_against_header(body, header.header())
}
fn validate_block_pre_execution(
&self,
block: &SealedBlock<H, B>,
) -> Result<(), ConsensusError> {
fn validate_block_pre_execution(&self, block: &SealedBlock<H, B>) -> Result<(), Self::Error> {
validate_block_pre_execution(block, &self.chain_spec)
}
}