Expand description
ErgoTree
Structs§
- Ergo
Tree - The root of ErgoScript IR. Serialized instances of this class are self sufficient and can be passed around.
Functions§
- ergo_
tree_ ⚠bytes_ len - Return length of the
&[u8]
serialized representation ofErgoTree
. - ergo_
tree_ ⚠constants_ len - Returns constants number as stored in serialized ErgoTree or error if the parsing of constants failed
- ergo_
tree_ ⚠from_ base16_ bytes - Decode from base16 encoded serialized ErgoTree
- ergo_
tree_ ⚠from_ bytes - Decode from encoded serialized ErgoTree
- ergo_
tree_ ⚠get_ constant - 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. - ergo_
tree_ ⚠template_ bytes - 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. - ergo_
tree_ ⚠template_ bytes_ len - Return length of the
&[u8]
serialized representation ofErgoTree
template. - ergo_
tree_ ⚠to_ base16_ bytes - Convert to base16-encoded serialized bytes
- ergo_
tree_ ⚠to_ 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. - ergo_
tree_ ⚠with_ constant - 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.