case class SubstConstants[T <: SType](scriptBytes: Value[SByteArray], positions: Value[SIntArray], newValues: Value[SCollection[T]]) extends NotReadyValueByteArray with Product with Serializable
Transforms serialized bytes of ErgoTree with segregated constants by replacing constants at given positions with new values. This operation allow to use serialized scripts as pre-defined templates. The typical usage is "check that output box have proposition equal to given script bytes, where minerPk (constants(0)) is replaced with currentMinerPk". Each constant in original scriptBytes have SType serialized before actual data (see ConstantSerializer). During substitution each value from newValues is checked to be an instance of the corresponding type. This means, the constants during substitution cannot change their types.
- scriptBytes
serialized ErgoTree with ConstantSegregationFlag set to 1.
- positions
zero based indexes in ErgoTree.constants array which should be replaced with new values
- newValues
new values to be injected into the corresponding positions in ErgoTree.constants array
- returns
original scriptBytes array where only specified constants are replaced and all other bytes remain exactly the same
- Alphabetic
- By Inheritance
- SubstConstants
- Serializable
- Serializable
- NotReadyValueByteArray
- NotReadyValue
- Value
- SigmaNode
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
SubstConstants(scriptBytes: Value[SByteArray], positions: Value[SIntArray], newValues: Value[SCollection[T]])
- scriptBytes
serialized ErgoTree with ConstantSegregationFlag set to 1.
- positions
zero based indexes in ErgoTree.constants array which should be replaced with new values
- newValues
new values to be injected into the corresponding positions in ErgoTree.constants array
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
companion: SubstConstants.type
- Definition Classes
- SubstConstants → Value
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val newValues: Value[SCollection[T]]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
opCode: OpCode
Unique id of the node class used in serialization of ErgoTree.
Unique id of the node class used in serialization of ErgoTree.
- Definition Classes
- Value
-
def
opName: String
- Definition Classes
- Value
-
val
opType: SFunc
Every value represents an operation and that operation can be associated with a function type, describing functional meaning of the operation, kind of operation signature.
Every value represents an operation and that operation can be associated with a function type, describing functional meaning of the operation, kind of operation signature. Thus we can obtain global operation identifiers by combining Value.opName with Value.opType, so that if (v1.opName == v2.opName) && (v1.opType == v2.opType) then v1 and v2 are functionally point-wise equivalent. This in particular means that if two _different_ ops have the same opType they _should_ have different opNames. Thus defined op ids are used in a Cost Model - a table of all existing primitives coupled with performance parameters.
- Definition Classes
- SubstConstants → Value
- val positions: Value[SIntArray]
- val scriptBytes: Value[SByteArray]
-
def
sourceContext: Nullable[SourceContext]
- Definition Classes
- Value
-
def
sourceContext_=(srcCtx: Nullable[SourceContext]): Unit
- Definition Classes
- Value
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tpe: SCollection[SByte.type]
The type of the value represented by this node.
The type of the value represented by this node. If the value is an operation it is the type of operation result.
- Definition Classes
- NotReadyValueByteArray → Value
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()