compute_auth_wit_message_hash

Function compute_auth_wit_message_hash 

Source
pub fn compute_auth_wit_message_hash(
    intent: &MessageHashOrIntent,
    chain_info: &ChainInfo,
) -> Fr
Expand description

Compute the full authwit message hash from an intent and chain info.

For MessageHashOrIntent::Hash — returns the hash directly. For MessageHashOrIntent::Intent { caller, call }:

  1. inner_hash = compute_inner_auth_wit_hash_from_action(caller, call)
  2. consumer = call.to (the contract being called)
  3. outer_hash = compute_outer_auth_wit_hash(consumer, chain_id, version, inner_hash)

For MessageHashOrIntent::InnerHash { consumer, inner_hash }:

  1. outer_hash = compute_outer_auth_wit_hash(consumer, chain_id, version, inner_hash)

Mirrors TS computeAuthWitMessageHash(intent, metadata).