Skip to main content

compute_leaf_hash

Function compute_leaf_hash 

Source
pub fn compute_leaf_hash(
    asset_id: u32,
    transfer_count: u64,
    funding_account: &[u8; 32],
    wormhole_address: &[u8; 32],
    amount: u128,
) -> [u8; 32]
Expand description

Compute the leaf hash (leaf_inputs_hash) for storage proof verification.

This uses Poseidon2 hashing via hash_storage to match the chain’s PoseidonStorageHasher behavior.

§Arguments

  • asset_id - Asset ID (0 for native token)
  • transfer_count - Atomic transfer counter
  • funding_account - Sender account as 32 bytes
  • wormhole_address - Recipient (unspendable) account as 32 bytes
  • amount - Transfer amount in planck

§Returns

32-byte leaf hash