Function darkfi::runtime::import::db::db_set

source ยท
pub(crate) fn db_set(
    ctx: FunctionEnvMut<'_, Env>,
    ptr: WasmPtr<u8>,
    ptr_len: u32,
) -> i64
Expand description

Set a value within the transaction.

  • ptr must contain the DbHandle index and the key-value pair.
  • The DbHandle must match the ContractId.

This function can be called only from the Deploy or Update ContractSection. Returns SUCCESS on success, otherwise returns an error value.

Permissions: deploy, update