pub fn verify(&self) -> Result<(), BlockValidationError> {
        let actual_block_header_hash = self.header().hash();
        if *self.hash() != actual_block_header_hash {
            return Err(BlockValidationError::UnexpectedBlockHash {
                block: Box::new(self.to_owned()),
                actual_block_header_hash,
            });
        }

        let actual_block_body_hash =
            Self::hash_block_body(&self.header.protocol_version, &self.body);
        if self.header.body_hash != actual_block_body_hash {
            return Err(BlockValidationError::UnexpectedBodyHash {
                block: Box::new(self.to_owned()),
                actual_block_body_hash,
            });
        }

        Ok(())
    }
/// Check the integrity of a block by hashing its body and header
Check the integrity of a block by hashing its body and header
Check the integrity of a block by hashing its body and header
pub fn verify(&self) -> Result<(), BlockValidationError> {
        let actual_block_header_hash = self.header().hash();
        if *self.hash() != actual_block_header_hash {
            return Err(BlockValidationError::UnexpectedBlockHash {
                block: Box::new(self.to_owned()),
                actual_block_header_hash,
            });
        }
        let actual_block_body_hash =
            Self::hash_block_body(&self.header.protocol_version, &self.body);
        if self.header.body_hash != actual_block_body_hash {
            return Err(BlockValidationError::UnexpectedBodyHash {
                block: Box::new(self.to_owned()),
                actual_block_body_hash,
            });
        }
        Ok(())
    }
pub fn verify ( & self ) -> Result < ( ) , BlockValidationError > { let actual_block_header_hash = self . header ( ) . hash ( ) ; if * self . hash ( ) != actual_block_header_hash { return Err ( BlockValidationError :: UnexpectedBlockHash { block : Box :: new ( self . to_owned ( ) ) , actual_block_header_hash , } ) ; } let actual_block_body_hash = Self :: hash_block_body ( & self . header . protocol_version , & self . body ) ; if self . header . body_hash != actual_block_body_hash { return Err ( BlockValidationError :: UnexpectedBodyHash { block : Box :: new ( self . to_owned ( ) ) , actual_block_body_hash , } ) ; } Ok ( ( ) ) }
Check the integrity of a block by hashing its body and header
Check the integrity of a block by hashing its body and header
&self
&self