[][src]Function casperlabs_contract::ext_ffi::call_contract

pub unsafe extern "C" fn call_contract(
    contract_hash_ptr: *const u8,
    contract_hash_size: usize,
    entry_point_name_ptr: *const u8,
    entry_point_name_size: usize,
    runtime_args_ptr: *const u8,
    runtime_args_size: usize,
    result_size: *mut usize
) -> i32

Calls a contract by its hash. Requires entry point name that has to be present on a specified contract, and serialized named arguments. Returns a standard error code in case of failure, otherwise a successful execution returns zero. Bytes returned from contract execution are set to result_size pointer.

Arguments

  • contract_package_hash_ptr - pointer to serialized contract package hash.
  • contract_package_hash_size - size of contract package hash in serialized form.
  • entry_point_name_ptr - pointer to serialized contract entry point name
  • entry_point_name_size - size of serialized contract entry point name
  • runtime_args_ptr - pointer to serialized runtime arguments
  • runtime_args_size - size of serialized runtime arguments
  • result_size - a pointer to a value which will be set to a size of bytes of called contract return value