Packages

  • package root
    Definition Classes
    root
  • package sigma

    The following implicit values are used as type descriptors of all the predefined Sigma types.

    The following implicit values are used as type descriptors of all the predefined Sigma types.

    Definition Classes
    root
    See also

    RType class

  • package data

    Contains cores definitions which serves as a basis for sigma package implementations.

    Contains cores definitions which serves as a basis for sigma package implementations.

    Definition Classes
    sigma
  • package impl
    Definition Classes
    sigma
  • package kiama

    Kiama is a Scala library for language processing.

    Kiama is a Scala library for language processing. It is a project of the Programming Languages Research Group at Macquarie University. For full project details see the web site http://github.com/inkytonik/kiama.

    Kiama's main components address tree decoration via attribute grammars (package attribution), tree transformation via strategic term rewriting (package rewriting), dynamic semantics (package machine) and pretty-printing (package output).

    The util package contains support modules for parsing, input/output, read-eval-print loops (REPLs) and pattern matching.

    The examples package (available as part of the Kiama tests) contains many examples of using Kiama to solve small to medium language processing problems.

    Definition Classes
    sigma
  • package reflection

    Contains the Sigma Reflection API.

    Contains the Sigma Reflection API. Sigma reflection is a mechanism for obtaining metadata about classes, methods, fields, etc. at runtime. It is used by kiama to rewrite ErgoTree expressions. It is also used by the ErgoTree interpreter to implement MethodCall nodes.

    The Sigma Reflection API has two implementations: 1) based on the Java Reflection API 2) based on Sigma Reflection metadata declared in the StaticImpl.scala file

    Definition Classes
    sigma
  • package util
    Definition Classes
    sigma
  • package wrappers
    Definition Classes
    sigma
  • AnyValue
  • AvlTree
  • BigInt
  • Box
  • Coll
  • CollBuilder
  • Colls
  • CollsModule
  • Context
  • Environment
  • Extensions
  • GroupElement
  • Header
  • PairColl
  • PreHeader
  • RuntimePlatform
  • SigmaContract
  • SigmaDsl
  • SigmaDslBuilder
  • SigmaDslModule
  • SigmaProp
  • VersionContext
t

sigma

Context

trait Context extends AnyRef

Runtime representation of Context ErgoTree type. Represents data available in Sigma language using CONTEXT global variable.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Context
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def HEIGHT: Int

    Height (block number) of the block which is currently being validated.

  2. abstract def INPUTS: Coll[Box]

    A collection of inputs of the current transaction, the transaction where selfBox is one of the inputs.

  3. abstract def LastBlockUtxoRootHash: AvlTree

    Authenticated dynamic dictionary digest representing Utxo state before current state.

  4. abstract def OUTPUTS: Coll[Box]

    A collection of outputs of the current transaction.

  5. abstract def SELF: Box

    Box whose proposition is being currently executing

  6. abstract def activatedScriptVersion: Byte

    Maximum version of ErgoTree currently activated on the network.

    Maximum version of ErgoTree currently activated on the network. See ErgoLikeContext class for details.

  7. abstract def builder: SigmaDslBuilder
  8. abstract def currentErgoTreeVersion: Byte

    The version of ErgoTree currently executed by interpreter.

    The version of ErgoTree currently executed by interpreter. See ErgoLikeContext class for details.

  9. abstract def dataInputs: Coll[Box]

    A collection of inputs of the current transaction that will not be spent.

  10. abstract def getVar[T](id: Byte)(implicit cT: RType[T]): Option[T]

    Extracts Context variable by id and type.

    Extracts Context variable by id and type. ErgoScript is typed, so accessing a the variables is an operation which involves some expected type given in brackets. Thus getVar[Int](id) expression should evaluate to a valid value of the Option[Int] type.

    For example val x = getVar[Int](10) expects the variable, if it is present, to have type Int. At runtime the corresponding type descriptor is passed as cT parameter.

    There are three cases: 1) If the variable doesn't exist. Then val x = getVar[Int](id) succeeds and returns the None value, which conforms to any value of type Option[T] for any T. (In the example above T is equal to Int). Calling x.get fails when x is equal to None, but x.isDefined succeeds and returns false. 2) If the variable contains a value v of type Int. Then val x = getVar[Int](id) succeeds and returns Some(v), which is a valid value of type Option[Int]. In this case, calling x.get succeeds and returns the value v of type Int. Calling x.isDefined returns true. 3) If the variable contains a value v of type T other then Int. Then val x = getVar[Int](id) fails, because there is no way to return a valid value of type Option[Int]. The value of variable is present, so returning it as None would break the typed semantics of variables collection.

    In some use cases one variable may have values of different types. To access such variable an additional variable can be used as a tag.

      val tagOpt = getVar[Int](id)
      val res = if (tagOpt.isDefined) {
        val tag = tagOpt.get
        if (tag == 1) {
          val x = getVar[Int](id2).get
          // compute res using value x is of type Int
        } else if (tag == 2) {
          val x = getVar[GroupElement](id2).get
          // compute res using value x is of type GroupElement
        } else if (tag == 3) {
          val x = getVar[ Array[Byte] ](id2).get
          // compute res using value x of type Array[Byte]
        } else {
          // compute `res` when `tag` is not 1, 2 or 3
        }
      }
      else {
        // compute value of res when the variable is not present
      }
    

    T

    expected type of the variable.

    id

    zero-based identifier of the variable.

    returns

    Some(value) if the variable is defined in the context AND has the given type. None otherwise

    Exceptions thrown

    `sigmastate.eval.InvalidType` exception when the type of the variable value is different from cT.

  11. abstract def headers: Coll[Header]

    A fixed number of last block headers in descending order (first header is the newest one)

  12. abstract def minerPubKey: Coll[Byte]

    Bytes of encoded miner's public key.

    Bytes of encoded miner's public key. Same as preHeader.minerPk.getEncoded

  13. abstract def preHeader: PreHeader

    Fields of a new block header, that can be predicted by a miner before block's formation

  14. abstract def selfBoxIndex: Int

    Zero based index in inputs of selfBox.

  15. abstract def vars: Coll[AnyValue]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped