Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced sigma-data module #924

Merged
merged 50 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
26345ad
move-js-export: js.ErgoTree moved to interpreter module
aslesarenko Oct 5, 2023
3e12acd
towards-data-module: AvlTreeVerifier into separate file
aslesarenko Oct 5, 2023
c3f4ef4
towards-data-module: cleanup code + v6.0 todos
aslesarenko Oct 5, 2023
2d767ae
towards-data-module: Value class moved to sigma.ast package (Values r…
aslesarenko Oct 5, 2023
0ded24b
towards-data-module: partially removed code related to TaggedVar
aslesarenko Oct 5, 2023
c9d30ce
Merge remote-tracking branch 'origin/core-serializers2' into towards-…
aslesarenko Oct 6, 2023
a79834b
towards-data-module: types.scala moved to sigma.ast package
aslesarenko Oct 6, 2023
7638ec5
towards-data-module: renaming types.scala -> methods.scala
aslesarenko Oct 6, 2023
3af15da
towards-data-module: JitCost and CostKind moved to sigma.ast package
aslesarenko Oct 6, 2023
e265ade
towards-data-module: Operations.scala moved to sigma.ast
aslesarenko Oct 6, 2023
cd36fbf
towards-data-module: SMethod moved to sigma.ast
aslesarenko Oct 6, 2023
d99cdc9
towards-data-module: trees.scala moved to sigma.ast
aslesarenko Oct 6, 2023
fb12391
towards-data-module: transformers.scala moved to sigma.ast
aslesarenko Oct 6, 2023
5e298d1
towards-data-module: serializers moved to sigma package
aslesarenko Oct 6, 2023
dc5c693
towards-data-module: more ops moved to sigma.ast package
aslesarenko Oct 6, 2023
061629c
towards-data-module: Fold.sum moved to tests
aslesarenko Oct 6, 2023
b903cd5
towards-data-module: move some crypto to sigma.crypto
aslesarenko Oct 7, 2023
19381c1
towards-data-module: Overloading.scala moved to sigma.utils
aslesarenko Oct 7, 2023
f3517ed
towards-data-module: SparseArrayContainer.scala moved to sigma.utils
aslesarenko Oct 7, 2023
9be3489
towards-data-module: ValueOps moved to sigma.ast.defs
aslesarenko Oct 7, 2023
bf2d61f
towards-data-module: Terms.scala removed and the contents moved to si…
aslesarenko Oct 7, 2023
19bca73
towards-data-module: SigmaExceptions.scala moved to sigma.exceptions
aslesarenko Oct 7, 2023
95f1749
towards-data-module: SigmaBuilder, SigmaPredef, SourceContext moved t…
aslesarenko Oct 7, 2023
935fcf5
towards-data-module: CostItem, InterpreterReflection, DataValueCompar…
aslesarenko Oct 7, 2023
5b4c0fb
towards-data-module: exceptions moved to sigma.exception
aslesarenko Oct 7, 2023
9fd2386
towards-data-module: remove dependence on Interpreter
aslesarenko Oct 7, 2023
3239444
towards-data-module: moved to sigma.data
aslesarenko Oct 8, 2023
8c9d672
towards-data-module: Exceptions.scala moved to sigma.exceptions
aslesarenko Oct 8, 2023
523051a
towards-data-module: BigInt moved to sigma.exceptions
aslesarenko Oct 8, 2023
2a77625
towards-data-module: SigmaDsl moved to sigma.eval
aslesarenko Oct 8, 2023
cd088ca
towards-data-module: some Extensions moved to sigma.eval
aslesarenko Oct 8, 2023
3027599
towards-data-module: ensureTypeCarringValue moved to sigma.eval
aslesarenko Oct 8, 2023
7c37b92
towards-data-module: rename CErgoTreeEvaluator
aslesarenko Oct 8, 2023
f758de7
towards-data-module: replace CErgoTreeEvaluator with ErgoTreeEvaluator
aslesarenko Oct 9, 2023
1331a44
towards-data-module: moved EvalSettings.scala to sigma.eval
aslesarenko Oct 9, 2023
034530c
towards-data-module: introduced Profiler
aslesarenko Oct 9, 2023
8f45459
towards-data-module: CAvlTreeVerifier
aslesarenko Oct 9, 2023
6b7201c
towards-data-module: AvlTreeVerifier abstraction
aslesarenko Oct 9, 2023
f509f2f
towards-data-module: sigmastate.Platform moved to sigma package
aslesarenko Oct 11, 2023
f4dadd4
towards-data-module: `sigma` package moved to `data` module
aslesarenko Oct 11, 2023
b0bf543
towards-data-module: js.ErgoTree moved to `data` module
aslesarenko Oct 11, 2023
af2cb8f
towards-data-module: moved AvlTree operations to CErgoTreeEvaluator
aslesarenko Oct 21, 2023
7b6659d
towards-data-module: added missing ScalaDocs
aslesarenko Oct 21, 2023
0ef3efa
towards-data-module: added missing ScalaDocs (2)
aslesarenko Oct 24, 2023
bd606fc
towards-data-module: added missing ScalaDocs (3)
aslesarenko Oct 24, 2023
0c2e59a
towards-data-module: def isProven extension method removed
aslesarenko Oct 28, 2023
2630ed8
towards-data-module: renamed sigmastate.lang.syntax -> sigmastate.lan…
aslesarenko Oct 28, 2023
aae4118
towards-data-module: renamed defs -> syntax
aslesarenko Oct 28, 2023
77623d2
towards-data-module: ScalaDocs for sigma.ast.syntax methods
aslesarenko Oct 28, 2023
b5c5dbb
towards-data-module: cleanup code, more ScalaDocs
aslesarenko Oct 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 22 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,27 @@ lazy val coreJS = core.js
)
)

