Skip to main content

SetStorageFlags

Function SetStorageFlags 

Source
pub fn SetStorageFlags(
    key: &StorageKeyContractData,
    flags: u32,
) -> Result<(), SysErr>
Expand description

Adds flags (a bitwise OR) to the storage flags the current transaction requests for the key. Writes never change a key’s flags: every change the transaction commits on the key carries the flags accumulated here, whichever write produced it. ClearStorageFlags removes them. A write to the key must be pending in the current call frame’s view of the transaction: one made earlier in this frame, or inherited from a caller or from a successful callee. A pending deletion qualifies; a value that exists only in the block snapshot does not. Flags set in a frame that aborts are discarded along with that frame’s writes.

§Arguments

  • key
  • flags

This is a convenience wrapper around uninit_SetStorageFlags that returns the result as SyscallResult<T>.

§Errors

  • kSyscallErrorCodeInvalidSyscallInput: The flags are invalid, or no write to the key is pending in the current call frame’s view of the transaction.