object ErgoTree extends Serializable
- Alphabetic
- By Inheritance
- ErgoTree
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type HeaderType = Byte with Tag[Byte, ErgoTree.HeaderType.Tag]
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val ConstantSegregationFlag: Byte
Header flag to indicate that constant segregation should be applied.
- val ConstantSegregationHeader: HeaderType
Default header with constant segregation enabled.
- val DefaultHeader: HeaderType
Default value of ErgoTree.header byte
- val EmptyConstants: IndexedSeq[Constant[SType]]
- val SizeFlag: Byte
Header flag to indicate that whole size of ErgoTree should be saved before tree content.
- val VersionFlag: Byte
Current version of ErgoTree serialization format (aka bite-code language version)
- val VersionMask: Byte
Header mask to extract version bits.
- val ZeroHeader: HeaderType
Header with all the flags set to 0 and version 0.
- def apply(header: HeaderType, constants: IndexedSeq[Constant[SType]], root: SigmaPropValue): ErgoTree
Create an ErgoTree with the given parameters.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def defaultHeaderWithVersion(version: Byte): HeaderType
Creates valid header byte with the given version.
Creates valid header byte with the given version. The SizeFlag is set if version > 0
- Annotations
- @inline()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromBytes(bytes: Array[Byte]): ErgoTree
Deserializes an ErgoTree instance from an array of bytes.
Deserializes an ErgoTree instance from an array of bytes.
- bytes
an array of bytes representing the serialized ErgoTree
- def fromHex(hex: String): ErgoTree
Deserializes an ErgoTree instance from a hexadecimal string.
Deserializes an ErgoTree instance from a hexadecimal string.
- hex
a hexadecimal string representing the serialized ErgoTree
- def fromProposition(header: HeaderType, prop: SigmaPropValue): ErgoTree
Create new ErgoTree for the given proposition using the given header flags.
Create new ErgoTree for the given proposition using the given header flags. If the property is not a simple constant, then constant segregation is performed.
- def fromProposition(prop: SigmaPropValue): ErgoTree
Create new ErgoTree for the given proposition using default header.
Create new ErgoTree for the given proposition using default header. If the property is not a simple constant, then constant segregation is performed.
- def fromSigmaBoolean(header: HeaderType, pk: SigmaBoolean): ErgoTree
Create new ErgoTree for the given sigma proposition using the given header flags and without performing constant segregation.
- def fromSigmaBoolean(pk: SigmaBoolean): ErgoTree
Create new ErgoTree for the given sigma proposition using default header and without performing constant segregation.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getVersion(header: HeaderType): Byte
- returns
a value of the version bits from the given header byte.
- Annotations
- @inline()
- final def hasSize(header: HeaderType): Boolean
- returns
true if the size flag is set to 1 in the given header byte.
- Annotations
- @inline()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def headerWithVersion(header: HeaderType, version: Byte): HeaderType
Creates valid header byte with the given version.
Creates valid header byte with the given version. The SizeFlag is set if version > 0
- Annotations
- @inline()
- final def isConstantSegregation(header: HeaderType): Boolean
- returns
true if the constant segregation flag is set to 1 in the given header byte.
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def setConstantSegregation(header: HeaderType): HeaderType
Sets the ConstantSegregationFlag in the given header
Sets the ConstantSegregationFlag in the given header
- Annotations
- @inline()
- final def setRequiredBits(header: HeaderType): HeaderType
Sets the required bit in the given header: - The SizeFlag is set if version > 0
Sets the required bit in the given header: - The SizeFlag is set if version > 0
- Annotations
- @inline()
- final def setSizeBit(header: HeaderType): HeaderType
Sets the ConstantSegregationFlag in the given header
Sets the ConstantSegregationFlag in the given header
- Annotations
- @inline()
- final def setVersionBits(header: HeaderType, version: Byte): HeaderType
Update the version bits of the given header byte with the given version value, leaving all other bits unchanged.
Update the version bits of the given header byte with the given version value, leaving all other bits unchanged.
- Annotations
- @inline()
- def substConstants(root: SValue, constants: IndexedSeq[Constant[SType]]): SValue
Substitute ConstantPlaceholder nodes in the given expression with the constants taken from the given collection.
Substitute ConstantPlaceholder nodes in the given expression with the constants taken from the given collection.
- root
expression to transform
- constants
collection of constants to replace placeholders
- returns
new expression without placeholders
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withSegregation(header: HeaderType, prop: SigmaPropValue): ErgoTree
Build ErgoTree via serialization of the value with ConstantSegregationHeader, constants segregated from the tree and ConstantPlaceholders referring to the segregated constants.
Build ErgoTree via serialization of the value with ConstantSegregationHeader, constants segregated from the tree and ConstantPlaceholders referring to the segregated constants.
This method uses single traverse of the tree to: 1) find and segregate all constants; 2) replace constants with ConstantPlaceholders in the
tree
; 3) write thetree
to the Writer's buffer obtainingtreeBytes
; 4) deserializetree
with ConstantPlaceholders.- prop
expression to be transformed into ErgoTree
- def withoutSegregation(header: HeaderType, root: SigmaPropValue): ErgoTree
Create new ErgoTree for the given proposition using the given header flags and without performing constant segregation.
- object HeaderType extends TaggedType[Byte]
Represents information in ErgoTree header.