lazy val data = crossProject(JVMPlatform, JSPlatform)
.in(file("data"))
.dependsOn(core % allConfigDependency)
.settings(
commonSettings ++ testSettings2,
commonDependenies2,
testingDependencies2,
scorexUtilDependency, fastparseDependency, circeDependency, scryptoDependency,
publish / skip := true
)
.jvmSettings( crossScalaSettings )
.jsSettings(
crossScalaSettingsJS,
useYarn := true
)
lazy val dataJS = data.js
.enablePlugins(ScalaJSBundlerPlugin)

lazy val interpreter = crossProject(JVMPlatform, JSPlatform)
.in(file("interpreter"))
.dependsOn(core % allConfigDependency)
.dependsOn(core % allConfigDependency, data % allConfigDependency)
.settings(
commonSettings ++ testSettings2,
commonDependenies2,
Expand Down Expand Up @@ -275,7 +293,7 @@ lazy val parsersJS = parsers.js

lazy val sdk = crossProject(JVMPlatform, JSPlatform)
.in(file("sdk"))
.dependsOn(core % allConfigDependency, interpreter % allConfigDependency, parsers % allConfigDependency)
.dependsOn(core % allConfigDependency, data % allConfigDependency, interpreter % allConfigDependency, parsers % allConfigDependency)
.settings(commonSettings ++ testSettings2,
commonDependenies2,
testingDependencies2,
Expand Down Expand Up @@ -343,13 +361,13 @@ lazy val scJS = sc.js


lazy val sigma = (project in file("."))
.aggregate(core.jvm, interpreter.jvm, parsers.jvm, sdk.jvm, sc.jvm)
.aggregate(core.jvm, data.jvm, interpreter.jvm, parsers.jvm, sdk.jvm, sc.jvm)
.settings(libraryDefSettings, rootSettings)
.settings(publish / aggregate := false)
.settings(publishLocal / aggregate := false)

lazy val aggregateCompile = ScopeFilter(
inProjects(core.jvm, interpreter.jvm, parsers.jvm, sdk.jvm, sc.jvm),
inProjects(core.jvm, data.jvm, interpreter.jvm, parsers.jvm, sdk.jvm, sc.jvm),
inConfigurations(Compile))

lazy val rootSettings = Seq(
Expand Down
6 changes: 3 additions & 3 deletions core/js/src/main/scala/sigma/js/Value.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ import scala.scalajs.js.annotation.JSExportTopLevel
class Value(val data: Any, val tpe: Type) extends js.Object {

/** Get Sigma runtime value which can be passed to interpreter, saved in register and
* [[sigmastate.Values.Constant]] nodes.
* [[sigma.ast.Constant]] nodes.
*/
final def runtimeData: Any = toRuntimeData(data, tpe.rtype)

/**
* Encode this value as Base16 hex string.
* 1) it transforms this value into {@link sigmastate.Values.ConstantNode} of sigma.
* 1) it transforms this value into {@link sigma.ast.ConstantNode} of sigma.
* 2) it serializes the constant into byte array using {@link sigmastate.serialization.ConstantSerializer}
* 3) the bytes are encoded using Base16 encoder into string
*
Expand All @@ -71,7 +71,7 @@ object Value extends js.Object {
val MinLong = -js.BigInt("0x8000000000000000")

/** Helper method to get Sigma runtime value which can be passed to interpreter, saved
* in register and [[sigmastate.Values.Constant]] nodes.
* in register and [[sigma.ast.Constant]] nodes.
*/
final private[js] def toRuntimeData(data: Any, rtype: RType[_]): Any = rtype match {
case sigma.BooleanType => data
Expand Down
1 change: 0 additions & 1 deletion core/jvm/src/main/scala/sigma/crypto/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import org.bouncycastle.crypto.params.KeyParameter
import org.bouncycastle.math.ec.{ECCurve, ECFieldElement, ECPoint}

import java.math.BigInteger
import sigmastate._
import sigma.Coll
import sigma._
import sigma.ast._
Expand Down
20 changes: 18 additions & 2 deletions core/shared/src/main/scala/sigma/data/CSigmaProp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sigma.data
import sigma.ast.SSigmaProp
import sigma.serialization.CoreSerializer
import sigma.util.Extensions.SigmaBooleanOps
import sigma.{Coll, Colls, SigmaProp}
import sigma.{Coll, Colls, GroupElement, SigmaProp}

/** A default implementation of [[SigmaProp]] interface.
*
Expand Down Expand Up @@ -42,4 +42,20 @@ case class CSigmaProp(sigmaTree: SigmaBoolean) extends SigmaProp with WrapperOf[
override def toString: String = s"SigmaProp(${wrappedValue.showToString})"
}


object CSigmaProp {
/** Create trivial sigma proposition with given boolean value. */
def apply(b: Boolean): CSigmaProp =
CSigmaProp(TrivialProp(b))

/** Create SigmaProp value with underlying ProveDlog proposition. */
def withProveDlog(ge: GroupElement) =
CSigmaProp(ProveDlog(ge.asInstanceOf[CGroupElement].wrappedValue))

/** Create SigmaProp value with underlying ProveDHTuple proposition. */
def withProveDHTuple(g: GroupElement, h: GroupElement, u: GroupElement, v: GroupElement) =
CSigmaProp(ProveDHTuple(
g.asInstanceOf[CGroupElement].wrappedValue,
h.asInstanceOf[CGroupElement].wrappedValue,
u.asInstanceOf[CGroupElement].wrappedValue,
v.asInstanceOf[CGroupElement].wrappedValue))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ package sigma.serialization

import scorex.util.Extensions._
import scorex.util.serialization.Reader
import sigma.util.safeNewArray
import debox.cfor
import sigma.ast.SType
import sigma.validation.ValidationRules.CheckPositionLimit
import sigmastate.serialization.TypeSerializer

/** Reader used in the concrete implementations of [[SigmaSerializer]].
* It decorates the given reader, delegates most of the methods to it, but also adds new
* methods.
*
* @param r the underlying reader this reader reads from
* @param constantStore the store of constants which is used to resolve
* [[sigmastate.Values.ConstantPlaceholder]]
* [[sigma.ast.ConstantPlaceholder]]
* @param resolvePlaceholdersToConstants if true then resolved constants will be
* substituted in the tree instead of the placeholder.
* @param maxTreeDepth limit on the tree depth (recursive invocations)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package sigma.serialization

import scorex.util.serialization.{VLQByteBufferWriter, Writer}
import scorex.util.serialization.Writer.Aux
import scorex.util.serialization.{VLQByteBufferWriter, Writer}
import sigma.ast.SType
import sigma.serialization.CoreByteWriter.{Bits, DataInfo, U, Vlq, ZigZag}
import sigmastate.serialization.TypeSerializer

class CoreByteWriter(val w: Writer) extends Writer {
type CH = w.CH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sigmastate.serialization
package sigma.serialization

import debox.cfor
import sigma.ast.SCollectionType.{CollectionTypeCode, NestedCollectionTypeCode}
Expand Down
7 changes: 7 additions & 0 deletions core/shared/src/main/scala/sigma/util/CollectionUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ object CollectionUtil {
result
}

/** Casts the array of `A`s into array of `B`s, where B is a superclass of A. */
def castArray[A, B >: A : ClassTag](array: Array[A]): Array[B] = {
val result: Array[B] = new Array[B](array.length)
System.arraycopy(array, 0, result, 0, array.length)
result
}

/** Computes the deep hash code for the given array.
*
* This method calculates the hash code based on the array's elements and type, taking nested arrays
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sigma.SigmaException
import sigma.ast.{SGlobal, SOption, TypeCodes}
import sigma.serialization.{ReaderPositionLimitExceeded, SerializerException}
import sigma.util.Extensions.toUByte
import sigmastate.serialization.TypeSerializer.embeddableIdToType
import sigma.serialization.TypeSerializer.embeddableIdToType

/** Base class for different validation rules registered in ValidationRules.currentSettings.
* Each rule is identified by `id` and have a description.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package sigmastate
package sigma

import org.ergoplatform.ErgoBox
import sigma.data.{AvlTreeData, Nullable, SigmaBoolean}
import sigma.{Evaluation, VersionContext}
import sigmastate.Values.{Constant, FalseLeaf, TrueLeaf}
import sigmastate.eval.SigmaDsl
import sigmastate.lang.SigmaBuilder
import sigma.Coll
import sigma.ast._
import sigma.{AnyValue, AvlTree, GroupElement, SigmaProp}
import sigma.data._

import java.math.BigInteger

Expand All @@ -17,22 +11,22 @@ object Platform {
* Uses scalan.Nullable instead of scala.Option to avoid allocation on consensus hot path.
* This method is part of consensus and is used in [[SubstConstants]] operation.
*/
private [sigmastate] def liftToConstant(obj: Any, builder: SigmaBuilder): Nullable[Constant[SType]] = {
private[sigma] def liftToConstant(obj: Any, builder: SigmaBuilder): Nullable[Constant[SType]] = {
import builder._
obj match {
case arr: Array[Boolean] => Nullable(mkCollectionConstant[SBoolean.type](arr, SBoolean))
case arr: Array[Byte] => Nullable(mkCollectionConstant[SByte.type](arr, SByte))
case arr: Array[Short] => Nullable(mkCollectionConstant[SShort.type](arr, SShort))
case arr: Array[Int] => Nullable(mkCollectionConstant[SInt.type](arr, SInt))
case arr: Array[Long] => Nullable(mkCollectionConstant[SLong.type](arr, SLong))
case arr: Array[BigInteger] => Nullable(mkCollectionConstant[SBigInt.type](arr.map(SigmaDsl.BigInt(_)), SBigInt))
case arr: Array[BigInteger] => Nullable(mkCollectionConstant[SBigInt.type](arr.map[BigInt](n => CBigInt(n)), SBigInt))
case arr: Array[String] => Nullable(mkCollectionConstant[SString.type](arr, SString))
case v: AnyValue =>
val tpe = Evaluation.rtypeToSType(v.tVal)
Nullable(mkConstant[tpe.type](v.value.asInstanceOf[tpe.WrappedType], tpe))
case v: Int => Nullable(mkConstant[SInt.type](v, SInt))
case v: Long => Nullable(mkConstant[SLong.type](v, SLong))
case v: BigInteger => Nullable(mkConstant[SBigInt.type](SigmaDsl.BigInt(v), SBigInt))
case v: BigInteger => Nullable(mkConstant[SBigInt.type](CBigInt(v), SBigInt))
case n: sigma.BigInt => Nullable(mkConstant[SBigInt.type](n, SBigInt))
case ge: GroupElement => Nullable(mkConstant[SGroupElement.type](ge, SGroupElement))
case b: Boolean => Nullable(if (b) TrueLeaf else FalseLeaf)
Expand All @@ -44,7 +38,7 @@ object Platform {
// ErgoBox cannot be passed as argument as it is never valid value during evaluation.
// Thus we can use activation-based versioning and fix this code when v5.0 is activated.
case b: ErgoBox =>
Nullable(mkConstant[SBox.type](SigmaDsl.Box(b), SBox)) // fixed in v5.0
Nullable(mkConstant[SBox.type](CBox(b), SBox)) // fixed in v5.0

// this case is added in v5.0 and it can be useful when the box value comes from a
// register or a context variable is passed to SubstConstants.
Expand All @@ -53,9 +47,9 @@ object Platform {
Nullable(mkConstant[SBox.type](b, SBox))
else
Nullable.None // return the same result as in v4.x when there was no this case
case avl: AvlTreeData => Nullable(mkConstant[SAvlTree.type](SigmaDsl.avlTree(avl), SAvlTree))
case avl: AvlTreeData => Nullable(mkConstant[SAvlTree.type](CAvlTree(avl), SAvlTree))
case avl: AvlTree => Nullable(mkConstant[SAvlTree.type](avl, SAvlTree))
case sb: SigmaBoolean => Nullable(mkConstant[SSigmaProp.type](SigmaDsl.SigmaProp(sb), SSigmaProp))
case sb: SigmaBoolean => Nullable(mkConstant[SSigmaProp.type](CSigmaProp(sb), SSigmaProp))
case p: SigmaProp => Nullable(mkConstant[SSigmaProp.type](p, SSigmaProp))
case coll: Coll[a] =>
val tpeItem = Evaluation.rtypeToSType(coll.tItem)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.ergoplatform.sdk.js
package sigma.ast.js

import sigma.ast
import sigma.js.Value
import sigmastate.Values

import scala.scalajs.js
import scala.scalajs.js.JSConverters.JSRichIterableOnce
import scala.scalajs.js.annotation.JSExportTopLevel

/** An exported JavaScript class wrapping the Scala `Values.ErgoTree` type. */
/** An exported JavaScript class wrapping the Scala `ErgoTree` type. */
@JSExportTopLevel("ErgoTree")
class ErgoTree(tree: sigmastate.ErgoTree) extends js.Object {
class ErgoTree(tree: ast.ErgoTree) extends js.Object {
/** The first byte of serialized byte array which determines interpretation of the rest of the array. */
def header(): Byte = tree.header

Expand All @@ -36,7 +36,7 @@ class ErgoTree(tree: sigmastate.ErgoTree) extends js.Object {
/** Returns segregated constants of this tree as [[js.Array]]. */
def constants(): js.Array[Value] = {
val constants = tree.constants
val values = constants.map(Isos.isoValueToConstant.from)
val values = constants.map(isoValueToConstant.from)
values.toJSArray
}
}
Expand All @@ -50,13 +50,13 @@ object ErgoTree extends js.Object {
* @param hex a hexadecimal string representing the serialized ErgoTree
*/
def fromHex(hex: String): ErgoTree =
new ErgoTree(sigmastate.ErgoTree.fromHex(hex))
new ErgoTree(ast.ErgoTree.fromHex(hex))

/** Deserializes an ErgoTree instance from an array of bytes.
*
* @param bytes an array of bytes representing the serialized ErgoTree
*/
def fromBytes(bytes: Array[Byte]): ErgoTree = {
new ErgoTree(sigmastate.ErgoTree.fromBytes(bytes))
new ErgoTree(ast.ErgoTree.fromBytes(bytes))
}
}
19 changes: 19 additions & 0 deletions data/js/src/main/scala/sigma/ast/js/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package sigma.ast

import sigma.Evaluation
import sigma.data.Iso
import sigma.js.{Type, Value}

package object js {
/** Conversion between `Value` and `Constant[SType]`. */
implicit val isoValueToConstant: Iso[Value, Constant[SType]] = new Iso[Value, Constant[SType]] {
override def to(x: Value): Constant[SType] =
Constant(x.runtimeData.asInstanceOf[SType#WrappedType], Evaluation.rtypeToSType(x.tpe.rtype))

override def from(x: Constant[SType]): Value = {
val rtype = Evaluation.stypeToRType(x.tpe)
val jsvalue = Value.fromRuntimeData(x.value, rtype)
new Value(jsvalue, new Type(rtype))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package sigmastate
package sigma

import org.ergoplatform.ErgoBox
import sigma.data.{AvlTreeData, Nullable, SigmaBoolean}
import sigma.{Evaluation, VersionContext}
import sigmastate.Values.{Constant, FalseLeaf, TrueLeaf}
import sigmastate.eval.SigmaDsl
import sigmastate.lang.SigmaBuilder
import sigma.Coll
import sigma.ast._
import sigma.{AvlTree, GroupElement, SigmaProp}
import sigma.data.{AvlTreeData, Nullable, SigmaBoolean}
import sigma.eval.SigmaDsl

import java.math.BigInteger

Expand All @@ -18,7 +13,7 @@ object Platform {
* Uses scalan.Nullable instead of scala.Option to avoid allocation on consensus hot path.
* This method is part of consensus and is used in [[SubstConstants]] operation.
*/
private [sigmastate] def liftToConstant(obj: Any, builder: SigmaBuilder): Nullable[Constant[SType]] = {
private[sigma] def liftToConstant(obj: Any, builder: SigmaBuilder): Nullable[Constant[SType]] = {
import builder._
obj match {
case arr: Array[Boolean] => Nullable(mkCollectionConstant[SBoolean.type](arr, SBoolean))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ import org.ergoplatform.ErgoAddressEncoder.NetworkPrefix
import scorex.crypto.hash.{Blake2b256, Digest32}
import scorex.util.encode.Base58
import scorex.utils.Ints
import sigma.ast.{SInt, SSigmaProp}
import sigma.data.ProveDlog
import sigma.ast.{DeserializeContext, SInt, SSigmaProp, Slice}
import sigma.data.{CSigmaProp, ProveDlog}
import sigma.serialization.GroupElementSerializer
import sigma.{Coll, SigmaException, VersionContext}
import sigmastate.ErgoTree.{ZeroHeader, setVersionBits}
import sigmastate.Values._
import sigmastate._
import sigmastate.crypto.DLogProtocol.ProveDlogProp
import sigmastate.serialization._
import sigmastate.utxo.{DeserializeContext, Slice}
import sigma.ast.ErgoTree.{ZeroHeader, setVersionBits}
import sigma.ast._
import sigma.ast.syntax._
import sigma.serialization._

import scala.util.Try

Expand Down Expand Up @@ -345,7 +343,7 @@ case class ErgoAddressEncoder(networkPrefix: NetworkPrefix) {
*/
def fromProposition(proposition: ErgoTree): Try[ErgoAddress] = Try {
proposition.root match {
case Right(SigmaPropConstant(ProveDlogProp(d))) => P2PKAddress(d)
case Right(SigmaPropConstant(CSigmaProp(d: ProveDlog))) => P2PKAddress(d)
case Right(IsPay2SHAddress(scriptHash)) => new Pay2SHAddress(scriptHash.toArray)
case Right(b: Value[SSigmaProp.type]@unchecked) if b.tpe == SSigmaProp => Pay2SAddress(proposition)
case Left(unparsedErgoTree) =>
Expand Down
Loading
Loading