db_lookup

Function db_lookup 

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

Lookup an on-chain database handle from its name. If it exists, push it to the list of db_handles.

Returns the index of the DbHandle in the db_handles Vector on success. Otherwise, returns an error value.

This function can be called from any ContractSection.

ยงPermissions

  • ContractSection::Deploy
  • ContractSection::Metadata
  • ContractSection::Exec
  • ContractSection::Update