Module ergo_lib_c_core::ergo_tree
source · Expand description
ErgoTree
Structs
- The root of ErgoScript IR. Serialized instances of this class are self sufficient and can be passed around.
Functions
- Return length of the
&[u8]
serialized representation ofErgoTree
. - Returns constants number as stored in serialized ErgoTree or error if the parsing of constants failed
- Decode from base16 encoded serialized ErgoTree
- Decode from encoded serialized ErgoTree
- If constant with given index (as stored in serialized ErgoTree) exists, allocate it and store in
constant_out
and returnOk(true)
. If constant doesn’t exist at the given index return Ok(false). If parsing failed then return error. - Serialized proposition expression of SigmaProp type with ConstantPlaceholder nodes instead of Constant nodes. Key assumption: enough memory has been allocated at the address pointed-to by
output
. Useergo_tree_template_bytes_len
to determine the length of the byte array. - Return length of the
&[u8]
serialized representation ofErgoTree
template. - Convert to base16-encoded serialized bytes
- Convert to serialized bytes. Key assumption: enough memory has been allocated at the address pointed-to by
output
. Useergo_tree_bytes_len
to determine the length of the byte array. - Returns new ErgoTree instance with a new constant value for a given index in constants list (as stored in serialized ErgoTree), or an error. Note that the original ErgoTree instance pointed-at by
ergo_tree_ptr
is untouched.