slot_set

Locate an object based on its keylet and place it into a slot

Behaviour

  • Locate an object given the Keylet provided in read_ptr

  • Emplace the located object into the slot specified or into a new slot if no slot (zero) is specified

Definition

C

int64_t slot_set (
    uint32_t read_ptr,
    uint32_t read_len,
  	uint32_t slot_no
);

Example

C

int64_t slot_no = 
  slot_set(keylet, 34, 0);

Parameters

Name
Type
Description

read_ptr

uint32_t

Pointer to a buffer containing the keylet of the object to locate. This can also be a txn hash.

read_len

uint32_t

Length of the read buffer. Should always be 32 or 34.

slot_no

uint32_t

The slot number to emplace into, or 0 if you wish to pick the next available.

Return Code

Type
Description

int64_t

The slot number the object was inserted into If negative, an error: OUT_OF_BOUNDS - pointers/lengths specified outside of hook memory. INVALID_ARGUMENT - read_len must be either 32 or 34 bytes depending on whether a txn hash or a keylet is being used in read_ptr - the hash or keylet was invalid DOESNT_EXIST - the requested object was not found

Last updated