pub fn validate_operation<E>(
operation: &Operation<E>,
) -> Result<(), OperationError>where
E: Extensions,Expand description
Validate the header and body (when provided) of a single operation. All basic header
validation is performed (identical to validate_header) and additionally the body bytes
hash and size are checked to be correct.
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_hashis set thepayload_sizeis >0otherwise it is zero - If
backlinkis set thenseq_numis >0otherwise it is zero - If provided the body bytes hash and size match those claimed in the header