Expand description
Utility functions
Functionsยง
- get_
block_ target - Everyone can call this. Will return runtime configured block target.
- get_
block_ ๐ โtarget_ - get_
blockchain_ time - Everyone can call this. Will return current blockchain timestamp.
- get_
blockchain_ ๐ โtime_ - get_
call_ index - Only deploy(), metadata() and exec() can call this. Will return runtime configured verifying block height.
- get_
call_ ๐ โindex_ - get_
last_ block_ height - Only exec() can call this. Will return last block height.
- get_
last_ ๐ โblock_ height_ - get_
object_ bytes - Internal function, get raw bytes from the objects store
- get_
object_ ๐ โbytes_ - get_
object_ size - Internal function, get bytes size for an object in the store
- get_
object_ ๐ โsize_ - get_tx
- Only metadata() and exec() can call this. Will return transaction bytes by provided hash.
- get_tx_ ๐ โ
- get_
tx_ hash - Only deploy(), metadata() and exec() can call this. Will return runtime configured transaction hash.
- get_
tx_ ๐ โhash_ - get_
tx_ location - Only metadata() and exec() can call this. Will return transaction location by provided hash.
- get_
tx_ ๐ โlocation_ - get_
verifying_ block_ height - 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 - set_
return_ data - Calls the
set_return_data
WASM function. Returns Ok(()) on success. Otherwise, convert the i64 error code into aContractError
. - set_
return_ ๐ โdata_