[][src]Function casperlabs_contract::ext_ffi::write

pub unsafe extern "C" fn write(
    key_ptr: *const u8,
    key_size: usize,
    value_ptr: *const u8,
    value_size: usize
)

This function writes the provided value (read via de-serializing the bytes in wasm memory from offset value_ptr to value_ptr + value_size) under the provided key (read via de-serializing the bytes in wasm memory from offset key_ptr to key_ptr + key_size) in the global state. This function will cause a Trap if the key or value fail to de-serialize or if writing to that key is not permitted.

Arguments

  • key_ptr - pointer to bytes representing the key to write to
  • key_size - size of the key (in bytes)
  • value_ptr - pointer to bytes representing the value to write at the key
  • value_size - size of the value (in bytes)