Class/Object

sigmastate

SubstConstants

Related Docs: object SubstConstants | package sigmastate

Permalink

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

Linear Supertypes
Serializable, Serializable, NotReadyValueByteArray, NotReadyValue[SByteArray], Value[SByteArray], SigmaNode, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SubstConstants
  2. Serializable
  3. Serializable
  4. NotReadyValueByteArray
  5. NotReadyValue
  6. Value
  7. SigmaNode
  8. Product
  9. Equals
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SubstConstants(scriptBytes: Value[SByteArray], positions: Value[SIntArray], newValues: Value[SCollection[T]])

    Permalink

    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

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  6. def companion: SubstConstants.type

    Permalink
    Definition Classes
    SubstConstantsValue
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  9. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  10. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. val newValues: Value[SCollection[T]]

    Permalink

    new values to be injected into the corresponding positions in ErgoTree.constants array

  12. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  14. def opCode: OpCode

    Permalink

    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
  15. def opName: String

    Permalink
    Definition Classes
    Value
  16. val opType: SFunc

    Permalink

    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
    SubstConstantsValue
  17. val positions: Value[SIntArray]

    Permalink

    zero based indexes in ErgoTree.constants array which should be replaced with new values

  18. val scriptBytes: Value[SByteArray]

    Permalink

    serialized ErgoTree with ConstantSegregationFlag set to 1.

  19. def sourceContext: Nullable[SourceContext]

    Permalink
    Definition Classes
    Value
  20. def sourceContext_=(srcCtx: Nullable[SourceContext]): Unit

    Permalink
    Definition Classes
    Value
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def tpe: SCollection[SByte.type]

    Permalink

    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
    NotReadyValueByteArrayValue
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from NotReadyValueByteArray

Inherited from NotReadyValue[SByteArray]

Inherited from Value[SByteArray]

Inherited from SigmaNode

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped