Function darkfi::runtime::import::db::db_get

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

Reads a value by key from the key-value store.

This function can be called from the Deploy, Exec, or Metadata ContractSection.

On success, returns the length of the objects Vector in the environment. Otherwise, returns an error code.

Permissions: deploy, metadata, exec