Module ergo_tree

Source
Expand description

ErgoTree

Structs§

ErgoTree
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 of ErgoTree.
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 return Ok(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. Use ergo_tree_template_bytes_len to determine the length of the byte array.
ergo_tree_template_bytes_len
Return length of the &[u8] serialized representation of ErgoTree 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. Use ergo_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.

Type Aliases§

ConstErgoTreePtr
ErgoTreePtr