Skip to main content

contract_hash_key_for_global_state

Function contract_hash_key_for_global_state 

Source
pub fn contract_hash_key_for_global_state(formatted: &str) -> String
Expand description

Maps a contract-shaped formatted key to the hash-… form used when AE is off.

With addressable entities disabled, account named keys often still store entity-contract-<hex>, but query_global_state and contract-info identifiers resolve hash-<hex> to StoredValue::Contract. Pass the named-key string through this helper before those queries.

  • entity-contract-<hex> → hash-<hex>
  • already hash-… → unchanged
  • bare hex (no prefix) → hash-<hex>
  • any other prefix → unchanged