Skip to content

Commit

Permalink
core-serializers2: ErgoTree moved out of Values object
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Sep 20, 2023
1 parent 2ddc80d commit 42541ac
Show file tree
Hide file tree
Showing 43 changed files with 451 additions and 436 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import sigmastate.serialization.SigmaSerializer
import sigmastate.utils.{Helpers, SigmaByteReader, SigmaByteWriter}
import sigmastate.utxo.ExtractCreationInfo
import sigma.{Colls, _}
import sigmastate.ErgoTree

/**
* Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency. In Bitcoin, such an object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import sigma.ast.SType.AnyOps
import sigma.data.Digest32Coll
import sigma.util.safeNewArray
import sigma.{Coll, Colls}
import sigmastate.ErgoTree
import sigmastate.Values._
import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer
import sigmastate.serialization.SigmaSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import sigma.ast.{SBox, SInt, SLong, SSigmaProp}
import sigma.data.ProveDlog
import sigmastate.crypto.CryptoConstants
import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer
import sigmastate.Values.{ErgoTree, FalseSigmaProp, IntArrayConstant, IntConstant, LongConstant, SigmaPropConstant, SigmaPropValue, TrueSigmaProp, Value}
import sigmastate.Values.{FalseSigmaProp, IntArrayConstant, IntConstant, LongConstant, SigmaPropConstant, SigmaPropValue, TrueSigmaProp, Value}
import sigmastate.utxo._
import sigmastate._
import sigmastate.{ErgoTree, _}
import sigmastate.lang.Terms.ValueOps

object ErgoTreePredef {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.ergoplatform.settings

import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import org.ergoplatform.ErgoTreePredef
import org.ergoplatform.mining.emission.EmissionRules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import sigma.serialization.{InvalidOpCode, SerializerException}
import sigma.util.Extensions.toUByte
import sigma.validation.ValidationRules._
import sigma.validation._
import sigmastate.Values.{ErgoTree, SValue}
import sigmastate._
import sigmastate.Values.SValue
import sigmastate.{ErgoTree, _}
import sigmastate.exceptions._
import sigmastate.serialization.ValueCodes.OpCode
import sigmastate.serialization.{ValueCodes, ValueSerializer}
Expand Down
373 changes: 373 additions & 0 deletions interpreter/shared/src/main/scala/sigmastate/ErgoTree.scala

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sigmastate

import debox.cfor
import sigma.data.{CAND, COR, CTHRESHOLD, ProveDHTuple, ProveDlog, SigmaBoolean, SigmaLeaf}
import sigmastate.Values.{ErgoTree, SigmaPropConstant}
import sigmastate.Values.SigmaPropConstant
import sigmastate.crypto.DLogProtocol.FirstDLogProverMessage
import sigmastate.crypto.VerifierMessage.Challenge
import sigmastate.crypto.{FirstDHTupleProverMessage, FirstProverMessage, GF2_192_Poly}
Expand Down
356 changes: 1 addition & 355 deletions interpreter/shared/src/main/scala/sigmastate/Values.scala

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sigmastate.interpreter

import org.ergoplatform.ErgoLikeContext
import sigmastate.{FixedCost, JitCost, PerItemCost, TypeBasedCost}
import sigmastate.{ErgoTree, FixedCost, JitCost, PerItemCost, TypeBasedCost}
import sigmastate.Values._
import sigmastate.eval.Profiler
import sigmastate.interpreter.ErgoTreeEvaluator.DataEnv
Expand All @@ -14,6 +14,7 @@ import debox.{Buffer => DBuffer}
import sigma.VersionContext
import sigma.ast.SType
import sigma.data.SigmaBoolean

import scala.collection.compat.immutable.ArraySeq
import scala.util.DynamicVariable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sigmastate.interpreter

import sigma.data.{ProveDHTuple, ProveDlog, SigmaBoolean, SigmaConjecture, SigmaLeaf}
import sigmastate._
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate.crypto.DLogProtocol.DLogInteractiveProver
import sigmastate.crypto.DiffieHellmanTupleInteractiveProver

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package sigmastate.serialization

import org.ergoplatform.validation.ValidationRules.{CheckDeserializedScriptIsSigmaProp, CheckHeaderSizeBit}
import sigmastate.Values.{Constant, ErgoTree, UnparsedErgoTree}
import sigmastate.Values.Constant
import sigmastate.lang.DeserializationSigmaBuilder
import sigmastate.lang.Terms.ValueOps
import sigmastate.utils.{SigmaByteReader, SigmaByteWriter}
import sigmastate.Values.ErgoTree.EmptyConstants
import sigmastate.ErgoTree.EmptyConstants
import sigma.util.safeNewArray
import sigmastate.utxo.ComplexityTable
import debox.cfor
Expand All @@ -14,6 +14,7 @@ import sigma.ast.SType
import sigma.serialization.{ReaderPositionLimitExceeded, SerializerException}
import sigma.validation.{SigmaValidationSettings, ValidationException}
import sigma.validation.ValidationRules.CheckPositionLimit
import sigmastate.{ErgoTree, UnparsedErgoTree}

import java.util

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sigmastate

import org.scalatest.matchers.should.Matchers
import sigmastate.Values.{ErgoTree, SigmaPropValue}
import sigmastate.Values.SigmaPropValue
import org.ergoplatform.ErgoTreePredef
import sigma.VersionTesting
import sigma.data.SigmaBoolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package sigmastate.helpers

import sigma.ast.SType
import sigmastate.Values.{ErgoTree, EvaluatedValue}
import sigmastate.ErgoTree
import sigmastate.Values.EvaluatedValue
import sigmastate.interpreter.Interpreter.ScriptEnv
import sigmastate.interpreter.{ContextExtension, CostedProverResult, HintsBag, ProverInterpreter}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scorex.util.ModifierId
import sigma.data.{AvlTreeData, CollOverArray, PairOfCols}
import sigma.validation.SigmaValidationSettings
import sigma.{Coll, Header, PreHeader}
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate.eval._
import sigmastate.interpreter.ContextExtension

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.ergoplatform.ErgoBox
import org.scalacheck.Arbitrary._
import sigma.data.{RType, SigmaBoolean, TupleColl}
import sigma.ast.SCollection.SByteArray
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate._
import sigmastate.eval._
import sigma.{AvlTree, Colls, Evaluation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sigma

import sigma.Extensions.ArrayOps
import sigma.data.{AvlTreeData, RType}
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate.Values
import sigmastate.eval._
import sigmastate.eval.Extensions._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import sigma.data._
import scorex.crypto.authds.{ADKey, ADValue}
import scorex.crypto.hash.{Blake2b256, Digest32}
import scorex.util.ModifierId
import sigmastate.Values.{ByteArrayConstant, ConcreteCollection, ConstantPlaceholder, ErgoTree, FalseLeaf, IntConstant, LongConstant, SigmaPropConstant, TrueLeaf}
import sigmastate.Values.{ByteArrayConstant, ConcreteCollection, ConstantPlaceholder, FalseLeaf, IntConstant, LongConstant, SigmaPropConstant, TrueLeaf}
import sigma.Extensions.ArrayOps
import sigmastate.eval.{CBox, CHeader, CPreHeader, CSigmaDslBuilder, SigmaDsl}
import sigmastate.helpers.TestingCommons
import sigmastate.serialization.ErgoTreeSerializer
import sigmastate.serialization.generators.ObjectGenerators
import sigmastate.utils.Helpers
import sigmastate._
import sigmastate.{ErgoTree, _}
import sigma.ast.{SBoolean, SSigmaProp}
import sigma.crypto.EcPointType

Expand Down
4 changes: 2 additions & 2 deletions sc/js/src/main/scala/sigmastate/lang/js/SigmaCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class SigmaCompiler(_compiler: sigmastate.lang.SigmaCompiler) extends js.Object
require(prop.tpe.isSigmaProp, s"Expected SigmaProp expression type bue got ${prop.tpe}: $prop")

val tree = if (segregateConstants) {
Values.ErgoTree.withSegregation(additionalHeaderFlags, prop.asSigmaProp)
sigmastate.ErgoTree.withSegregation(additionalHeaderFlags, prop.asSigmaProp)
} else {
Values.ErgoTree.withoutSegregation(additionalHeaderFlags, prop.asSigmaProp)
sigmastate.ErgoTree.withoutSegregation(additionalHeaderFlags, prop.asSigmaProp)
}
new ErgoTree(tree)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sigmastate.interpreter.{CostedProverResult, ProverResult}
import sigma.data.RType
import org.ergoplatform.{ErgoBox, ErgoLikeContext}
import sigma.{AnyValue, Coll, SigmaDslBuilder, SigmaProp}
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate.eval.{CSigmaDslBuilder, IRContext}

import scala.util.Try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.ergoplatform.ErgoAddressEncoder.{MainnetNetworkPrefix, TestnetNetwork
import org.scalatest.{Assertion, TryValues}
import scorex.crypto.hash.Blake2b256
import scorex.util.encode.Base58
import sigmastate.Values.{ByteArrayConstant, Constant, ErgoTree, IntConstant, UnparsedErgoTree}
import sigmastate.Values.{ByteArrayConstant, Constant, IntConstant}
import sigmastate.crypto.DLogProtocol.DLogProverInput
import sigmastate.eval.InvalidType
import sigmastate.helpers.TestingHelpers._
Expand All @@ -18,7 +18,7 @@ import sigmastate.lang.Terms.ValueOps
import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer
import sigmastate.serialization.ValueSerializer
import sigmastate.utils.Helpers._
import sigmastate.{CompilerCrossVersionProps, SigmaAnd}
import sigmastate.{CompilerCrossVersionProps, ErgoTree, SigmaAnd, UnparsedErgoTree}
import sigma.SigmaDslTesting
import sigma.ast.SType
import sigma.data.ProveDlog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import sigma.Colls
import sigma.ast.SByte
import sigma.data.{AvlTreeData, Digest32Coll, ProveDlog, TrivialProp}
import sigma.util.BenchmarkUtil.measure
import sigmastate.Values.{ByteArrayConstant, CollectionConstant, ErgoTree, IntConstant, SigmaPropConstant}
import sigmastate.Values.{ByteArrayConstant, CollectionConstant, IntConstant, SigmaPropConstant}
import sigmastate._
import sigmastate.crypto.DLogProtocol.DLogProverInput
import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import scala.util.Try
import org.ergoplatform.{ErgoBox, ErgoLikeContext}
import org.ergoplatform.dsl.ContractSyntax.{ErgoScript, Proposition, Token}
import sigma.ast.SType
import sigmastate.Values.{ErgoTree, EvaluatedValue}
import sigmastate.Values.EvaluatedValue
import sigmastate.eval.IRContext
import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter}
import sigmastate.helpers.TestingHelpers._
import sigmastate.lang.Terms.ValueOps
import sigma.{AnyValue, Evaluation, SigmaProp}
import sigmastate.ErgoTree

case class TestContractSpec(testSuite: CompilerTestingCommons)(implicit val IR: IRContext) extends ContractSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalatest.BeforeAndAfterAll
import sigma.data.{CSigmaProp, RType, TrivialProp}
import sigma.util.BenchmarkUtil
import sigmastate.{DataValueComparer, JitCost}
import sigmastate.Values.ErgoTree
import sigmastate.ErgoTree
import sigmastate.eval.{Profiler, SigmaDsl}
import sigmastate.helpers.SigmaPPrint
import sigmastate.interpreter.{CostAccumulator, ErgoTreeEvaluator, EvalSettings, TracedCost}
Expand Down
4 changes: 2 additions & 2 deletions sc/shared/src/test/scala/sigma/SigmaDslTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import sigma.util.CollectionUtil._
import sigma.util.Extensions._
import sigma.util.StringUtil.StringUtilExtensions
import sigma.ast.SType.AnyOps
import sigmastate.Values.{ByteArrayConstant, Constant, ConstantNode, ErgoTree, IntConstant, SValue}
import sigmastate.Values.{ByteArrayConstant, Constant, ConstantNode, IntConstant, SValue}
import sigmastate.crypto.DLogProtocol.DLogProverInput
import sigmastate.crypto.SigmaProtocolPrivateInput
import sigmastate.eval.Extensions.SigmaBooleanOps
Expand All @@ -36,7 +36,7 @@ import sigmastate.utxo.{DeserializeContext, DeserializeRegister, GetVar, OptionG
import sigma.ast.{SOption, SSigmaProp, SType}
import sigma.validation.ValidationRules.CheckSerializableTypeCode
import sigma.validation.{SigmaValidationSettings, ValidationException}
import sigmastate.eval
import sigmastate.{ErgoTree, eval}

import scala.collection.mutable
import scala.reflect.ClassTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sigmastate
import scala.util.DynamicVariable
import sigmastate.lang.{CompilerResult, CompilerSettings, SigmaCompiler, TransformingSigmaBuilder}
import sigmastate.interpreter.Interpreter.ScriptEnv
import sigmastate.Values.{ErgoTree, SValue, SigmaPropValue, Value}
import sigmastate.Values.{SValue, SigmaPropValue, Value}
import org.ergoplatform.ErgoAddressEncoder.TestnetNetworkPrefix
import sigma.ast.SType
import sigmastate.serialization.ValueSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sigmastate
import org.ergoplatform.ErgoBox.AdditionalRegisters
import org.ergoplatform._
import scorex.util.ModifierId
import sigmastate.Values.ErgoTree.{DefaultHeader, updateVersionBits}
import sigmastate.ErgoTree.{DefaultHeader, updateVersionBits}
import sigmastate.Values._
import sigma.VersionContext.MaxSupportedScriptVersion
import sigma.ast.{SBoolean, SBox, SCollection, SType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import sigma.data.AvlTreeData
import sigma.serialization.SerializerException
import sigma.validation.ValidationRules.{CheckPrimitiveTypeCode, CheckSerializableTypeCode, CheckTypeCode, CheckTypeWithMethods, trySoftForkable}
import sigma.validation.{ChangedRule, ReplacedRule, SigmaValidationSettings, ValidationException, ValidationRule}
import sigmastate.Values.ErgoTree.EmptyConstants
import sigmastate.Values.{ByteArrayConstant, ErgoTree, IntConstant, NotReadyValueInt, UnparsedErgoTree, ValueCompanion}
import sigmastate.ErgoTree.EmptyConstants
import sigmastate.Values.{ByteArrayConstant, IntConstant, NotReadyValueInt, ValueCompanion}
import sigmastate.exceptions.InterpreterException
import sigmastate.helpers.TestingHelpers._
import sigmastate.helpers.{CompilerTestingCommons, ErgoLikeContextTesting, ErgoLikeTestInterpreter, ErgoLikeTestProvingInterpreter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import org.ergoplatform._
import org.ergoplatform.validation.ValidationSpecification
import org.scalacheck.Arbitrary.arbByte
import org.scalacheck.Gen
import org.scalatest.Assertion
import sigma.util.BenchmarkUtil
import scalan.TestContexts
import sigma.ast.{SOption, SType}
import sigma.{Colls, Evaluation, TestUtils}
import sigma.data.{RType, SigmaBoolean}
import sigma.validation.ValidationException
import sigma.validation.ValidationRules.CheckSerializableTypeCode
import sigmastate.Values.{Constant, ErgoTree, SValue, SigmaPropValue}
import sigmastate.Values.{Constant, SValue, SigmaPropValue}
import sigmastate.eval._
import sigmastate.helpers.TestingHelpers._
import sigmastate.interpreter.ContextExtension.VarBinding
Expand All @@ -21,7 +20,7 @@ import sigmastate.interpreter.Interpreter.ScriptEnv
import sigmastate.interpreter._
import sigmastate.lang.{CompilerSettings, SigmaCompiler, Terms}
import sigmastate.serialization.SigmaSerializer
import sigmastate.{CompilerTestsBase, JitCost}
import sigmastate.{CompilerTestsBase, ErgoTree, JitCost}

import scala.language.implicitConversions
import scala.reflect.ClassTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import sigma.crypto.EcPointType
import sigma.data.{AvlTreeData, AvlTreeFlags, CollType, PrimitiveType, TrivialProp}
import sigma.serialization.GroupElementSerializer
import sigma.{Coll, GroupElement}
import sigmastate.Values.{ConstantNode, ErgoTree, FuncValue, ValueCompanion}
import sigmastate.Values.{ConstantNode, FuncValue, ValueCompanion}
import sigmastate._
import sigmastate.crypto.GF2_192_Poly
import sigmastate.interpreter.{CompanionDesc, FixedCostItem, MethodDesc}
import sigmastate.lang.Terms
import sigmastate.lang.Terms.MethodCall
import sigmastate.utxo.SelectField

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import sigma.data.CBigInt
import sigma.serialization.{ReaderPositionLimitExceeded, SerializerException}
import sigma.util.Extensions.SigmaPropOps
import sigma.validation.ValidationException
import sigmastate.Values.ErgoTree.EmptyConstants
import sigmastate.Values.{BigIntConstant, ByteConstant, ConstantPlaceholder, ErgoTree, IntConstant, ShortConstant, SigmaPropValue, UnparsedErgoTree}
import sigmastate.ErgoTree.EmptyConstants
import sigmastate.Values.{BigIntConstant, ByteConstant, ConstantPlaceholder, IntConstant, ShortConstant, SigmaPropValue}
import sigmastate._
import sigmastate.eval.Extensions.SigmaBooleanOps
import sigmastate.eval.IRContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.ergoplatform._
import scorex.crypto.authds.{ADDigest, ADKey, ADValue}
import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert, Remove}
import scorex.crypto.hash.{Blake2b256, Digest32}
import sigmastate.Values
import sigmastate.Values.{ErgoTree, LongConstant}
import sigmastate.{ErgoTree, Values}
import sigmastate.Values.LongConstant
import sigmastate.eval._
import sigmastate.helpers.{BlockchainState, CompilerTestingCommons, ErgoLikeContextTesting, ErgoLikeTestProvingInterpreter, ErgoTransactionValidator}
import sigmastate.helpers.TestingHelpers._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import org.ergoplatform._
import org.ergoplatform.settings.ErgoAlgos
import sigma.Colls
import sigma.ast.{SBoolean, SBox, SInt, SLong, SOption}
import sigmastate.Values.{BlockValue, ErgoTree, IntConstant, LongConstant, ValDef, ValUse}
import sigmastate._
import sigmastate.eval._
import sigmastate.Values.{BlockValue, IntConstant, LongConstant, ValDef, ValUse}
import sigmastate.{ErgoTree, _}
import sigmastate.helpers.TestingHelpers._
import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting}
import sigmastate.interpreter.ContextExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import org.scalatest.TryValues._
import sigmastate.crypto.DLogProtocol.DLogProverInput
import scorex.crypto.hash.Blake2b256
import sigma.data.{AvlTreeData, ProveDlog}
import sigmastate.Values.{BooleanConstant, ByteArrayConstant, ErgoTree}
import sigmastate.Values.{BooleanConstant, ByteArrayConstant}
import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter}
import sigmastate.helpers.TestingHelpers._
import sigmastate.lang.Terms._
import sigmastate.CompilerCrossVersionProps
import sigmastate.{CompilerCrossVersionProps, ErgoTree}

class CoopExampleSpecification extends CompilerTestingCommons
with CompilerCrossVersionProps {
Expand Down
6 changes: 3 additions & 3 deletions sdk/js/src/main/scala/org/ergoplatform/sdk/js/ErgoTree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.scalajs.js.annotation.JSExportTopLevel

/** An exported JavaScript class wrapping the Scala `Values.ErgoTree` type. */
@JSExportTopLevel("ErgoTree")
class ErgoTree(tree: Values.ErgoTree) extends js.Object {
class ErgoTree(tree: sigmastate.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 Down Expand Up @@ -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(Values.ErgoTree.fromHex(hex))
new ErgoTree(sigmastate.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(Values.ErgoTree.fromBytes(bytes))
new ErgoTree(sigmastate.ErgoTree.fromBytes(bytes))
}
}
Loading

0 comments on commit 42541ac

Please sign in to comment.