Function set_certified_data

Source
pub fn set_certified_data(data: &[u8])
šŸ‘ŽDeprecated since 0.18.0: Use certified_data_set instead
Expand description

Sets the certified data of this canister.

Canisters can store up to 32 bytes of data that is certified by the system on a regular basis. One can call data_certificate function from a query call to get a certificate authenticating the value set by calling this function.

This function can only be called from the following contexts: . - ā€œcanister_initā€, ā€œcanister_pre_upgradeā€ and ā€œcanister_post_upgradeā€ hooks. . - ā€œcanister_updateā€ calls. . - reply or reject callbacks.

§Panics

.- This function traps if data.len() > 32. .- This function traps if it’s called from an illegal context (e.g., from a query call).