validate_header

Function validate_header 

Source
pub fn validate_header<E>(header: &Header<E>) -> Result<(), OperationError>
where E: Extensions,
Expand description

Validate an operation header.

This method validates that the following conditions are true:

  • Signature can be verified against the author public key and unsigned header bytes
  • Header version is supported (currently only version 1 is supported)
  • If payload_hash is set the payload_size is > 0 otherwise it is zero
  • If backlink is set then seq_num is > 0 otherwise it is zero