Skip to main content

op_contract_digest

Function op_contract_digest 

pub fn op_contract_digest(schema: &Schema, key: &str) -> Option<[u8; 32]>
Expand description

The digest of the op key (an RPC op_id, or "<METHOD> <route>" on REST), or None when the schema exposes no such op.

let schema: cratestack_core::Schema = serde_json::from_str(
    r#"{"datasource":null,"auth":null,"config_blocks":[],"mixins":[],
        "models":[],"types":[],"enums":[],"procedures":[]}"#,
)
.unwrap();
assert!(cratestack_core::op_contract_digest(&schema, "procedure.ping").is_none());
assert!(cratestack_core::op_contract_digests(&schema).is_empty());