Module darkfi_sdk::wasm::util
source ยท Expand description
Utility functions
Functionsยง
- Everyone can call this. Will return runtime configured block target.
- get_block_target_ ๐ โ
- Everyone can call this. Will return current blockchain timestamp.
- get_blockchain_time_ ๐ โ
- Only deploy(), metadata() and exec() can call this. Will return runtime configured verifying block height.
- get_call_index_ ๐ โ
- Only exec() can call this. Will return last block height.
- get_last_block_height_ ๐ โ
- Internal function, get raw bytes from the objects store
- get_object_bytes_ ๐ โ
- Internal function, get bytes size for an object in the store
- get_object_size_ ๐ โ
- Only metadata() and exec() can call this. Will return transaction bytes by provided hash.
- get_tx_ ๐ โ
- Only deploy(), metadata() and exec() can call this. Will return runtime configured transaction hash.
- get_tx_hash_ ๐ โ
- Only metadata() and exec() can call this. Will return transaction location by provided hash.
- get_tx_location_ ๐ โ
- Everyone can call this. Will return runtime configured verifying block height.
- get_verifying_block_height_ ๐ โ
- parse_ret ๐Auxiliary function to parse db_get return value. If either of these functions returns a negative integer error code, convert it into a
ContractError
. - parse_retval_u32 ๐
- Calls the
set_return_data
WASM function. Returns Ok(()) on success. Otherwise, convert the i64 error code into aContractError
. - set_return_data_ ๐ โ