Skip to main content

raw_NonnegativeIntSetAdd

Function raw_NonnegativeIntSetAdd 

Source
pub fn raw_NonnegativeIntSetAdd(
    key: &StorageKeyContractData,
    set_value: Option<&i128>,
    add_value: &i128,
) -> Result<(), SysErr>
Expand description

Sets or modifies a nonnegative integer at the specified storage key. The set_value (if provided) sets the base value, and add_value is added as a delta. The final value must remain nonnegative. Will overwrite any value of that key, even if that value has a different type.

§Arguments

§Inputs

  • key
  • set_value
  • add_value

§Outputs

  • None

This is a thin wrapper around uninit_NonnegativeIntSetAdd.

§Errors

  • kSyscallErrorCodeInvalidSyscallInput: The operation would always result in a negative value (i.e. set_add(1, -2)).