Function casper_contract::ext_ffi::casper_read_value[][src]

pub unsafe extern "C" fn casper_read_value(
    key_ptr: *const u8,
    key_size: usize,
    output_size: *mut usize
) -> i32
Expand description

The bytes in the span of wasm memory from key_ptr to key_ptr + key_size must correspond to a valid global state key, otherwise the function will fail. If the key is de-serialized successfully, then the result of the read is serialized and buffered in the runtime. This result can be obtained via the casper_read_host_buffer function. Returns standard error code.

Arguments

  • key_ptr - pointer (offset in wasm linear memory) to serialized form of the key to read
  • key_size - size of the serialized key (in bytes)
  • output_size - pointer to a value where host will write size of bytes read from given key