diff --git a/common/shared/src/main/scala/sigma/data/CollsOverArrays.scala b/common/shared/src/main/scala/sigma/data/CollsOverArrays.scala index 9b620898e8..a5bb543e1b 100644 --- a/common/shared/src/main/scala/sigma/data/CollsOverArrays.scala +++ b/common/shared/src/main/scala/sigma/data/CollsOverArrays.scala @@ -142,7 +142,7 @@ class CollOverArray[@specialized A](val toArray: Array[A], val builder: CollBuil override def hashCode() = CollectionUtil.deepHashCode(toArray) } -class CollOverArrayBuilder extends CollBuilder { builder => +private[sigma] class CollOverArrayBuilder extends CollBuilder { builder => @inline override def pairColl[@specialized A, @specialized B](as: Coll[A], bs: Coll[B]): PairColl[A, B] = { if (VersionContext.current.isJitActivated) { @@ -250,7 +250,7 @@ class PairOfCols[@specialized L, @specialized R](val ls: Coll[L], val rs: Coll[R RType.pairRType(tL, tR) } - override def builder: CollBuilder = new CollOverArrayBuilder + override def builder: CollBuilder = ls.builder override def toArray: Array[(L, R)] = ls.toArray.zip(rs.toArray) @inline override def length: Int = if (ls.length <= rs.length) ls.length else rs.length @inline override def apply(i: Int): (L, R) = (ls(i), rs(i)) diff --git a/common/shared/src/main/scala/sigma/package.scala b/common/shared/src/main/scala/sigma/package.scala index d9c0a18712..7ccb5990fd 100644 --- a/common/shared/src/main/scala/sigma/package.scala +++ b/common/shared/src/main/scala/sigma/package.scala @@ -68,4 +68,10 @@ package object sigma { * @return An RType object for the tuple type. */ def tupleRType(types: Array[SomeType]): RType[TupleData] = TupleType(types) + + /** The primary reference to global Coll operations. Can be used to create collections from Array etc. + * + * @see CollBuilder + */ + val Colls: CollBuilder = new CollOverArrayBuilder } \ No newline at end of file diff --git a/common/shared/src/test/scala/sigma/CollGens.scala b/common/shared/src/test/scala/sigma/CollGens.scala index abe6b8ba85..d18fcad29f 100644 --- a/common/shared/src/test/scala/sigma/CollGens.scala +++ b/common/shared/src/test/scala/sigma/CollGens.scala @@ -7,12 +7,11 @@ import spire.scalacompat.BuilderCompat import scala.collection.mutable import scala.collection.mutable.ArrayBuffer -import scala.language.implicitConversions trait CollGens { testSuite => import Gen._ - val builder: CollBuilder = new CollOverArrayBuilder + val builder: CollBuilder = sigma.Colls val valGen = choose(-100, 100) val byteGen = choose[Byte](-100, 100) val indexGen = choose(0, 100) @@ -115,8 +114,8 @@ trait CollGens { testSuite => val superGenByte = getSuperGen(1, Gen.oneOf(bytesOverArrayGen, replBytesCollGen)) val superGen = Gen.oneOf(superGenInt, superGenByte) val allGen = Gen.oneOf(superGen, collGen) - implicit val arbColl = Arbitrary(collGen) - implicit val arbBytes = Arbitrary(bytesGen) + implicit val arbColl : Arbitrary[Coll[Int]] = Arbitrary(collGen) + implicit val arbBytes: Arbitrary[Coll[Byte]] = Arbitrary(bytesGen) def eq0(x: Int) = x == 0 @@ -139,7 +138,7 @@ trait CollGens { testSuite => res } - implicit def buildableColl[T: RType] = new Buildable[T, Coll[T]] { + implicit def buildableColl[T: RType]: Buildable[T, Coll[T]] = new Buildable[T, Coll[T]] { def builder = new BuilderCompat[T, Coll[T]] { val al = new ArrayBuffer[T] diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala index a3abf97920..409c8e2a63 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala @@ -15,7 +15,7 @@ import sigmastate.eval._ import sigmastate.serialization.SigmaSerializer import sigmastate.utils.{Helpers, SigmaByteReader, SigmaByteWriter} import sigmastate.utxo.ExtractCreationInfo -import sigma._ +import sigma.{Colls, _} /** * Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency. In Bitcoin, such an object diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala index 13ae47b2e2..a167b95143 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala @@ -1,21 +1,20 @@ package org.ergoplatform -import java.util +import debox.cfor import org.ergoplatform.ErgoBox._ import org.ergoplatform.settings.ErgoAlgos import scorex.util.{ModifierId, bytesToId} +import sigma.Extensions.CollOps +import sigma.util.safeNewArray +import sigma.{Coll, Colls} +import sigmastate.SType.AnyOps import sigmastate.Values._ import sigmastate._ -import sigmastate.SType.AnyOps -import sigmastate.serialization.{SigmaSerializer, ValueSerializer} -import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import sigma.Coll -import sigmastate.eval._ import sigmastate.eval.Extensions._ +import sigmastate.eval._ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer -import sigma.util.safeNewArray -import debox.cfor -import sigma.Extensions.CollOps +import sigmastate.serialization.SigmaSerializer +import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} import scala.collection.{immutable, mutable} import scala.runtime.ScalaRunTime diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeTransaction.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeTransaction.scala index 2582b84e76..77ffc71f47 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeTransaction.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeTransaction.scala @@ -1,17 +1,18 @@ package org.ergoplatform +import debox.cfor import org.ergoplatform.ErgoBox.TokenId import scorex.crypto.authds.ADKey import scorex.crypto.hash.Blake2b256 import scorex.util._ +import sigma.Colls +import sigma.util.safeNewArray import sigmastate.SType._ import sigmastate.eval.Extensions._ import sigmastate.eval._ import sigmastate.interpreter.ProverResult -import sigmastate.serialization.{SigmaSerializer, ValueSerializer} -import sigma.util.safeNewArray +import sigmastate.serialization.SigmaSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import debox.cfor import scala.util.Try diff --git a/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala b/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala index 042df327b5..83f9b756c7 100644 --- a/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala +++ b/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala @@ -1,10 +1,9 @@ package sigmastate import sigmastate.crypto.CryptoConstants -import sigmastate.eval.Colls import sigmastate.serialization.SigmaSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import sigma.Coll +import sigma.{Coll, Colls} case class AvlTreeFlags(insertAllowed: Boolean, updateAllowed: Boolean, removeAllowed: Boolean) { diff --git a/interpreter/shared/src/main/scala/sigmastate/Values.scala b/interpreter/shared/src/main/scala/sigmastate/Values.scala index dd3f2881a0..dafea8a8f5 100644 --- a/interpreter/shared/src/main/scala/sigmastate/Values.scala +++ b/interpreter/shared/src/main/scala/sigmastate/Values.scala @@ -32,10 +32,9 @@ import sigmastate.lang.CheckingSigmaBuilder._ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.serialization.transformers.ProveDHTupleSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import sigma.{AvlTree, Header, PreHeader, _} +import sigma.{AvlTree, Coll, Colls, Header, PreHeader, _} import sigmastate.lang.SourceContext import sigma.util.safeNewArray -import sigma.Coll import scala.collection.compat.immutable.ArraySeq import scala.collection.mutable diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala b/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala index 370f728c65..839215226f 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala @@ -171,9 +171,6 @@ class CAvlTreeVerifier(startingDigest: ADDigest, * @see [[AvlTree]] for detailed descriptions */ case class CAvlTree(treeData: AvlTreeData) extends AvlTree with WrapperOf[AvlTreeData] { - val builder = CostingSigmaDslBuilder - val Colls = builder.Colls - override def wrappedValue: AvlTreeData = treeData override def keyLength: Int = treeData.keyLength @@ -494,7 +491,7 @@ class CostingSigmaDslBuilder extends SigmaDslBuilder { dsl => implicit val validationSettings: SigmaValidationSettings = ValidationRules.currentSettings // manual fix - override val Colls: CollBuilder = new CollOverArrayBuilder + override val Colls: CollBuilder = sigma.Colls override def BigInt(n: BigInteger): BigInt = CBigInt(n) diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala b/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala index c2ecc29971..c7cac60d81 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala @@ -17,7 +17,6 @@ import sigma._ import java.math.BigInteger object Extensions { - private val Colls = CostingSigmaDslBuilder.Colls implicit class ByteExt(val b: Byte) extends AnyVal { @inline def toBigInt: BigInt = CostingSigmaDslBuilder.BigInt(BigInteger.valueOf(b.toLong)) diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/package.scala b/interpreter/shared/src/main/scala/sigmastate/eval/package.scala index 79775d8c37..12b73de5f6 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/package.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/package.scala @@ -22,11 +22,6 @@ package object eval { */ val SigmaDsl = CostingSigmaDslBuilder - /** The primary reference to global Coll operations. Can be used to create collections from Array etc. - * @see CollBuilder - */ - val Colls: CollBuilder = SigmaDsl.Colls - /** Constructor of tuple value with more than 2 items. * Such long tuples are represented as Coll[Any]. * This representaion of tuples is different from representation of pairs (x, y), diff --git a/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala b/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala index 2e38aaab99..8d87d8ffce 100644 --- a/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala +++ b/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala @@ -3,7 +3,7 @@ package sigmastate.lang import debox.cfor import org.ergoplatform.ErgoBox.RegisterId import sigma.data.Nullable -import sigma.Environment +import sigma.{AnyValue, Coll, Colls, Environment} import sigmastate.SCollection.{SByteArray, SIntArray} import sigmastate.SOption.SIntOption import sigmastate.Values._ @@ -15,8 +15,6 @@ import sigmastate.lang.Terms.{STypeSubst, _} import sigmastate.serialization.OpCodes import sigmastate.serialization.OpCodes.OpCode import sigmastate.utxo._ -import sigma.Coll -import sigma.AnyValue import scala.util.DynamicVariable diff --git a/interpreter/shared/src/main/scala/sigmastate/trees.scala b/interpreter/shared/src/main/scala/sigmastate/trees.scala index ef21a47cea..2346ccd9e6 100644 --- a/interpreter/shared/src/main/scala/sigmastate/trees.scala +++ b/interpreter/shared/src/main/scala/sigmastate/trees.scala @@ -8,7 +8,7 @@ import sigma.data.ExactOrdering._ import sigma.data.OverloadHack.Overloaded1 import sigma.data.{ExactIntegral, ExactOrdering} import scorex.crypto.hash.{Blake2b256, CryptographicHash32, Sha256} -import sigma.VersionContext +import sigma.{Coll, Colls, GroupElement, SigmaProp, VersionContext} import sigmastate.ArithOp.OperationImpl import sigmastate.Operations._ import sigmastate.SCollection.{SByteArray, SIntArray} @@ -16,14 +16,12 @@ import sigmastate.SOption.SIntOption import sigmastate.Values._ import sigmastate.eval.Extensions.EvalCollOps import sigmastate.eval.NumericOps.{BigIntIsExactIntegral, BigIntIsExactOrdering} -import sigmastate.eval.{Colls, SigmaDsl} +import sigmastate.eval.SigmaDsl import sigmastate.interpreter.ErgoTreeEvaluator import sigmastate.interpreter.ErgoTreeEvaluator.DataEnv import sigmastate.serialization.OpCodes._ import sigmastate.serialization._ import sigmastate.utxo.{SimpleTransformerCompanion, Transformer} -import sigma.Coll -import sigma.{GroupElement, SigmaProp} import scala.collection.mutable import scala.collection.mutable.ArrayBuffer diff --git a/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala b/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala index f7ce8b46c4..9490f76965 100644 --- a/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala +++ b/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala @@ -4,7 +4,7 @@ import org.ergoplatform.ErgoBox.TokenId import scorex.util.{ModifierId, idToBytes} import scorex.utils.{Ints, Longs, Shorts} import sigmastate.eval.{Digest32Coll, SigmaDsl} -import sigma.Coll +import sigma.{Coll, Colls} object Extensions { implicit class ByteOpsForSigma(val b: Byte) extends AnyVal { @@ -25,7 +25,7 @@ object Extensions { * For example, the Short value {@code 0x1213} would yield the * byte array {@code {0x12, 0x13}}. */ - def toBytes: Coll[Byte] = SigmaDsl.Colls.fromArray(Shorts.toByteArray(x)) + def toBytes: Coll[Byte] = Colls.fromArray(Shorts.toByteArray(x)) /** Returns a big-endian representation of this numeric in a collection of Booleans. * Each boolean corresponds to one bit. @@ -38,7 +38,7 @@ object Extensions { * For example, the Int value {@code 0x12131415} would yield the * byte array {@code {0x12, 0x13, 0x14, 0x15}}. */ - def toBytes: Coll[Byte] = SigmaDsl.Colls.fromArray(Ints.toByteArray(x)) + def toBytes: Coll[Byte] = Colls.fromArray(Ints.toByteArray(x)) /** Returns a big-endian representation of this numeric in a collection of Booleans. * Each boolean corresponds to one bit. @@ -51,7 +51,7 @@ object Extensions { * For example, the Long value {@code 0x1213141516171819} would yield the * byte array {@code {0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19}}. */ - def toBytes: Coll[Byte] = SigmaDsl.Colls.fromArray(Longs.toByteArray(x)) + def toBytes: Coll[Byte] = Colls.fromArray(Longs.toByteArray(x)) /** Returns a big-endian representation of this numeric in a collection of Booleans. * Each boolean corresponds to one bit. @@ -67,7 +67,7 @@ object Extensions { */ implicit class ModifierIdOps(val id: ModifierId) extends AnyVal { /** @return a `Coll[Byte]` representation of the `ModifierId` (decodes using Base16). */ - def toColl: Coll[Byte] = SigmaDsl.Colls.fromArray(idToBytes(id)) + def toColl: Coll[Byte] = Colls.fromArray(idToBytes(id)) /** Converts this modifier id to to token id. */ def toTokenId: TokenId = Digest32Coll @@ toColl diff --git a/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala b/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala index b6427c880b..5693def9af 100644 --- a/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala +++ b/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala @@ -5,11 +5,9 @@ import io.circe.Decoder import org.ergoplatform.settings.ErgoAlgos import sigma.data.{OverloadHack, RType} import scorex.utils.Ints -import sigma.Environment -import sigmastate.eval.{CAnyValue, Colls, SigmaDsl} +import sigma.{Coll, Colls, Environment, GroupElement} +import sigmastate.eval.{CAnyValue, SigmaDsl} import sigmastate.crypto.CryptoConstants.EcPointType -import sigma.Coll -import sigma.GroupElement import java.util import java.util.concurrent.locks.Lock diff --git a/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala b/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala index a98915c55d..70f644bd66 100644 --- a/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala +++ b/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala @@ -9,8 +9,7 @@ import sigmastate.eval._ import sigmastate.interpreter.ContextExtension import sigmastate.interpreter.ErgoTreeEvaluator.DefaultEvalSettings import sigmastate.serialization.{GroupElementSerializer, SigmaSerializer} -import sigma.Coll -import sigma.{Box, Header, PreHeader} +import sigma.{Box, Coll, Colls, Header, PreHeader} object ErgoLikeContextTesting { /* NO HF PROOF: diff --git a/interpreter/shared/src/test/scala/sigmastate/serialization/AvlTreeSpecification.scala b/interpreter/shared/src/test/scala/sigmastate/serialization/AvlTreeSpecification.scala index 42c71278ef..8a0b4b9255 100644 --- a/interpreter/shared/src/test/scala/sigmastate/serialization/AvlTreeSpecification.scala +++ b/interpreter/shared/src/test/scala/sigmastate/serialization/AvlTreeSpecification.scala @@ -3,6 +3,7 @@ package sigmastate.serialization import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert} import scorex.crypto.hash.{Blake2b256, Digest32} +import sigma.Colls import sigmastate.Values.AvlTreeConstant import sigmastate.AvlTreeFlags import sigmastate._ diff --git a/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala b/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala index 23c4f69201..04b016376a 100644 --- a/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala +++ b/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala @@ -12,7 +12,7 @@ import sigmastate.eval._ import sigmastate.eval.Extensions._ import sigmastate.Values._ import sigmastate.eval.Evaluation -import sigma.AvlTree +import sigma.{AvlTree, Colls} import SType.AnyOps import scorex.util.encode.Base16 import sigmastate.exceptions.SerializerException diff --git a/interpreter/shared/src/test/scala/sigmastate/serialization/DataSerializerSpecification.scala b/interpreter/shared/src/test/scala/sigmastate/serialization/DataSerializerSpecification.scala index eba0e9b90c..c02df973dc 100644 --- a/interpreter/shared/src/test/scala/sigmastate/serialization/DataSerializerSpecification.scala +++ b/interpreter/shared/src/test/scala/sigmastate/serialization/DataSerializerSpecification.scala @@ -11,7 +11,7 @@ import sigmastate.eval.Evaluation import sigmastate.eval._ import sigmastate.eval.Extensions._ import sigmastate.crypto.CryptoConstants.EcPointType -import sigma.AvlTree +import sigma.{AvlTree, Colls} import SType.AnyOps import sigmastate.exceptions.SerializerException import sigmastate.interpreter.{CostAccumulator, ErgoTreeEvaluator} diff --git a/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala b/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala index 5c7827b5cc..f5e695e32d 100644 --- a/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala +++ b/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala @@ -14,7 +14,7 @@ import sigmastate.Values.{ByteArrayConstant, ConcreteCollection, ConstantPlaceho import sigmastate.crypto.CryptoConstants.EcPointType import sigmastate.crypto.DLogProtocol.ProveDlog import sigmastate.crypto.ProveDHTuple -import sigmastate.eval.{Colls, _} +import sigmastate.eval._ import sigmastate.eval.Extensions._ import sigmastate.eval.{CAvlTree, CBigInt, CHeader, CPreHeader, CSigmaProp, CostingBox, CostingSigmaDslBuilder, SigmaDsl} import sigmastate.helpers.TestingCommons diff --git a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala index 98b8a79bba..5950b8fcdb 100644 --- a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala +++ b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala @@ -3,10 +3,10 @@ package org.ergoplatform.dsl import org.ergoplatform.ErgoBox.{BoxId, NonMandatoryRegisterId, TokenId} import sigmastate.interpreter.{CostedProverResult, ProverResult} import sigma.data.RType -import org.ergoplatform.{ErgoLikeContext, ErgoBox} -import sigma.{SigmaDslBuilder, AnyValue, SigmaProp} +import org.ergoplatform.{ErgoBox, ErgoLikeContext} +import sigma.{AnyValue, Coll, SigmaDslBuilder, SigmaProp} import sigmastate.Values.ErgoTree -import sigmastate.eval.{IRContext, CostingSigmaDslBuilder} +import sigmastate.eval.{CostingSigmaDslBuilder, IRContext} import scala.util.Try import org.ergoplatform.dsl.ContractSyntax.{ErgoScript, Proposition, Token} @@ -17,7 +17,7 @@ trait ContractSpec { val dsl: SigmaDslBuilder = CostingSigmaDslBuilder val Colls = dsl.Colls - implicit def Coll[T](items: Array[T])(implicit cT: RType[T]) = Colls.fromArray(items) + implicit def Coll[T](items: Array[T])(implicit cT: RType[T]): Coll[T] = Colls.fromArray(items) val IR: IRContext diff --git a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala index 665899cb5c..de3012ff8f 100644 --- a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala +++ b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala @@ -8,7 +8,6 @@ import org.ergoplatform.dsl.ContractSyntax.{ErgoScript, Proposition} import sigmastate.eval.{CostingSigmaDslBuilder, Evaluation} import sigmastate.interpreter.Interpreter.ScriptEnv import sigma.{SigmaProp, SigmaContract, Context, SigmaDslBuilder} -import scala.language.implicitConversions /** Defines methods to be used in contract implementations based on [[SigmaContract]]. */ trait ContractSyntax { contract: SigmaContract => diff --git a/sc/shared/src/main/scala/scalan/Base.scala b/sc/shared/src/main/scala/scalan/Base.scala index 46f8557dd7..cc29af45b9 100644 --- a/sc/shared/src/main/scala/scalan/Base.scala +++ b/sc/shared/src/main/scala/scalan/Base.scala @@ -7,7 +7,7 @@ import sigma.util.StringUtil import sigma.reflection.RConstructor import java.util.Arrays -import scala.annotation.implicitNotFound +import scala.annotation.{implicitNotFound, unused} import scala.annotation.unchecked.uncheckedVariance import scala.collection.compat.immutable.ArraySeq import scala.collection.mutable @@ -453,7 +453,7 @@ abstract class Base { scalan: Scalan => } /** Apply this transformer to the nodes present in the sequence, * and leave non-Ref items unchanged. */ - final def apply(xs: Seq[Any])(implicit o: Overloaded1): Seq[Any] = { + final def apply(xs: Seq[Any])(implicit @unused o: Overloaded1): Seq[Any] = { val len = xs.length if (len == 0) ArraySeq.empty else { diff --git a/sc/shared/src/main/scala/scalan/DefRewriting.scala b/sc/shared/src/main/scala/scalan/DefRewriting.scala index fe63bb6b2b..114fb1b0e6 100644 --- a/sc/shared/src/main/scala/scalan/DefRewriting.scala +++ b/sc/shared/src/main/scala/scalan/DefRewriting.scala @@ -14,18 +14,19 @@ trait DefRewriting { scalan: Scalan => case Tup(Def(First(a)), Def(Second(b))) if a == b => a // Rule: convert(eFrom, eTo, x, conv) if x.elem <:< eFrom ==> conv(x) - case Convert(eFrom: Elem[from], eTo: Elem[to], x, conv) if x.elem <:< eFrom => + case Convert(eFrom: Elem[from], _: Elem[to], x, conv) if x.elem <:< eFrom => mkApply(conv, x) case Apply(f @ Def(l: Lambda[a,b]), x, mayInline) if mayInline && l.mayInline => mkApply(f, x) - case call @ MethodCall(receiver, m, args, neverInvoke) => + case call @ MethodCall(receiver, m, args, _) => call.tryInvoke match { // Rule: receiver.m(args) ==> body(m).subst{xs -> args} case InvokeSuccess(res) => res case InvokeFailure(e) if !e.isInstanceOf[DelayInvokeException] => throwInvocationException("Method invocation in rewriteDef", e, receiver, m, args) + case InvokeFailure(ex) => throw ex case InvokeImpossible => val res = rewriteNonInvokableMethodCall(call) if (res != null) res diff --git a/sc/shared/src/main/scala/scalan/Entities.scala b/sc/shared/src/main/scala/scalan/Entities.scala index 1a74349cc7..8a32dcde10 100644 --- a/sc/shared/src/main/scala/scalan/Entities.scala +++ b/sc/shared/src/main/scala/scalan/Entities.scala @@ -1,7 +1,5 @@ package scalan -import scala.language.higherKinds - /** A slice in the Scalan cake with base classes for various descriptors. */ trait Entities extends TypeDescs { self: Scalan => diff --git a/sc/shared/src/test/scala/org/ergoplatform/ErgoTreePredefSpec.scala b/sc/shared/src/test/scala/org/ergoplatform/ErgoTreePredefSpec.scala index eb22fdc92e..d017b6ca35 100644 --- a/sc/shared/src/test/scala/org/ergoplatform/ErgoTreePredefSpec.scala +++ b/sc/shared/src/test/scala/org/ergoplatform/ErgoTreePredefSpec.scala @@ -7,6 +7,7 @@ import org.ergoplatform.settings.MonetarySettings import org.scalacheck.Gen import scorex.crypto.hash.Blake2b256 import scorex.util.Random +import sigma.Colls import sigma.util.BenchmarkUtil.measure import sigmastate.Values.{ByteArrayConstant, CollectionConstant, ErgoTree, IntConstant, SigmaPropConstant} import sigmastate._ @@ -18,7 +19,7 @@ import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.lang.Terms.ValueOps import sigmastate.serialization.ValueSerializer import sigmastate.utxo.{ByIndex, ExtractCreationInfo, SelectField} -import sigmastate.eval.{Colls, Digest32Coll} +import sigmastate.eval.Digest32Coll import sigmastate.utils.Helpers._ import scala.util.Try diff --git a/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala b/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala index c576e24096..c46b5a3119 100644 --- a/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala @@ -7,7 +7,6 @@ import org.scalatest.BeforeAndAfterAll import sigmastate.SPrimType.MaxPrimTypeCode import sigmastate.Values.ErgoTree.EmptyConstants import sigmastate.Values.{ByteArrayConstant, ErgoTree, IntConstant, NotReadyValueInt, UnparsedErgoTree, ValueCompanion} -import sigmastate.eval.Colls import sigmastate.exceptions.{InterpreterException, SerializerException} import sigmastate.helpers.TestingHelpers._ import sigmastate.helpers.{CompilerTestingCommons, ErgoLikeContextTesting, ErgoLikeTestInterpreter, ErgoLikeTestProvingInterpreter} @@ -20,7 +19,7 @@ import sigmastate.serialization.SigmaSerializer.startReader import sigmastate.serialization._ import sigmastate.utils.Helpers._ import sigmastate.utxo.DeserializeContext -import sigma.SigmaTestingData +import sigma.{Colls, SigmaTestingData} class SoftForkabilitySpecification extends SigmaTestingData with CompilerTestingCommons diff --git a/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala b/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala index 51ddde1afa..3ff75079ab 100644 --- a/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala +++ b/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala @@ -8,7 +8,7 @@ import org.scalacheck.Gen import org.scalatest.Assertion import sigma.util.BenchmarkUtil import scalan.TestContexts -import sigma.TestUtils +import sigma.{Colls, TestUtils} import sigma.data.RType import sigmastate.Values.{Constant, ErgoTree, SValue, SigmaBoolean, SigmaPropValue} import sigmastate.eval._ @@ -63,7 +63,7 @@ trait CompilerTestingCommons extends TestingCommons val buf = new Array[sigma.AnyValue](2) Array.copy(vars, 0, buf, 0, vars.length) buf(1) = ctxVar - CostingSigmaDslBuilder.Colls.fromArray(buf) + Colls.fromArray(buf) } else { ctx.vars.updated(1, ctxVar) } diff --git a/sc/shared/src/test/scala/sigmastate/lang/SigmaTyperTest.scala b/sc/shared/src/test/scala/sigmastate/lang/SigmaTyperTest.scala index 5a1b93fdf5..b12938db03 100644 --- a/sc/shared/src/test/scala/sigmastate/lang/SigmaTyperTest.scala +++ b/sc/shared/src/test/scala/sigmastate/lang/SigmaTyperTest.scala @@ -5,12 +5,12 @@ import org.ergoplatform._ import org.scalatest.matchers.should.Matchers import org.scalatest.propspec.AnyPropSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks +import sigma.Colls import sigmastate.SCollection._ import sigmastate.Values._ import sigmastate._ import sigmastate.crypto.CryptoConstants import sigmastate.crypto.DLogProtocol.{DLogProverInput, ProveDlog} -import sigmastate.eval.Colls import sigmastate.exceptions.TyperException import sigmastate.interpreter.Interpreter.ScriptEnv import sigmastate.lang.SigmaPredef._ diff --git a/sc/shared/src/test/scala/sigmastate/serialization/DeserializationResilience.scala b/sc/shared/src/test/scala/sigmastate/serialization/DeserializationResilience.scala index 817b42ffdf..7300731fc3 100644 --- a/sc/shared/src/test/scala/sigmastate/serialization/DeserializationResilience.scala +++ b/sc/shared/src/test/scala/sigmastate/serialization/DeserializationResilience.scala @@ -9,7 +9,7 @@ import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert} import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.hash.{Blake2b256, Digest32} import scorex.util.serialization.{Reader, VLQByteBufferReader} -import sigma.Environment +import sigma.{Colls, Environment} import sigmastate.Values.{BlockValue, GetVarInt, IntConstant, SValue, SigmaBoolean, SigmaPropValue, Tuple, ValDef, ValUse} import sigmastate._ import sigmastate.crypto.CryptoConstants diff --git a/sc/shared/src/test/scala/sigmastate/utxo/blockchain/BlockchainSimulationTestingCommons.scala b/sc/shared/src/test/scala/sigmastate/utxo/blockchain/BlockchainSimulationTestingCommons.scala index d22b706267..e9cf82616b 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/blockchain/BlockchainSimulationTestingCommons.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/blockchain/BlockchainSimulationTestingCommons.scala @@ -8,12 +8,14 @@ import scorex.crypto.hash.{Blake2b256, Digest32} import sigmastate.{AvlTreeData, AvlTreeFlags, Values} import sigmastate.Values.{ErgoTree, LongConstant} import sigmastate.eval._ -import sigmastate.helpers.{BlockchainState, ErgoLikeContextTesting, ErgoLikeTestProvingInterpreter, ErgoTransactionValidator, CompilerTestingCommons} +import sigmastate.helpers.{BlockchainState, CompilerTestingCommons, ErgoLikeContextTesting, ErgoLikeTestProvingInterpreter, ErgoTransactionValidator} import sigmastate.helpers.TestingHelpers._ import sigmastate.utils.Helpers._ + import scala.collection.mutable import scala.util.{Random, Try} import scorex.util._ +import sigma.Colls import sigmastate.interpreter.ContextExtension import sigmastate.interpreter.Interpreter.{ScriptNameProp, emptyEnv} import sigmastate.utxo.blockchain.BlockchainSimulationTestingCommons.{FullBlock, ValidationState} diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/CoinEmissionSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/CoinEmissionSpecification.scala index 382962c8fc..a6c612a037 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/CoinEmissionSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/CoinEmissionSpecification.scala @@ -2,16 +2,17 @@ package sigmastate.utxo.examples import org.ergoplatform._ import org.ergoplatform.settings.ErgoAlgos +import sigma.Colls import sigmastate.Values.{BlockValue, ErgoTree, IntConstant, LongConstant, ValDef, ValUse} -import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, SigmaPPrint, CompilerTestingCommons} +import sigmastate._ +import sigmastate.eval._ import sigmastate.helpers.TestingHelpers._ +import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting} import sigmastate.interpreter.ContextExtension import sigmastate.interpreter.Interpreter.{ScriptNameProp, emptyEnv} import sigmastate.lang.Terms._ -import sigmastate.utxo.blockchain.BlockchainSimulationTestingCommons._ import sigmastate.utxo._ -import sigmastate._ -import sigmastate.eval._ +import sigmastate.utxo.blockchain.BlockchainSimulationTestingCommons._ /** * An example of currency emission contract. diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/FsmExampleSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/FsmExampleSpecification.scala index 99008b9e21..77918e453a 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/FsmExampleSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/FsmExampleSpecification.scala @@ -5,12 +5,13 @@ import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert, Lookup} import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.hash import scorex.crypto.hash.{Blake2b256, Digest32} +import sigma.Colls import sigmastate.SCollection.SByteArray import sigmastate.Values._ import sigmastate._ import sigmastate.eval._ import sigmastate.lang.Terms._ -import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter, CompilerTestingCommons} +import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter} import sigmastate.helpers.TestingHelpers._ import sigmastate.interpreter.Interpreter.{ScriptNameProp, emptyEnv} import sigmastate.serialization.ValueSerializer diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/IcoExample.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/IcoExample.scala index bab97e59e8..95899f0aa9 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/IcoExample.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/IcoExample.scala @@ -8,6 +8,7 @@ import org.scalatest.BeforeAndAfterAll import scorex.crypto.authds.avltree.batch._ import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.hash.{Blake2b256, Digest32} +import sigma.Colls import sigmastate.Values._ import sigmastate._ import sigmastate.crypto.CryptoConstants diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/LetsSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/LetsSpecification.scala index ef95e480f8..22f7f1c7c9 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/LetsSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/LetsSpecification.scala @@ -5,10 +5,11 @@ import org.ergoplatform.ErgoBox.{R4, R5} import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert, Lookup} import scorex.crypto.hash.{Blake2b256, Digest32} +import sigma.Colls import sigmastate.{AvlTreeData, AvlTreeFlags, CompilerCrossVersionProps, TrivialProp} import sigmastate.Values.{AvlTreeConstant, ByteArrayConstant, LongConstant, SigmaPropConstant} import sigmastate.eval.Extensions.ArrayOps -import sigmastate.eval.{Colls, Digest32Coll, IRContext, SigmaDsl} +import sigmastate.eval.{Digest32Coll, IRContext, SigmaDsl} import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestProvingInterpreter} import sigmastate.helpers.TestingHelpers._ import sigmastate.interpreter.Interpreter.ScriptNameProp diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/Rule110Specification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/Rule110Specification.scala index 62fbaf37a7..00b25ba8e1 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/Rule110Specification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/Rule110Specification.scala @@ -3,10 +3,11 @@ package sigmastate.utxo.examples import org.ergoplatform._ import scorex.crypto.hash.Blake2b256 import scorex.util._ +import sigma.Colls import sigmastate.Values._ import sigmastate._ import sigmastate.eval._ -import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, CompilerTestingCommons, ErgoLikeTestInterpreter} +import sigmastate.helpers.{CompilerTestingCommons, ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter} import sigmastate.helpers.TestingHelpers._ import sigmastate.interpreter.ContextExtension import sigmastate.lang.Terms._ diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Isos.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Isos.scala index 0367ad54cc..aa5abb1856 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Isos.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Isos.scala @@ -11,7 +11,7 @@ import scorex.util.ModifierId import scorex.util.encode.Base16 import sigmastate.Values.{Constant, GroupElementConstant} import sigmastate.eval.Extensions.ArrayOps -import sigmastate.eval.{CAvlTree, CBigInt, CHeader, CPreHeader, Colls, Digest32Coll, Evaluation} +import sigmastate.eval.{CAvlTree, CBigInt, CHeader, CPreHeader, Digest32Coll, Evaluation} import sigmastate.fleetSdkCommon.distEsmTypesBoxesMod.Box import sigmastate.fleetSdkCommon.distEsmTypesCommonMod.HexString import sigmastate.fleetSdkCommon.distEsmTypesRegistersMod.NonMandatoryRegisters @@ -21,9 +21,8 @@ import sigmastate.fleetSdkCommon.{distEsmTypesBoxesMod => boxesMod, distEsmTypes import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.serialization.{ErgoTreeSerializer, ValueSerializer} import sigmastate.{AvlTreeData, AvlTreeFlags, SType} -import sigma.Coll +import sigma.{Coll, Colls, GroupElement} import sigma.Extensions.CollBytesOps -import sigma.GroupElement import java.math.BigInteger import scala.collection.immutable.ListMap diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Value.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Value.scala index 6bcae003fa..e3a3d15b9a 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Value.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Value.scala @@ -7,13 +7,13 @@ import scorex.util.Extensions.{IntOps, LongOps} import scorex.util.encode.Base16 import sigmastate.SType import sigmastate.crypto.Platform -import sigmastate.eval.{CAvlTree, CGroupElement, CSigmaProp, Colls, CostingBox, Evaluation, SigmaDsl} +import sigmastate.eval.{CAvlTree, CGroupElement, CSigmaProp, CostingBox, Evaluation, SigmaDsl} import sigmastate.fleetSdkCommon.distEsmTypesBoxesMod.Box import sigmastate.fleetSdkCommon.distEsmTypesCommonMod import sigmastate.fleetSdkCommon.distEsmTypesRegistersMod.NonMandatoryRegisters import sigmastate.lang.DeserializationSigmaBuilder import sigmastate.serialization.{ConstantSerializer, DataSerializer, SigmaSerializer} -import sigma.Coll +import sigma.{Coll, Colls} import java.math.BigInteger import scala.scalajs.js diff --git a/sdk/js/src/test/scala/org/ergoplatform/sdk/js/IsosSpec.scala b/sdk/js/src/test/scala/org/ergoplatform/sdk/js/IsosSpec.scala index aaa7159758..135571aabe 100644 --- a/sdk/js/src/test/scala/org/ergoplatform/sdk/js/IsosSpec.scala +++ b/sdk/js/src/test/scala/org/ergoplatform/sdk/js/IsosSpec.scala @@ -10,11 +10,9 @@ import org.scalatest.propspec.AnyPropSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import sigmastate.SType import sigmastate.Values.Constant -import sigmastate.eval.Colls import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.serialization.generators.ObjectGenerators -import sigma.Coll -import sigma.GroupElement +import sigma.{Coll, Colls, GroupElement} import scala.scalajs.js diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala index 6a63599059..d0c64fbfa7 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala @@ -1,38 +1,33 @@ package org.ergoplatform.sdk -import sigma.data.RType -import sigma.Coll - -import scala.collection.{JavaConverters, mutable} -import org.ergoplatform._ +import org.ergoplatform.ErgoAddressEncoder.NetworkPrefix import org.ergoplatform.ErgoBox.{Token, TokenId} -import sigmastate.SType -import sigmastate.Values.{Constant, ErgoTree, EvaluatedValue, SValue, SigmaBoolean, SigmaPropConstant} -import sigmastate.serialization.{ErgoTreeSerializer, GroupElementSerializer, SigmaSerializer, ValueSerializer} -import scorex.crypto.authds.ADKey +import org.ergoplatform._ +import org.ergoplatform.sdk.Extensions.{CollBuilderOps, PairCollOps} +import org.ergoplatform.sdk.JavaHelpers.{TokenColl, TokenIdRType} +import org.ergoplatform.sdk.wallet.secrets.{DerivationPath, ExtendedSecretKey} +import org.ergoplatform.sdk.wallet.{Constants, TokensMap} import org.ergoplatform.settings.ErgoAlgos -import sigmastate.eval.{CPreHeader, Colls, CostingSigmaDslBuilder, Digest32Coll, Evaluation} -import sigma.{AnyValue, AvlTree, GroupElement, Header} -import sigmastate.utils.Helpers._ // don't remove, required for Scala 2.11 - -import java.util -import java.lang.{Boolean => JBoolean, Byte => JByte, Integer => JInt, Long => JLong, Short => JShort, String => JString} -import java.util.{List => JList, Map => JMap} -import org.ergoplatform.ErgoAddressEncoder.NetworkPrefix +import scorex.crypto.authds.ADKey import scorex.util.encode.Base16 -import sigmastate.crypto.DLogProtocol.ProveDlog import scorex.util.{ModifierId, bytesToId, idToBytes} -import org.ergoplatform.sdk.JavaHelpers.{TokenColl, TokenIdRType} -import org.ergoplatform.sdk.Extensions.{CollBuilderOps, PairCollOps} -import org.ergoplatform.sdk.wallet.{Constants, TokensMap} -import org.ergoplatform.sdk.wallet.secrets.{DerivationPath, ExtendedSecretKey} import sigma.data.ExactIntegral.LongIsExactIntegral +import sigma.data.RType import sigma.util.StringUtil.StringUtilExtensions +import sigma.{AnyValue, AvlTree, Coll, Colls, GroupElement, Header} +import sigmastate.SType +import sigmastate.Values.{Constant, ErgoTree, EvaluatedValue, SValue, SigmaBoolean, SigmaPropConstant} import sigmastate.crypto.CryptoConstants.EcPointType -import sigmastate.crypto.{DiffieHellmanTupleProverInput, ProveDHTuple} -import sigmastate.crypto.CryptoFacade +import sigmastate.crypto.DLogProtocol.ProveDlog +import sigmastate.crypto.{CryptoFacade, DiffieHellmanTupleProverInput, ProveDHTuple} +import sigmastate.eval.{CostingSigmaDslBuilder, Digest32Coll, Evaluation} +import sigmastate.serialization.{ErgoTreeSerializer, GroupElementSerializer, SigmaSerializer, ValueSerializer} +import java.lang.{Boolean => JBoolean, Byte => JByte, Integer => JInt, Long => JLong, Short => JShort, String => JString} import java.math.BigInteger +import java.util +import java.util.{List => JList, Map => JMap} +import scala.collection.{JavaConverters, mutable} /** Type-class of isomorphisms between types. * Isomorphism between two types `A` and `B` essentially say that both types diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala index 905983d7a2..bad2ce21bd 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala @@ -16,8 +16,7 @@ import sigmastate.eval.{CPreHeader, WrapperOf, _} import sigmastate.exceptions.SigmaException import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.{AvlTreeData, AvlTreeFlags, SType} -import sigma.Coll -import sigma.{AnyValue, Header, PreHeader} +import sigma.{AnyValue, Coll, Colls, Header, PreHeader} import scala.util.Try import sigmastate.utils.Helpers._ // required for Scala 2.11 diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/OutBoxBuilder.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/OutBoxBuilder.scala index fa963d524d..61a71fcfa2 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/OutBoxBuilder.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/OutBoxBuilder.scala @@ -3,10 +3,10 @@ package org.ergoplatform.sdk import org.ergoplatform.ErgoBox.TokenId import org.ergoplatform.sdk.JavaHelpers.collRType import org.ergoplatform.{ErgoBox, ErgoBoxCandidate, SigmaConstants} +import sigma.Colls import sigma.data.RType import sigmastate.SType import sigmastate.Values.{Constant, ErgoTree, EvaluatedValue} -import sigmastate.eval.Colls import scala.collection.mutable.ArrayBuffer diff --git a/sdk/shared/src/test/scala/org/ergoplatform/sdk/DataJsonEncoderSpecification.scala b/sdk/shared/src/test/scala/org/ergoplatform/sdk/DataJsonEncoderSpecification.scala index 0886fb845b..89330bc759 100644 --- a/sdk/shared/src/test/scala/org/ergoplatform/sdk/DataJsonEncoderSpecification.scala +++ b/sdk/shared/src/test/scala/org/ergoplatform/sdk/DataJsonEncoderSpecification.scala @@ -13,7 +13,7 @@ import sigmastate.eval.Extensions._ import sigmastate.eval.{Evaluation, _} import sigmastate.crypto.CryptoConstants.EcPointType import sigmastate.exceptions.SerializerException -import sigma.{AvlTree, Box} +import sigma.{AvlTree, Box, Colls} import sigmastate.serialization.SerializationSpecification import scala.annotation.nowarn