/// Parses a response of the "get_certified_changes_since" registry method,
/// validates data integrity and authenticity and returns
///   * The list of changes to apply.
///   * The latest version available (might be greater than the version of the
///     last received delta if there were too many deltas to send in one go).
///   * The time when the received data was last certified by the subnet.
Parses a response of the "get_certified_changes_since" registry method,
validates data integrity and authenticity and returns
The list of changes to apply.
The latest version available (might be greater than the version of the
last received delta if there were too many deltas to send in one go).
The time when the received data was last certified by the subnet.
Parses a response of the " get_certified_changes_since " registry method validates data integrity and authenticity and returns The list of changes to apply . The latest version available ( might be greater than the version of the last received delta if there were too many deltas to send in one go ) . The time when the received data was last certified by the subnet .
pub fn decode_certified_deltas(
    since_version: u64,
    canister_id: &CanisterId,
    nns_pk: &ThresholdSigPublicKey,
    payload: &[u8],
) -> Result<(Vec<RegistryTransportRecord>, RegistryVersion, Time), CertificationError> {
    let certified_response = CertifiedResponse::decode(payload).map_err(|err| {
        CertificationError::DeserError(format!(
            "failed to decode certified response from {}: {:?}",
            canister_id, err
        ))
    })?;
    // Extract the hash trees from the canister response.
    let hash_tree = certified_response.hash_tree.ok_or_else(|| {
        CertificationError::MalformedHashTree(
            "certified response has an empty hash tree".to_string(),
        )
    })?;
    let mixed_hash_tree = MixedHashTree::try_from(hash_tree).map_err(|err| {
        CertificationError::DeserError(format!(
            "failed to deserialize MixedHashTree from {}: {:?}",
            canister_id, err
        ))
    })?;
    // Verify the authenticity of the root hash stored by the canister in the
    // certified_data field, and get the time on the certificate.
    let time = verify_certificate(
        &certified_response.certificate[..],
        canister_id,
        nns_pk,
        mixed_hash_tree.digest().as_bytes(),
    )
    .map_err(embed_certificate_error)?;
    let (changes, current_version) = decode_hash_tree(since_version, mixed_hash_tree)?;
    Ok((changes, current_version, time))
}
pub fn decode_certified_deltas ( since_version : u64 , canister_id : & CanisterId , nns_pk : & ThresholdSigPublicKey , payload : & [ u8 ] , ) -> Result < ( Vec < RegistryTransportRecord > , RegistryVersion , Time ) , CertificationError > { let certified_response = CertifiedResponse :: decode ( payload ) . map_err ( | err | { CertificationError :: DeserError ( format ! ( " " canister_id err ) ) } ) ? ; // Extract the hash trees from the canister response. let hash_tree = certified_response . hash_tree . ok_or_else ( | | { CertificationError :: MalformedHashTree ( " " . to_string ( ) , ) } ) ? ; let mixed_hash_tree = MixedHashTree :: try_from ( hash_tree ) . map_err ( | err | { CertificationError :: DeserError ( format ! ( " " canister_id err ) ) } ) ? ; // Verify the authenticity of the root hash stored by the canister in the // certified_data field, and get the time on the certificate. let time = verify_certificate ( & certified_response . certificate [ .. ] , canister_id , nns_pk , mixed_hash_tree . digest ( ) . as_bytes ( ) , ) . map_err ( embed_certificate_error ) ? ; let ( changes , current_version ) = decode_hash_tree ( since_version , mixed_hash_tree ) ? ; Ok ( ( changes , current_version , time ) ) }
Parses a response of the "get_certified_changes_since" registry method,
validates data integrity and authenticity and returns
 The list of changes to apply.
Parses a response of the " get_certified_changes_since " registry method validates data integrity and authenticity and returns The list of changes to apply .
since_version
u64
canister_id
&CanisterId
nns_pk
&ThresholdSigPublicKey
payload
&[u8]