From 9d4d53cae1c82b30260a18aa115bc13cd40f6fd5 Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Tue, 22 Aug 2023 18:10:58 +0200 Subject: [PATCH] minimize-modules: replaced special.collection -> sigma.collection and special.sigma -> sigma --- .../kiama/util/Collections.scala | 2 +- .../kiama/util/Collections.scala | 2 +- .../CoreLibReflection.scala | 44 ++---------------- .../scala/{special => }/sigma/SigmaDsl.scala | 6 +-- .../main/scala/{special => sigma}/Types.scala | 9 ++-- .../collection/CollType.scala | 2 +- .../{special => sigma}/collection/Colls.scala | 2 +- .../collection/CollsOverArrays.scala | 2 +- .../collection/Extensions.scala | 2 +- .../collection/package.scala | 2 +- .../scala/{special => }/sigma/package.scala | 1 - .../scala/{special => sigma}/TypesTests.scala | 8 ++-- .../collections/CollGens.scala | 4 +- .../collections/CollsTests.scala | 14 +++--- .../src/main/scala/sigmastate/Platform.scala | 8 ++-- .../scala/sigmastate/crypto/Platform.scala | 4 +- .../src/main/scala/sigmastate/Platform.scala | 8 ++-- .../scala/sigmastate/crypto/Platform.scala | 4 +- .../scala/org/ergoplatform/ErgoAddress.scala | 2 +- .../main/scala/org/ergoplatform/ErgoBox.scala | 2 +- .../org/ergoplatform/ErgoBoxCandidate.scala | 4 +- .../org/ergoplatform/ErgoLikeContext.scala | 11 +++-- .../org/ergoplatform/dsl/AvlTreeHelpers.scala | 4 +- .../org/ergoplatform/settings/ErgoAlgos.scala | 2 +- .../main/scala/sigmastate/AvlTreeData.scala | 2 +- .../scala/sigmastate/DataValueComparer.scala | 4 +- .../sigmastate/InterpreterReflection.scala | 10 ++--- .../src/main/scala/sigmastate/Values.scala | 4 +- .../sigmastate/basics/DLogProtocol.scala | 2 +- .../basics/DiffieHellmanTupleProtocol.scala | 2 +- .../basics/SigmaProtocolFunctions.scala | 3 +- .../scala/sigmastate/eval/BigIntegerOps.scala | 4 +- .../sigmastate/eval/CostingDataContext.scala | 8 ++-- .../scala/sigmastate/eval/Evaluation.scala | 8 ++-- .../scala/sigmastate/eval/Extensions.scala | 4 +- .../main/scala/sigmastate/eval/package.scala | 6 +-- .../interpreter/ErgoTreeEvaluator.scala | 8 ++-- .../sigmastate/interpreter/Interpreter.scala | 2 +- .../interpreter/InterpreterContext.scala | 7 ++- .../interpreter/ProverInterpreter.scala | 2 +- .../scala/sigmastate/lang/SigmaBuilder.scala | 4 +- .../serialization/DataSerializer.scala | 4 +- .../src/main/scala/sigmastate/trees.scala | 6 +-- .../src/main/scala/sigmastate/types.scala | 6 +-- .../scala/sigmastate/utils/Extensions.scala | 2 +- .../main/scala/sigmastate/utils/Helpers.scala | 4 +- .../scala/sigmastate/utxo/transformers.scala | 8 ++-- .../SigmaProtocolSpecification.scala | 2 +- .../scala/sigmastate/eval/BasicOpsTests.scala | 2 +- .../helpers/ErgoLikeContextTesting.scala | 4 +- .../sigmastate/helpers/TestingHelpers.scala | 4 +- .../sigmastate/lang/SigmaBuilderTest.scala | 2 +- .../ConstantSerializerSpecification.scala | 2 +- .../DataSerializerSpecification.scala | 2 +- .../generators/ObjectGenerators.scala | 6 +-- .../special/sigma/ContractsTestkit.scala | 4 +- .../special/sigma/SigmaTestingData.scala | 6 +-- .../scala/sigmastate/lang/LangTests.scala | 4 +- .../scala/sigmastate/ErgoTreeBenchmarks.scala | 2 +- .../sigmastate/ReflectionGenerator.scala | 4 +- .../sigmastate/helpers/SigmaPPrintSpec.scala | 4 +- .../special/collections/BasicBenchmarks.scala | 2 +- .../special/collections/BenchmarkGens.scala | 4 +- .../special/collections/BufferBenchmark.scala | 2 +- .../special/collections/CollBenchmark.scala | 6 +-- .../special/collections/MapBenchmark.scala | 2 +- .../special/collections/SymBenchmark.scala | 2 +- .../org/ergoplatform/dsl/ContractSpec.scala | 2 +- .../org/ergoplatform/dsl/ContractSyntax.scala | 2 +- .../ergoplatform/dsl/ErgoContractSpec.scala | 2 +- .../main/scala/scalan/GraphIRReflection.scala | 45 +++++++++++++++++-- sc/shared/src/main/scala/scalan/Library.scala | 2 +- .../scala/sigmastate/eval/GraphBuilding.scala | 4 +- .../scala/sigmastate/eval/SigmaLibrary.scala | 4 +- .../scala/special/collection/CollsUnit.scala | 4 +- .../special/collection/impl/CollsImpl.scala | 12 +++-- .../scala/special/sigma/SigmaDslUnit.scala | 2 +- .../special/sigma/impl/SigmaDslImpl.scala | 24 +++++----- .../sigma/wrappers/WrappersModule.scala | 2 +- .../scala/special/wrappers/WrappersSpec.scala | 0 .../ErgoAddressSpecification.scala | 2 +- .../ErgoLikeTransactionSpec.scala | 4 +- .../ergoplatform/dsl/TestContractSpec.scala | 2 +- .../src/test/scala/scalan/TestContexts.scala | 2 +- .../sigmastate/ErgoTreeSpecification.scala | 4 +- .../ScriptVersionSwitchSpecification.scala | 2 +- .../SoftForkabilitySpecification.scala | 2 +- .../scala/sigmastate/TypesSpecification.scala | 2 +- .../sigmastate/eval/ErgoScriptTestkit.scala | 2 +- .../helpers/CompilerTestingCommons.scala | 4 +- .../sigmastate/helpers/SigmaPPrint.scala | 4 +- .../utxo/AVLTreeScriptsSpecification.scala | 4 +- .../utxo/ContextEnrichingSpecification.scala | 2 +- .../UsingContextPropertiesSpecification.scala | 2 +- .../utxo/examples/AssetsAtomicExchange.scala | 4 +- .../AssetsAtomicExchangeErgoTests.scala | 2 +- .../utxo/examples/AssetsPartialFilling.scala | 4 +- .../utxo/examples/CrowdFunding.scala | 2 +- .../examples/DummyExamplesSpecification.scala | 4 +- .../ExecuteFromExamplesSpecification.scala | 2 +- ...racleDataInputsExamplesSpecification.scala | 4 +- .../OracleExamplesSpecification.scala | 2 +- .../OracleTokenExamplesSpecification.scala | 4 +- .../RevenueSharingExamplesSpecification.scala | 2 +- .../collections/CollsStagingTests.scala | 6 +-- .../DataValueComparerSpecification.scala | 4 +- .../test/scala/special/sigma/LoopTests.scala | 2 +- .../special/sigma/SigmaDslSpecification.scala | 24 +++++----- .../special/sigma/SigmaDslStaginTests.scala | 25 +++++------ .../scala/special/sigma/SigmaDslTesting.scala | 6 +-- .../org/ergoplatform/sdk/js/AvlTree.scala | 2 +- .../ergoplatform/sdk/js/GroupElement.scala | 2 +- .../org/ergoplatform/sdk/js/Header.scala | 2 +- .../scala/org/ergoplatform/sdk/js/Isos.scala | 13 +++--- .../org/ergoplatform/sdk/js/PreHeader.scala | 2 +- .../org/ergoplatform/sdk/js/SigmaProp.scala | 2 +- .../scala/org/ergoplatform/sdk/js/Type.scala | 20 ++++----- .../scala/org/ergoplatform/sdk/js/Value.scala | 30 ++++++------- .../org/ergoplatform/sdk/js/IsosSpec.scala | 5 +-- .../org/ergoplatform/sdk/js/ValueSpec.scala | 2 +- .../ergoplatform/sdk/BlockchainContext.scala | 4 +- .../ergoplatform/sdk/DataJsonEncoder.scala | 4 +- .../org/ergoplatform/sdk/Extensions.scala | 4 +- .../org/ergoplatform/sdk/JavaHelpers.scala | 22 ++++----- .../org/ergoplatform/sdk/JsonCodecs.scala | 10 ++--- .../org/ergoplatform/sdk/ProverBuilder.scala | 2 +- .../org/ergoplatform/sdk/SigmaProver.scala | 2 +- .../sdk/UnsignedTransactionBuilder.scala | 6 +-- .../org/ergoplatform/sdk/utils/Zero.scala | 6 +-- .../context/BlockchainStateContext.scala | 6 +-- .../sdk/ContractTemplateSpecification.scala | 2 +- .../sdk/DataJsonEncoderSpecification.scala | 2 +- .../org/ergoplatform/sdk/ExtensionsSpec.scala | 4 +- .../sdk/JsonSerializationSpec.scala | 6 +-- .../sdk/multisig/SigningSpec.scala | 2 +- 135 files changed, 359 insertions(+), 368 deletions(-) rename common/shared/src/main/scala-2.11/{sigmastate => sigma}/kiama/util/Collections.scala (97%) rename common/shared/src/main/scala-2.12/{sigmastate => sigma}/kiama/util/Collections.scala (97%) rename common/shared/src/main/scala/{special => sigma}/CoreLibReflection.scala (90%) rename common/shared/src/main/scala/{special => }/sigma/SigmaDsl.scala (99%) rename common/shared/src/main/scala/{special => sigma}/Types.scala (96%) rename common/shared/src/main/scala/{special => sigma}/collection/CollType.scala (96%) rename common/shared/src/main/scala/{special => sigma}/collection/Colls.scala (99%) rename common/shared/src/main/scala/{special => sigma}/collection/CollsOverArrays.scala (99%) rename common/shared/src/main/scala/{special => sigma}/collection/Extensions.scala (98%) rename common/shared/src/main/scala/{special => sigma}/collection/package.scala (97%) rename common/shared/src/main/scala/{special => }/sigma/package.scala (98%) rename common/shared/src/test/scala/{special => sigma}/TypesTests.scala (77%) rename common/shared/src/test/scala/{special => sigma}/collections/CollGens.scala (98%) rename common/shared/src/test/scala/{special => sigma}/collections/CollsTests.scala (97%) rename {common => sc}/shared/src/main/scala/special/wrappers/WrappersSpec.scala (100%) diff --git a/common/shared/src/main/scala-2.11/sigmastate/kiama/util/Collections.scala b/common/shared/src/main/scala-2.11/sigma/kiama/util/Collections.scala similarity index 97% rename from common/shared/src/main/scala-2.11/sigmastate/kiama/util/Collections.scala rename to common/shared/src/main/scala-2.11/sigma/kiama/util/Collections.scala index 347a996452..476ea45dbd 100644 --- a/common/shared/src/main/scala-2.11/sigmastate/kiama/util/Collections.scala +++ b/common/shared/src/main/scala-2.11/sigma/kiama/util/Collections.scala @@ -8,7 +8,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package sigmastate.kiama +package sigma.kiama package util object Collections { diff --git a/common/shared/src/main/scala-2.12/sigmastate/kiama/util/Collections.scala b/common/shared/src/main/scala-2.12/sigma/kiama/util/Collections.scala similarity index 97% rename from common/shared/src/main/scala-2.12/sigmastate/kiama/util/Collections.scala rename to common/shared/src/main/scala-2.12/sigma/kiama/util/Collections.scala index 347a996452..476ea45dbd 100644 --- a/common/shared/src/main/scala-2.12/sigmastate/kiama/util/Collections.scala +++ b/common/shared/src/main/scala-2.12/sigma/kiama/util/Collections.scala @@ -8,7 +8,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package sigmastate.kiama +package sigma.kiama package util object Collections { diff --git a/common/shared/src/main/scala/special/CoreLibReflection.scala b/common/shared/src/main/scala/sigma/CoreLibReflection.scala similarity index 90% rename from common/shared/src/main/scala/special/CoreLibReflection.scala rename to common/shared/src/main/scala/sigma/CoreLibReflection.scala index 53c8d34ddf..66f179ae57 100644 --- a/common/shared/src/main/scala/special/CoreLibReflection.scala +++ b/common/shared/src/main/scala/sigma/CoreLibReflection.scala @@ -1,11 +1,10 @@ -package special +package sigma import scalan.RType import scalan.reflection.CommonReflection.registerClassEntry import scalan.reflection._ -import special.collection.{CollBuilder, Coll} -import special.sigma._ -import special.wrappers.{OptionWrapSpec, RTypeWrapSpec} +import sigma._ +import sigma.collection._ /** Registrations of reflection metadata for core-lib module. * For each class of this module that needs reflection metadata, @@ -34,7 +33,7 @@ object CoreLibReflection { ) } - { val clazz = classOf[special.sigma.BigInt] + { val clazz = classOf[sigma.BigInt] val paramTypes = Array[Class[_]](clazz) registerClassEntry(clazz, methods = Map( @@ -83,32 +82,6 @@ object CoreLibReflection { ) } - { val clazz = classOf[OptionWrapSpec] - registerClassEntry(clazz, - methods = Map( - mkMethod(clazz, "getOrElse", Array[Class[_]](classOf[Option[_]], classOf[Function0[_]])) { (obj, args) => - val opt = args(0).asInstanceOf[Option[Any]] - val defaultFunc = args(1).asInstanceOf[Function0[Any]] - obj.asInstanceOf[OptionWrapSpec].getOrElse(opt, defaultFunc()) - }, - mkMethod(clazz, "isDefined", Array[Class[_]](classOf[Option[_]])) { (obj, args) => - obj.asInstanceOf[OptionWrapSpec].isDefined(args(0).asInstanceOf[Option[_]]) - }, - mkMethod(clazz, "filter", Array[Class[_]](classOf[Option[_]], classOf[Function1[_,_]])) { (obj, args) => - obj.asInstanceOf[OptionWrapSpec].filter( - args(0).asInstanceOf[Option[Any]], args(1).asInstanceOf[Any => Boolean]) - }, - mkMethod(clazz, "map", Array[Class[_]](classOf[Option[_]], classOf[Function1[_,_]])) { (obj, args) => - obj.asInstanceOf[OptionWrapSpec].map( - args(0).asInstanceOf[Option[Any]], args(1).asInstanceOf[Any => Any]) - }, - mkMethod(clazz, "get", Array[Class[_]](classOf[Option[_]])) { (obj, args) => - obj.asInstanceOf[OptionWrapSpec].get(args(0).asInstanceOf[Option[_]]) - } - ) - ) - } - { val clazz = classOf[Coll[_]] registerClassEntry(clazz, methods = Map( @@ -431,13 +404,4 @@ object CoreLibReflection { ) } - { val clazz = classOf[RTypeWrapSpec] - registerClassEntry(clazz, - methods = Map( - mkMethod(clazz, "name", Array[Class[_]](classOf[RType[_]])) { (obj, args) => - obj.asInstanceOf[RTypeWrapSpec].name(args(0).asInstanceOf[RType[_]]) - } - ) - ) - } } diff --git a/common/shared/src/main/scala/special/sigma/SigmaDsl.scala b/common/shared/src/main/scala/sigma/SigmaDsl.scala similarity index 99% rename from common/shared/src/main/scala/special/sigma/SigmaDsl.scala rename to common/shared/src/main/scala/sigma/SigmaDsl.scala index 325aaa444a..7bcaa20fd7 100644 --- a/common/shared/src/main/scala/special/sigma/SigmaDsl.scala +++ b/common/shared/src/main/scala/sigma/SigmaDsl.scala @@ -1,8 +1,8 @@ -package special.sigma +package sigma import java.math.BigInteger -import special.collection._ +import sigma.collection._ import scalan._ import scorex.crypto.authds.{ADDigest, ADValue} import scorex.crypto.authds.avltree.batch.Operation @@ -694,7 +694,7 @@ trait Context { * @tparam T expected type of the variable. * @return Some(value) if the variable is defined in the context AND has the given type. * None otherwise - * @throws special.sigma.InvalidType exception when the type of the variable value is + * @throws `sigmastate.eval.InvalidType` exception when the type of the variable value is * different from cT. */ def getVar[T](id: Byte)(implicit cT: RType[T]): Option[T] diff --git a/common/shared/src/main/scala/special/Types.scala b/common/shared/src/main/scala/sigma/Types.scala similarity index 96% rename from common/shared/src/main/scala/special/Types.scala rename to common/shared/src/main/scala/sigma/Types.scala index 5b37d57d4e..0ce8785989 100644 --- a/common/shared/src/main/scala/special/Types.scala +++ b/common/shared/src/main/scala/sigma/Types.scala @@ -1,10 +1,11 @@ -package special +package sigma -import scalan.util.CollectionUtil import scalan.RType -import scala.reflect.ClassTag -import special.collection.Coll import scalan.RType.SomeType +import scalan.util.CollectionUtil +import sigma.collection.Coll + +import scala.reflect.ClassTag object Types { /** Generic representation of tuples values. */ diff --git a/common/shared/src/main/scala/special/collection/CollType.scala b/common/shared/src/main/scala/sigma/collection/CollType.scala similarity index 96% rename from common/shared/src/main/scala/special/collection/CollType.scala rename to common/shared/src/main/scala/sigma/collection/CollType.scala index 1061742705..81a8b2fb16 100644 --- a/common/shared/src/main/scala/special/collection/CollType.scala +++ b/common/shared/src/main/scala/sigma/collection/CollType.scala @@ -1,4 +1,4 @@ -package special.collection +package sigma.collection import scalan.RType diff --git a/common/shared/src/main/scala/special/collection/Colls.scala b/common/shared/src/main/scala/sigma/collection/Colls.scala similarity index 99% rename from common/shared/src/main/scala/special/collection/Colls.scala rename to common/shared/src/main/scala/sigma/collection/Colls.scala index 027297de18..c1c00ed67a 100644 --- a/common/shared/src/main/scala/special/collection/Colls.scala +++ b/common/shared/src/main/scala/sigma/collection/Colls.scala @@ -1,4 +1,4 @@ -package special.collection +package sigma.collection import scalan._ diff --git a/common/shared/src/main/scala/special/collection/CollsOverArrays.scala b/common/shared/src/main/scala/sigma/collection/CollsOverArrays.scala similarity index 99% rename from common/shared/src/main/scala/special/collection/CollsOverArrays.scala rename to common/shared/src/main/scala/sigma/collection/CollsOverArrays.scala index fc6f0e3767..1593bac573 100644 --- a/common/shared/src/main/scala/special/collection/CollsOverArrays.scala +++ b/common/shared/src/main/scala/sigma/collection/CollsOverArrays.scala @@ -1,4 +1,4 @@ -package special.collection +package sigma.collection import java.util import scalan._ // required diff --git a/common/shared/src/main/scala/special/collection/Extensions.scala b/common/shared/src/main/scala/sigma/collection/Extensions.scala similarity index 98% rename from common/shared/src/main/scala/special/collection/Extensions.scala rename to common/shared/src/main/scala/sigma/collection/Extensions.scala index 4256d91336..e08adca1b6 100644 --- a/common/shared/src/main/scala/special/collection/Extensions.scala +++ b/common/shared/src/main/scala/sigma/collection/Extensions.scala @@ -1,4 +1,4 @@ -package special.collection +package sigma.collection import debox.cfor import scorex.util.encode.Base16 diff --git a/common/shared/src/main/scala/special/collection/package.scala b/common/shared/src/main/scala/sigma/collection/package.scala similarity index 97% rename from common/shared/src/main/scala/special/collection/package.scala rename to common/shared/src/main/scala/sigma/collection/package.scala index a683abd7a0..1e89a7fbf5 100644 --- a/common/shared/src/main/scala/special/collection/package.scala +++ b/common/shared/src/main/scala/sigma/collection/package.scala @@ -1,4 +1,4 @@ -package special +package sigma import scalan.RType diff --git a/common/shared/src/main/scala/special/sigma/package.scala b/common/shared/src/main/scala/sigma/package.scala similarity index 98% rename from common/shared/src/main/scala/special/sigma/package.scala rename to common/shared/src/main/scala/sigma/package.scala index a81b27a45b..4eaee24aff 100644 --- a/common/shared/src/main/scala/special/sigma/package.scala +++ b/common/shared/src/main/scala/sigma/package.scala @@ -1,4 +1,3 @@ -package special import java.math.BigInteger import scalan.RType diff --git a/common/shared/src/test/scala/special/TypesTests.scala b/common/shared/src/test/scala/sigma/TypesTests.scala similarity index 77% rename from common/shared/src/test/scala/special/TypesTests.scala rename to common/shared/src/test/scala/sigma/TypesTests.scala index b0c6ce5808..3601db8659 100644 --- a/common/shared/src/test/scala/special/TypesTests.scala +++ b/common/shared/src/test/scala/sigma/TypesTests.scala @@ -1,8 +1,8 @@ -package special +package sigma +import scalan.RType._ import scalan.{BaseTests, RType} -import RType._ -import Types._ +import sigma.Types._ class TypesTests extends BaseTests { @@ -10,7 +10,7 @@ class TypesTests extends BaseTests { def test[A](t: RType[A], n: String) = { t.name shouldBe n } - test(tupleRType(Array(IntType, LongType, RType[(Byte, special.sigma.BigInt)], RType[Option[Boolean]])), + test(tupleRType(Array(IntType, LongType, RType[(Byte, sigma.BigInt)], RType[Option[Boolean]])), "(Int, Long, (Byte, BigInt), Option[Boolean])") } diff --git a/common/shared/src/test/scala/special/collections/CollGens.scala b/common/shared/src/test/scala/sigma/collections/CollGens.scala similarity index 98% rename from common/shared/src/test/scala/special/collections/CollGens.scala rename to common/shared/src/test/scala/sigma/collections/CollGens.scala index 858ce9f3f4..c8fdb3094f 100644 --- a/common/shared/src/test/scala/special/collections/CollGens.scala +++ b/common/shared/src/test/scala/sigma/collections/CollGens.scala @@ -1,10 +1,10 @@ -package special.collections +package sigma.collections import org.scalacheck.util.Buildable import org.scalacheck.{Arbitrary, Gen} import scalan._ import scalan.RType -import special.collection.{Coll, CollBuilder, CollOverArrayBuilder, PairColl} +import sigma.collection.{Coll, CollBuilder, CollOverArrayBuilder, PairColl} import spire.scalacompat.BuilderCompat import scala.collection.mutable import scala.collection.mutable.ArrayBuffer diff --git a/common/shared/src/test/scala/special/collections/CollsTests.scala b/common/shared/src/test/scala/sigma/collections/CollsTests.scala similarity index 97% rename from common/shared/src/test/scala/special/collections/CollsTests.scala rename to common/shared/src/test/scala/sigma/collections/CollsTests.scala index 2c7484193b..a4d2fb3af4 100644 --- a/common/shared/src/test/scala/special/collections/CollsTests.scala +++ b/common/shared/src/test/scala/sigma/collections/CollsTests.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import org.scalacheck.Gen import org.scalatest.exceptions.TestFailedException @@ -7,13 +7,13 @@ import org.scalatest.propspec.AnyPropSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scalan._ import sigma.{VersionContext, VersionTestingProperty} -import special.collection.{Coll, CollOverArray, PairOfCols} +import sigma.collection.{Coll, CollOverArray, PairOfCols} import scala.language.{existentials} class CollsTests extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers with CollGens with VersionTestingProperty { testSuite => import Gen._ - import special.collection.Extensions._ + import sigma.collection.Extensions._ def squared[A](f: A => A): ((A, A)) => (A, A) = (p: (A, A)) => (f(p._1), f(p._2)) @@ -491,8 +491,8 @@ class CollsTests extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers /* TODO: simplify the above code * match-case removal gives the following compilation error: type mismatch; - found : special.collection.PairColl[_$1(in value res),_$2(in value res)] where type _$2(in value res), type _$1(in value res) - required: special.collection.Coll[(_$1(in method getSuperGen), _$2(in method getSuperGen))] + found : sigma.collection.PairColl[_$1(in value res),_$2(in value res)] where type _$2(in value res), type _$1(in value res) + required: sigma.collection.Coll[(_$1(in method getSuperGen), _$2(in method getSuperGen))] val res = col1.unionSet(col1) */ } @@ -511,8 +511,8 @@ class CollsTests extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers /* TODO: simplify the above code * match-case removal gives the following compilation error: type mismatch; - found : special.collection.PairColl[_$1(in value res),_$2(in value res)] where type _$2(in value res), type _$1(in value res) - required: special.collection.Coll[(_$1(in method getSuperGen), _$2(in method getSuperGen))] + found : sigma.collection.PairColl[_$1(in value res),_$2(in value res)] where type _$2(in value res), type _$1(in value res) + required: sigma.collection.Coll[(_$1(in method getSuperGen), _$2(in method getSuperGen))] val res = col.diff(col) */ builder.replicate(2, 10).diff(builder.replicate(1, 10)).toArray shouldBe Array(10) diff --git a/interpreter/js/src/main/scala/sigmastate/Platform.scala b/interpreter/js/src/main/scala/sigmastate/Platform.scala index de3f0a3b7f..4defdc896b 100644 --- a/interpreter/js/src/main/scala/sigmastate/Platform.scala +++ b/interpreter/js/src/main/scala/sigmastate/Platform.scala @@ -6,8 +6,8 @@ import sigma.VersionContext import sigmastate.Values.{Constant, FalseLeaf, SigmaBoolean, TrueLeaf} import sigmastate.eval.{Evaluation, SigmaDsl} import sigmastate.lang.SigmaBuilder -import special.collection.Coll -import special.sigma.{AnyValue, AvlTree, GroupElement, SigmaProp} +import sigma.collection.Coll +import sigma.{AnyValue, AvlTree, GroupElement, SigmaProp} import java.math.BigInteger @@ -32,7 +32,7 @@ object Platform { 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 n: special.sigma.BigInt => Nullable(mkConstant[SBigInt.type](n, 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) case v: String => Nullable(mkConstant[SString.type](v, SString)) @@ -47,7 +47,7 @@ object Platform { // 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. - case b: special.sigma.Box => + case b: sigma.Box => if (VersionContext.current.isJitActivated) Nullable(mkConstant[SBox.type](b, SBox)) else diff --git a/interpreter/js/src/main/scala/sigmastate/crypto/Platform.scala b/interpreter/js/src/main/scala/sigmastate/crypto/Platform.scala index ba5460e517..61d4ed9cfb 100644 --- a/interpreter/js/src/main/scala/sigmastate/crypto/Platform.scala +++ b/interpreter/js/src/main/scala/sigmastate/crypto/Platform.scala @@ -3,8 +3,8 @@ package sigmastate.crypto import scalan.RType import scorex.util.encode.Base16 import sigmastate._ -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import java.math.BigInteger import scala.scalajs.js diff --git a/interpreter/jvm/src/main/scala/sigmastate/Platform.scala b/interpreter/jvm/src/main/scala/sigmastate/Platform.scala index b29941b6d4..e4b1e86ad1 100644 --- a/interpreter/jvm/src/main/scala/sigmastate/Platform.scala +++ b/interpreter/jvm/src/main/scala/sigmastate/Platform.scala @@ -6,8 +6,8 @@ import sigma.VersionContext import sigmastate.Values.{Constant, FalseLeaf, SigmaBoolean, TrueLeaf} import sigmastate.eval.{Evaluation, SigmaDsl} import sigmastate.lang.SigmaBuilder -import special.collection.Coll -import special.sigma.{AvlTree, GroupElement, SigmaProp} +import sigma.collection.Coll +import sigma.{AvlTree, GroupElement, SigmaProp} import java.math.BigInteger @@ -32,7 +32,7 @@ object Platform { 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 n: special.sigma.BigInt => Nullable(mkConstant[SBigInt.type](n, 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) case v: String => Nullable(mkConstant[SString.type](v, SString)) @@ -47,7 +47,7 @@ object Platform { // 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. - case b: special.sigma.Box => + case b: sigma.Box => if (VersionContext.current.isJitActivated) Nullable(mkConstant[SBox.type](b, SBox)) else diff --git a/interpreter/jvm/src/main/scala/sigmastate/crypto/Platform.scala b/interpreter/jvm/src/main/scala/sigmastate/crypto/Platform.scala index 3b74ba4714..c79cf8c59c 100644 --- a/interpreter/jvm/src/main/scala/sigmastate/crypto/Platform.scala +++ b/interpreter/jvm/src/main/scala/sigmastate/crypto/Platform.scala @@ -10,8 +10,8 @@ import scalan.RType import java.math.BigInteger import sigmastate._ import sigmastate.basics.BcDlogGroup -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import java.text.Normalizer.Form.NFKD import java.text.Normalizer diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoAddress.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoAddress.scala index 6d6371494b..a821b4ef9b 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoAddress.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoAddress.scala @@ -10,7 +10,7 @@ import sigmastate.basics.DLogProtocol.{ProveDlogProp, ProveDlog} import sigmastate.exceptions.SigmaException import sigmastate.serialization._ import sigmastate.utxo.{DeserializeContext, Slice} -import special.collection.Coll +import sigma.collection.Coll import scala.util.Try diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBox.scala index 9d373fb36a..b5ad85458c 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 special.collection._ +import sigma.collection._ /** * 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 7948823cda..e08d540187 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoBoxCandidate.scala @@ -9,13 +9,13 @@ import sigmastate._ import sigmastate.SType.AnyOps import sigmastate.serialization.{SigmaSerializer, ValueSerializer} import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import special.collection.Coll +import sigma.collection.Coll import sigmastate.eval._ import sigmastate.eval.Extensions._ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigma.util.safeNewArray import debox.cfor -import special.collection.Extensions.CollOps +import sigma.collection.Extensions.CollOps import scala.collection.{immutable, mutable} import scala.runtime.ScalaRunTime diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeContext.scala b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeContext.scala index 3b356fd4ec..5ae468be8f 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeContext.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/ErgoLikeContext.scala @@ -11,9 +11,8 @@ import sigmastate.interpreter.{ContextExtension, ErgoTreeEvaluator, Interpreter, import sigmastate.exceptions.InterpreterException import sigmastate.serialization.OpCodes import sigmastate.serialization.OpCodes.OpCode -import special.collection.Coll -import special.sigma -import special.sigma.{AnyValue, Header, PreHeader} +import sigma.collection.Coll +import sigma.{AnyValue, Header, PreHeader} import debox.cfor /** Represents a script evaluation context to be passed to a prover and a verifier to execute and @@ -112,7 +111,7 @@ class ErgoLikeContext(val lastBlockUtxoRoot: AvlTreeData, /** Current version of the ErgoTree executed by the interpreter. * This property is used to implement version dependent operations and passed to - * interpreter via [[special.sigma.Context]]. + * interpreter via [[sigma.Context]]. * The value cannot be assigned on [[ErgoLikeContext]] construction and must be * attached using [[withErgoTreeVersion()]] method. * When the value is None, the [[InterpreterException]] is thrown by the interpreter. @@ -327,7 +326,7 @@ case object Self extends NotReadyValueBox with FixedCostValueCompanion { } } -/** When interpreted evaluates to the singleton instance of [[special.sigma.Context]]. +/** When interpreted evaluates to the singleton instance of [[sigma.Context]]. * Corresponds to `CONTEXT` variable in ErgoScript which can be used like `CONTEXT.headers`. */ case object Context extends NotReadyValue[SContext.type] with ValueCompanion { @@ -345,7 +344,7 @@ case object Context extends NotReadyValue[SContext.type] with ValueCompanion { } } -/** When interpreted evaluates to the singleton instance of [[special.sigma.SigmaDslBuilder]]. +/** When interpreted evaluates to the singleton instance of [[sigma.SigmaDslBuilder]]. * Corresponds to `Global` variable in ErgoScript which can be used like `Global.groupGenerator`. */ case object Global extends NotReadyValue[SGlobal.type] with FixedCostValueCompanion { diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/dsl/AvlTreeHelpers.scala b/interpreter/shared/src/main/scala/org/ergoplatform/dsl/AvlTreeHelpers.scala index 31eadc836c..b649c8e381 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/dsl/AvlTreeHelpers.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/dsl/AvlTreeHelpers.scala @@ -1,11 +1,11 @@ package org.ergoplatform.dsl -import special.collection.Coll +import sigma.collection.Coll import sigmastate.eval.{CAvlTree, CostingSigmaDslBuilder} import scorex.crypto.authds.{ADKey, ADValue} import scorex.crypto.hash.{Digest32, Blake2b256} import sigmastate.{AvlTreeData, AvlTreeFlags} -import special.sigma.AvlTree +import sigma.AvlTree import scorex.crypto.authds.avltree.batch.{BatchAVLProver, Insert} import CostingSigmaDslBuilder.Colls diff --git a/interpreter/shared/src/main/scala/org/ergoplatform/settings/ErgoAlgos.scala b/interpreter/shared/src/main/scala/org/ergoplatform/settings/ErgoAlgos.scala index 624e713654..25505d8602 100644 --- a/interpreter/shared/src/main/scala/org/ergoplatform/settings/ErgoAlgos.scala +++ b/interpreter/shared/src/main/scala/org/ergoplatform/settings/ErgoAlgos.scala @@ -2,7 +2,7 @@ package org.ergoplatform.settings import scorex.crypto.hash.Blake2b256 import scorex.util._ -import special.collection.Coll +import sigma.collection.Coll 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 6533aa857c..64e3ceba2d 100644 --- a/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala +++ b/interpreter/shared/src/main/scala/sigmastate/AvlTreeData.scala @@ -4,7 +4,7 @@ import sigmastate.basics.CryptoConstants import sigmastate.eval.Colls import sigmastate.serialization.SigmaSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import special.collection.Coll +import sigma.collection.Coll case class AvlTreeFlags(insertAllowed: Boolean, updateAllowed: Boolean, removeAllowed: Boolean) { diff --git a/interpreter/shared/src/main/scala/sigmastate/DataValueComparer.scala b/interpreter/shared/src/main/scala/sigmastate/DataValueComparer.scala index eab9c461b8..75b604f5a0 100644 --- a/interpreter/shared/src/main/scala/sigmastate/DataValueComparer.scala +++ b/interpreter/shared/src/main/scala/sigmastate/DataValueComparer.scala @@ -9,8 +9,8 @@ import sigmastate.basics.ProveDHTuple import sigmastate.eval.SigmaDsl import sigmastate.basics.CryptoConstants.EcPointType import sigmastate.interpreter.{ErgoTreeEvaluator, NamedDesc, OperationCostInfo} -import special.sigma.{AvlTree, AvlTreeRType, BigInt, BigIntRType, Box, BoxRType, GroupElement, GroupElementRType, Header, HeaderRType, PreHeader, PreHeaderRType, SigmaProp} -import special.collection.{Coll, CollOverArray, PairOfCols} +import sigma.{AvlTree, AvlTreeRType, BigInt, BigIntRType, Box, BoxRType, GroupElement, GroupElementRType, Header, HeaderRType, PreHeader, PreHeaderRType, SigmaProp} +import sigma.collection.{Coll, CollOverArray, PairOfCols} /** Implementation of data equality for two arbitrary ErgoTree data types. * @see [[DataValueComparer.equalDataValues]] diff --git a/interpreter/shared/src/main/scala/sigmastate/InterpreterReflection.scala b/interpreter/shared/src/main/scala/sigmastate/InterpreterReflection.scala index cce29d51da..6e05af97ab 100644 --- a/interpreter/shared/src/main/scala/sigmastate/InterpreterReflection.scala +++ b/interpreter/shared/src/main/scala/sigmastate/InterpreterReflection.scala @@ -2,20 +2,18 @@ package sigmastate import org.ergoplatform.ErgoBox.RegisterId import scalan.reflection.CommonReflection.registerClassEntry -import scalan.reflection.{SRConstructor, mkConstructor, mkMethod, SRMethod} +import scalan.reflection.{mkConstructor, mkMethod} +import sigma.collection.Coll +import sigma.{AvlTree, CoreLibReflection, SigmaDslBuilder} import sigmastate.SAvlTree.KeyValueColl -import sigmastate.SCollection.{SIntArray, SByteArray, SBooleanArray} +import sigmastate.SCollection.{SBooleanArray, SByteArray, SIntArray} import sigmastate.Values._ import sigmastate.basics.VerifierMessage.Challenge import sigmastate.crypto.GF2_192_Poly import sigmastate.interpreter.ErgoTreeEvaluator import sigmastate.lang.Terms._ -import sigmastate.lang.{CheckingSigmaBuilder, Terms} import sigmastate.serialization.OpCodes.OpCode import sigmastate.utxo._ -import special.CoreLibReflection -import special.collection.Coll -import special.sigma.{SigmaDslBuilder, AvlTree} /** Reflection metadata for `interpreter` module. * For each class of this module that needs reflection metadata, diff --git a/interpreter/shared/src/main/scala/sigmastate/Values.scala b/interpreter/shared/src/main/scala/sigmastate/Values.scala index d93b5add75..2eb5a4ecad 100644 --- a/interpreter/shared/src/main/scala/sigmastate/Values.scala +++ b/interpreter/shared/src/main/scala/sigmastate/Values.scala @@ -32,10 +32,10 @@ import sigmastate.lang.CheckingSigmaBuilder._ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.serialization.transformers.ProveDHTupleSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import special.sigma.{AvlTree, Header, PreHeader, _} +import sigma.{AvlTree, Header, PreHeader, _} import sigmastate.lang.SourceContext import sigma.util.safeNewArray -import special.collection.Coll +import sigma.collection.Coll import scala.collection.compat.immutable.ArraySeq import scala.collection.mutable diff --git a/interpreter/shared/src/main/scala/sigmastate/basics/DLogProtocol.scala b/interpreter/shared/src/main/scala/sigmastate/basics/DLogProtocol.scala index 9b801d7ad1..96bfb0dd9d 100644 --- a/interpreter/shared/src/main/scala/sigmastate/basics/DLogProtocol.scala +++ b/interpreter/shared/src/main/scala/sigmastate/basics/DLogProtocol.scala @@ -12,7 +12,7 @@ import sigmastate.basics.VerifierMessage.Challenge import CryptoConstants.{EcPointType, dlogGroup} import sigmastate.serialization.{OpCodes, GroupElementSerializer} import sigmastate.serialization.OpCodes.OpCode -import special.sigma.SigmaProp +import sigma.SigmaProp object DLogProtocol { diff --git a/interpreter/shared/src/main/scala/sigmastate/basics/DiffieHellmanTupleProtocol.scala b/interpreter/shared/src/main/scala/sigmastate/basics/DiffieHellmanTupleProtocol.scala index e39508bf4f..762772c528 100644 --- a/interpreter/shared/src/main/scala/sigmastate/basics/DiffieHellmanTupleProtocol.scala +++ b/interpreter/shared/src/main/scala/sigmastate/basics/DiffieHellmanTupleProtocol.scala @@ -10,7 +10,7 @@ import sigmastate.eval.SigmaDsl import CryptoConstants.EcPointType import sigmastate.serialization.{OpCodes, GroupElementSerializer} import sigmastate.serialization.OpCodes.OpCode -import special.sigma.SigmaProp +import sigma.SigmaProp trait DiffieHellmanTupleProtocol extends SigmaProtocol[DiffieHellmanTupleProtocol] { diff --git a/interpreter/shared/src/main/scala/sigmastate/basics/SigmaProtocolFunctions.scala b/interpreter/shared/src/main/scala/sigmastate/basics/SigmaProtocolFunctions.scala index 2350c3f1d2..9c9d15b0d2 100644 --- a/interpreter/shared/src/main/scala/sigmastate/basics/SigmaProtocolFunctions.scala +++ b/interpreter/shared/src/main/scala/sigmastate/basics/SigmaProtocolFunctions.scala @@ -2,9 +2,8 @@ package sigmastate.basics import sigmastate.SigmaLeaf import sigmastate.basics.CryptoConstants.dlogGroup -import sigmastate.basics.DLogProtocol.{DLogProverInput, ProveDlog} import sigmastate.basics.VerifierMessage.Challenge -import special.collection.Coll +import sigma.collection.Coll import supertagged.TaggedType import java.math.BigInteger diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/BigIntegerOps.scala b/interpreter/shared/src/main/scala/sigmastate/eval/BigIntegerOps.scala index 90ce2bd63b..a3e44b8ebe 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/BigIntegerOps.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/BigIntegerOps.scala @@ -5,7 +5,7 @@ import java.math.BigInteger import scalan.{ExactOrderingImpl, ExactIntegral} import scala.math.{Integral, Ordering} -import special.sigma._ +import sigma._ import sigmastate.eval.Extensions._ object OrderingOps { @@ -60,7 +60,7 @@ object NumericOps { /** The instance of Integral for BigInt. * - * Note: ExactIntegral was not defined for [[special.sigma.BigInt]] in v4.x. + * Note: ExactIntegral was not defined for [[sigma.BigInt]] in v4.x. * This is because arithmetic BigInt operations were handled in a special way * (see `case op: ArithOp[t] if op.tpe == SBigInt =>` in RuntimeCosting.scala). * As result [[scalan.primitives.UnBinOps.ApplyBinOp]] nodes were not created for diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala b/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala index a79995313a..262808700c 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/CostingDataContext.scala @@ -23,8 +23,8 @@ import sigmastate.eval.Extensions._ import sigmastate.interpreter.Interpreter import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.serialization.{GroupElementSerializer, SigmaSerializer} -import special.collection._ -import special.sigma._ +import sigma.collection._ +import sigma._ import java.math.BigInteger import java.util.Arrays @@ -150,7 +150,7 @@ case class CSigmaProp(sigmaTree: SigmaBoolean) extends SigmaProp with WrapperOf[ override def toString: String = s"SigmaProp(${wrappedValue.showToString})" } -/** Implementation of the [[special.sigma.AvlTreeVerifier]] trait based on +/** Implementation of the [[sigma.AvlTreeVerifier]] trait based on * [[scorex.crypto.authds.avltree.batch.BatchAVLVerifier]]. * * @see BatchAVLVerifier, AvlTreeVerifier @@ -534,7 +534,7 @@ class CostingSigmaDslBuilder extends SigmaDslBuilder { dsl => /** Wraps the given [[ErgoBox]] into SigmaDsl value of type [[Box]]. * @param ebox the value to be wrapped - * @see [[sigmastate.SBox]], [[special.sigma.Box]] + * @see [[sigmastate.SBox]], [[sigma.Box]] */ def Box(ebox: ErgoBox): Box = CostingBox(ebox) diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/Evaluation.scala b/interpreter/shared/src/main/scala/sigmastate/eval/Evaluation.scala index fa8b50a6c9..ae10009145 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/Evaluation.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/Evaluation.scala @@ -6,7 +6,7 @@ import scalan.RType._ import sigmastate.SType._ import sigmastate.Values.SigmaBoolean import sigmastate._ -import special.Types._ +import sigma.Types._ import debox.cfor import sigmastate.exceptions.CostLimitException import java.math.BigInteger @@ -17,8 +17,8 @@ import scala.util.Try /** Helper methods used as part of ErgoTree evaluation. */ object Evaluation { - import special.collection._ - import special.sigma._ + import sigma.collection._ + import sigma._ def msgCostLimitError(cost: Long, limit: Long) = s"Estimated execution cost $cost exceeds the limit $limit" @@ -145,7 +145,7 @@ object Evaluation { case _: Unit => UnitType case _: BigInteger => BigIntegerRType - case _: special.sigma.BigInt => BigIntRType + case _: sigma.BigInt => BigIntRType case _: GroupElement => GroupElementRType diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala b/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala index b4efc58348..d92f48f37e 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/Extensions.scala @@ -11,8 +11,8 @@ import sigmastate.crypto.{CryptoFacade, Ecp} import sigmastate.lang.{CheckingSigmaBuilder, TransformingSigmaBuilder} import sigmastate.utils.Helpers import sigmastate.{Platform, SCollection, SCollectionType, SType} -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import java.math.BigInteger diff --git a/interpreter/shared/src/main/scala/sigmastate/eval/package.scala b/interpreter/shared/src/main/scala/sigmastate/eval/package.scala index cb4ebb9c05..995d770183 100644 --- a/interpreter/shared/src/main/scala/sigmastate/eval/package.scala +++ b/interpreter/shared/src/main/scala/sigmastate/eval/package.scala @@ -7,8 +7,8 @@ import scalan.RType import scorex.crypto.hash.Digest32 import sigmastate.Values.SigmaBoolean import sigmastate.basics.CryptoConstants.EcPointType -import special.collection.{Coll, CollBuilder} -import special.sigma._ +import sigma.collection.{Coll, CollBuilder} +import sigma._ import supertagged.TaggedType import scala.language.implicitConversions @@ -43,7 +43,7 @@ package object eval { /** Implicit conversions between Dsl type and the type wrapped by the corresponding type Dsl type. * Here BigInt is Dsl type and BigInteger is wrapped type. - * @see `special.sigma.CBigInt` + * @see `sigma.CBigInt` */ implicit def bigIntegerToBigInt(bi: BigInteger): BigInt = SigmaDsl.BigInt(bi) implicit def bigIntToBigInteger(bi: BigInt): BigInteger = SigmaDsl.toBigInteger(bi) diff --git a/interpreter/shared/src/main/scala/sigmastate/interpreter/ErgoTreeEvaluator.scala b/interpreter/shared/src/main/scala/sigmastate/interpreter/ErgoTreeEvaluator.scala index 15b9328d00..b5f1af9dd4 100644 --- a/interpreter/shared/src/main/scala/sigmastate/interpreter/ErgoTreeEvaluator.scala +++ b/interpreter/shared/src/main/scala/sigmastate/interpreter/ErgoTreeEvaluator.scala @@ -6,7 +6,7 @@ import sigmastate.Values._ import sigmastate.eval.Profiler import sigmastate.interpreter.ErgoTreeEvaluator.DataEnv import sigmastate.interpreter.Interpreter.ReductionResult -import special.sigma.{Context, SigmaProp} +import sigma.{Context, SigmaProp} import scalan.util.Extensions._ import sigmastate.interpreter.EvalSettings._ import supertagged.TaggedType @@ -103,8 +103,8 @@ case class JitEvalResult[A](value: A, cost: JitCost) * transaction. No additional transformation is performed. * ErgoTree is interpreted directly and all the intermediate data is stored in the * runtime types. - * The runtime types are such types as [[special.collection.Coll]], - * [[special.sigma.SigmaProp]], [[special.sigma.AvlTree]], [[BigInt]], etc. + * The runtime types are such types as [[sigma.collection.Coll]], + * [[sigma.SigmaProp]], [[sigma.AvlTree]], [[BigInt]], etc. * It also use immutable Map to keep current [[DataEnv]] of computed [[ValDef]]s, as * result only addition is used from the map, and deletion is essentially a garbage * collection. @@ -500,7 +500,7 @@ object ErgoTreeEvaluator { /** Evaluate the given expression in the given Ergo context using the given settings. * The given Value is evaluated as-is and is not changed during evaluation. * - * @param sigmaContext [[special.sigma.Context]] instance used for script execution + * @param sigmaContext [[sigma.Context]] instance used for script execution * @param costAccumulator [[CostAccumulator]] instance used for accumulating costs * @param constants collection of segregated constants which can be refered by * [[ConstantPlaceholder]]s in `exp` diff --git a/interpreter/shared/src/main/scala/sigmastate/interpreter/Interpreter.scala b/interpreter/shared/src/main/scala/sigmastate/interpreter/Interpreter.scala index 59d96ba91a..45db609448 100644 --- a/interpreter/shared/src/main/scala/sigmastate/interpreter/Interpreter.scala +++ b/interpreter/shared/src/main/scala/sigmastate/interpreter/Interpreter.scala @@ -171,7 +171,7 @@ trait Interpreter { val (resProp, cost) = { val ctx = context.asInstanceOf[ErgoLikeContext] ErgoTreeEvaluator.eval(ctx, ErgoTree.EmptyConstants, exp, evalSettings) match { - case (p: special.sigma.SigmaProp, c) => (p, c) + case (p: sigma.SigmaProp, c) => (p, c) case (res, _) => sys.error(s"Invalid result type of $res: expected SigmaProp when evaluating $exp") } diff --git a/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala b/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala index 937aa37fda..017af3ff9b 100644 --- a/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala +++ b/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala @@ -6,8 +6,7 @@ import sigmastate.Values.EvaluatedValue import sigmastate.interpreter.ContextExtension.VarBinding import sigmastate.serialization.SigmaSerializer import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} -import special.sigma -import special.sigma.AnyValue +import sigma.AnyValue import scala.collection.mutable @@ -109,8 +108,8 @@ trait InterpreterContext { /** Creates a new instance with given validation settings. */ def withValidationSettings(newVs: SigmaValidationSettings): InterpreterContext - /** Creates `special.sigma.Context` instance based on this context. The created instance - * contains all data represented using types form [[special.sigma]] package. + /** Creates `sigma.Context` instance based on this context. The created instance + * contains all data represented using types form [[sigma]] package. * These types are used internally by ErgoTree interpreter. * Thus, this method performs transformation from Ergo to internal Sigma representation * of all context data. diff --git a/interpreter/shared/src/main/scala/sigmastate/interpreter/ProverInterpreter.scala b/interpreter/shared/src/main/scala/sigmastate/interpreter/ProverInterpreter.scala index a0e45359f3..41f0ab37db 100644 --- a/interpreter/shared/src/main/scala/sigmastate/interpreter/ProverInterpreter.scala +++ b/interpreter/shared/src/main/scala/sigmastate/interpreter/ProverInterpreter.scala @@ -15,7 +15,7 @@ import sigmastate.crypto.{GF2_192, GF2_192_Poly} import sigmastate.eval.Extensions.ArrayOps import sigmastate.exceptions.InterpreterException import sigmastate.utils.Helpers -import special.collection.Coll +import sigma.collection.Coll import java.math.BigInteger import scala.util.Try diff --git a/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala b/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala index 7161fa0c40..e3b5d460fc 100644 --- a/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala +++ b/interpreter/shared/src/main/scala/sigmastate/lang/SigmaBuilder.scala @@ -15,8 +15,8 @@ import sigmastate.lang.Terms.{STypeSubst, _} import sigmastate.serialization.OpCodes import sigmastate.serialization.OpCodes.OpCode import sigmastate.utxo._ -import special.collection.Coll -import special.sigma.AnyValue +import sigma.collection.Coll +import sigma.AnyValue import scala.util.DynamicVariable diff --git a/interpreter/shared/src/main/scala/sigmastate/serialization/DataSerializer.scala b/interpreter/shared/src/main/scala/sigmastate/serialization/DataSerializer.scala index d659dbf81b..d53075acd5 100644 --- a/interpreter/shared/src/main/scala/sigmastate/serialization/DataSerializer.scala +++ b/interpreter/shared/src/main/scala/sigmastate/serialization/DataSerializer.scala @@ -10,8 +10,8 @@ import sigmastate.Values.SigmaBoolean import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} import sigmastate._ import sigmastate.eval.{Evaluation, _} -import special.collection._ -import special.sigma._ +import sigma.collection._ +import sigma._ import debox.cfor import sigmastate.exceptions.SerializerException import scala.collection.mutable diff --git a/interpreter/shared/src/main/scala/sigmastate/trees.scala b/interpreter/shared/src/main/scala/sigmastate/trees.scala index bbefdf78b9..91cbb8eef5 100644 --- a/interpreter/shared/src/main/scala/sigmastate/trees.scala +++ b/interpreter/shared/src/main/scala/sigmastate/trees.scala @@ -22,8 +22,8 @@ import sigmastate.interpreter.ErgoTreeEvaluator.DataEnv import sigmastate.serialization.OpCodes._ import sigmastate.serialization._ import sigmastate.utxo.{SimpleTransformerCompanion, Transformer} -import special.collection.Coll -import special.sigma.{GroupElement, SigmaProp} +import sigma.collection.Coll +import sigma.{GroupElement, SigmaProp} import scala.collection.mutable import scala.collection.mutable.ArrayBuffer @@ -1177,7 +1177,7 @@ case class Exponentiate(override val left: Value[SGroupElement.type], protected final override def eval(env: DataEnv)(implicit E: ErgoTreeEvaluator): Any = { val leftV = left.evalTo[GroupElement](env) - val rightV = right.evalTo[special.sigma.BigInt](env) + val rightV = right.evalTo[sigma.BigInt](env) addCost(Exponentiate.costKind) leftV.exp(rightV) } diff --git a/interpreter/shared/src/main/scala/sigmastate/types.scala b/interpreter/shared/src/main/scala/sigmastate/types.scala index e4fd826304..63b9e75fe9 100644 --- a/interpreter/shared/src/main/scala/sigmastate/types.scala +++ b/interpreter/shared/src/main/scala/sigmastate/types.scala @@ -19,8 +19,8 @@ import sigmastate.lang.{SigmaBuilder, Terms} import sigmastate.SCollection._ import sigmastate.basics.CryptoConstants.{hashLength, EcPointType} import sigmastate.serialization.OpCodes -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import scala.language.implicitConversions import scala.reflect.{classTag, ClassTag} @@ -2563,7 +2563,7 @@ case object SPreHeader extends SProduct with SPredefType with SMonoType { /** This type is introduced to unify handling of global and non-global (i.e. methods) operations. * It unifies implementation of global operation with implementation of methods and avoids code * duplication (following DRY principle https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). - * The WrappedType is `special.sigma.SigmaDslBuilder`, which is an interface implemented by + * The WrappedType is `sigma.SigmaDslBuilder`, which is an interface implemented by * the singleton sigmastate.eval.CostingSigmaDslBuilder * * The Constant(...) tree node of this type are not allowed, as well as using it in register and diff --git a/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala b/interpreter/shared/src/main/scala/sigmastate/utils/Extensions.scala index 5cdb9f70fc..1235893611 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 special.collection.Coll +import sigma.collection.Coll object Extensions { implicit class ByteOpsForSigma(val b: Byte) extends AnyVal { diff --git a/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala b/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala index 0f9d4aae16..4eb870b412 100644 --- a/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala +++ b/interpreter/shared/src/main/scala/sigmastate/utils/Helpers.scala @@ -8,8 +8,8 @@ import scorex.utils.Ints import sigma.Environment import sigmastate.eval.{CAnyValue, Colls, SigmaDsl} import sigmastate.basics.CryptoConstants.EcPointType -import special.collection.Coll -import special.sigma.GroupElement +import sigma.collection.Coll +import sigma.GroupElement import java.util import java.util.concurrent.locks.Lock diff --git a/interpreter/shared/src/main/scala/sigmastate/utxo/transformers.scala b/interpreter/shared/src/main/scala/sigmastate/utxo/transformers.scala index 2fc36c753c..8cd0abe075 100644 --- a/interpreter/shared/src/main/scala/sigmastate/utxo/transformers.scala +++ b/interpreter/shared/src/main/scala/sigmastate/utxo/transformers.scala @@ -13,8 +13,8 @@ import sigmastate.eval.{Evaluation, SigmaDsl} import sigmastate.exceptions.InterpreterException import sigmastate.interpreter.ErgoTreeEvaluator import sigmastate.interpreter.ErgoTreeEvaluator.{DataEnv, error} -import special.collection.Coll -import special.sigma.{Box, SigmaProp} +import sigma.collection.Coll +import sigma.{Box, SigmaProp} // TODO refactor: remove this trait as it doesn't have semantic meaning @@ -390,7 +390,7 @@ case class ExtractAmount(input: Value[SBox.type]) extends Extract[SLong.type] wi object ExtractAmount extends SimpleTransformerCompanion with FixedCostValueCompanion { val OpType = SFunc(SBox, SLong) override def opCode: OpCode = OpCodes.ExtractAmountCode - /** Cost of: 1) access `value` property of a [[special.sigma.Box]] */ + /** Cost of: 1) access `value` property of a [[sigma.Box]] */ override val costKind = FixedCost(JitCost(8)) override def argInfos: Seq[ArgInfo] = ExtractAmountInfo.argInfos } @@ -563,7 +563,7 @@ object DeserializeRegister extends ValueCompanion { baseCost = JitCost(1), perChunkCost = JitCost(10), chunkSize = 128) } -/** See [[special.sigma.Context.getVar()]] for detailed description. */ +/** See [[sigma.Context.getVar()]] for detailed description. */ case class GetVar[V <: SType](varId: Byte, override val tpe: SOption[V]) extends NotReadyValue[SOption[V]] { override def companion = GetVar override val opType = SFunc(SContext.ContextFuncDom, tpe) diff --git a/interpreter/shared/src/test/scala/sigmastate/SigmaProtocolSpecification.scala b/interpreter/shared/src/test/scala/sigmastate/SigmaProtocolSpecification.scala index 669cb09da5..107890221b 100644 --- a/interpreter/shared/src/test/scala/sigmastate/SigmaProtocolSpecification.scala +++ b/interpreter/shared/src/test/scala/sigmastate/SigmaProtocolSpecification.scala @@ -2,7 +2,7 @@ package sigmastate import sigmastate.basics.VerifierMessage.Challenge import sigmastate.crypto.{GF2_192, GF2_192_Poly} -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData class SigmaProtocolSpecification extends SigmaTestingData { diff --git a/interpreter/shared/src/test/scala/sigmastate/eval/BasicOpsTests.scala b/interpreter/shared/src/test/scala/sigmastate/eval/BasicOpsTests.scala index d4f05a4050..40f4e7f3d8 100644 --- a/interpreter/shared/src/test/scala/sigmastate/eval/BasicOpsTests.scala +++ b/interpreter/shared/src/test/scala/sigmastate/eval/BasicOpsTests.scala @@ -6,7 +6,7 @@ import org.scalatest.matchers.should.Matchers import java.math.BigInteger import sigmastate.TrivialProp import sigmastate.basics.SecP256K1Group -import special.sigma.{ContractsTestkit, SigmaDslBuilder, SigmaProp} +import sigma.{ContractsTestkit, SigmaDslBuilder, SigmaProp} import scala.language.implicitConversions diff --git a/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala b/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala index 702d890147..a24dcd548c 100644 --- a/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala +++ b/interpreter/shared/src/test/scala/sigmastate/helpers/ErgoLikeContextTesting.scala @@ -9,8 +9,8 @@ import sigmastate.eval._ import sigmastate.interpreter.ContextExtension import sigmastate.interpreter.ErgoTreeEvaluator.DefaultEvalSettings import sigmastate.serialization.{GroupElementSerializer, SigmaSerializer} -import special.collection.Coll -import special.sigma.{Box, Header, PreHeader} +import sigma.collection.Coll +import sigma.{Box, Header, PreHeader} object ErgoLikeContextTesting { /* NO HF PROOF: diff --git a/interpreter/shared/src/test/scala/sigmastate/helpers/TestingHelpers.scala b/interpreter/shared/src/test/scala/sigmastate/helpers/TestingHelpers.scala index fa1b9f163c..e664a251e6 100644 --- a/interpreter/shared/src/test/scala/sigmastate/helpers/TestingHelpers.scala +++ b/interpreter/shared/src/test/scala/sigmastate/helpers/TestingHelpers.scala @@ -8,8 +8,8 @@ import sigmastate.AvlTreeData import sigmastate.Values.ErgoTree import sigmastate.eval.{CostingSigmaDslBuilder, _} import sigmastate.interpreter.ContextExtension -import special.collection.{Coll, CollOverArray, PairOfCols} -import special.sigma.{Header, PreHeader} +import sigma.collection.{Coll, CollOverArray, PairOfCols} +import sigma.{Header, PreHeader} import scala.collection.compat.immutable.ArraySeq diff --git a/interpreter/shared/src/test/scala/sigmastate/lang/SigmaBuilderTest.scala b/interpreter/shared/src/test/scala/sigmastate/lang/SigmaBuilderTest.scala index 393e69454b..0eccc3ce41 100644 --- a/interpreter/shared/src/test/scala/sigmastate/lang/SigmaBuilderTest.scala +++ b/interpreter/shared/src/test/scala/sigmastate/lang/SigmaBuilderTest.scala @@ -11,7 +11,7 @@ import sigmastate.eval.Extensions.ArrayOps import sigmastate.eval.{CAnyValue, CAvlTree, CostingBox, SigmaDsl} import sigmastate.exceptions.ConstraintFailed import sigmastate.serialization.OpCodes -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData import java.math.BigInteger diff --git a/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala b/interpreter/shared/src/test/scala/sigmastate/serialization/ConstantSerializerSpecification.scala index 42df295d53..4e71522d3d 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 special.sigma.AvlTree +import sigma.AvlTree 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 d50f943d7a..dcac288b6b 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.basics.CryptoConstants.EcPointType -import special.sigma.AvlTree +import sigma.AvlTree import SType.AnyOps import sigmastate.exceptions.SerializerException import sigmastate.interpreter.{CostAccumulator, ErgoTreeEvaluator} diff --git a/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala b/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala index d566e416ba..9128d3dc10 100644 --- a/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala +++ b/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala @@ -22,8 +22,8 @@ import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.lang.TransformingSigmaBuilder._ import sigmastate._ import sigmastate.utxo._ -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import java.math.BigInteger import scala.collection.compat.immutable.ArraySeq @@ -238,7 +238,7 @@ trait ObjectGenerators extends TypeGenerators val unsignedShortGen: Gen[Short] = Gen.chooseNum(0, Short.MaxValue).map(_.toShort) lazy val contextExtensionGen: Gen[ContextExtension] = for { - values: collection.Seq[(Byte, EvaluatedValue[SType])] <- Gen.sequence(contextExtensionValuesGen(0, 5))(Buildable.buildableSeq) + values: scala.collection.Seq[(Byte, EvaluatedValue[SType])] <- Gen.sequence(contextExtensionValuesGen(0, 5))(Buildable.buildableSeq) } yield ContextExtension(mutable.LinkedHashMap[Byte, EvaluatedValue[SType]](values.sortBy(_._1).toSeq:_*)) lazy val serializedProverResultGen: Gen[ProverResult] = for { diff --git a/interpreter/shared/src/test/scala/special/sigma/ContractsTestkit.scala b/interpreter/shared/src/test/scala/special/sigma/ContractsTestkit.scala index a544361d98..a7f0b1624a 100644 --- a/interpreter/shared/src/test/scala/special/sigma/ContractsTestkit.scala +++ b/interpreter/shared/src/test/scala/special/sigma/ContractsTestkit.scala @@ -1,6 +1,6 @@ -package special.sigma +package sigma -import special.collection.{Coll, CollOverArrayBuilder} +import sigma.collection.{Coll, CollOverArrayBuilder} import scalan.RType import sigmastate.Values.ErgoTree import sigmastate.{AvlTreeData, Values} diff --git a/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala b/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala index d2b2fa819e..2ce39b0077 100644 --- a/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala +++ b/interpreter/shared/src/test/scala/special/sigma/SigmaTestingData.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import org.ergoplatform.ErgoBox import org.ergoplatform.settings.ErgoAlgos @@ -22,13 +22,13 @@ import sigmastate.serialization.ErgoTreeSerializer import sigmastate.serialization.generators.ObjectGenerators import sigmastate.utils.Helpers import sigmastate._ -import special.collection.Coll +import sigma.collection.Coll import java.math.BigInteger import scala.reflect.ClassTag trait SigmaTestingData extends TestingCommons with ObjectGenerators { - /** Creates a [[special.collection.Coll]] with the given `items`. */ + /** Creates a [[sigma.collection.Coll]] with the given `items`. */ def Coll[T](items: T*)(implicit cT: RType[T]): Coll[T] = CostingSigmaDslBuilder.Colls.fromItems(items: _*) diff --git a/parsers/shared/src/test/scala/sigmastate/lang/LangTests.scala b/parsers/shared/src/test/scala/sigmastate/lang/LangTests.scala index 9fc7198543..0c79b8f05e 100644 --- a/parsers/shared/src/test/scala/sigmastate/lang/LangTests.scala +++ b/parsers/shared/src/test/scala/sigmastate/lang/LangTests.scala @@ -10,10 +10,10 @@ import sigmastate.basics.DLogProtocol.ProveDlog import sigmastate.SCollection.SByteArray import sigmastate.basics.{ProveDHTuple, CryptoConstants} import sigmastate.interpreter.Interpreter.ScriptEnv -import special.sigma._ +import sigma._ import sigmastate.eval._ import sigmastate.helpers.NegativeTesting -import special.collection.Coll +import sigma.collection.Coll trait LangTests extends Matchers with NegativeTesting { diff --git a/sc/jvm/src/test/scala/sigmastate/ErgoTreeBenchmarks.scala b/sc/jvm/src/test/scala/sigmastate/ErgoTreeBenchmarks.scala index da86cbe297..8c3789891b 100644 --- a/sc/jvm/src/test/scala/sigmastate/ErgoTreeBenchmarks.scala +++ b/sc/jvm/src/test/scala/sigmastate/ErgoTreeBenchmarks.scala @@ -2,9 +2,9 @@ package sigmastate import debox.cfor import org.scalameter.api.Bench +import sigma.collections.BenchmarkGens import sigmastate.Values.{IntConstant, SValue} import sigmastate.serialization.OpCodes.PlusCode -import special.collections.BenchmarkGens object ErgoTreeBenchmarks extends Bench.LocalTime with BenchmarkGens { suite: Bench[Double] => diff --git a/sc/jvm/src/test/scala/sigmastate/ReflectionGenerator.scala b/sc/jvm/src/test/scala/sigmastate/ReflectionGenerator.scala index 2d71462966..ed2f863102 100644 --- a/sc/jvm/src/test/scala/sigmastate/ReflectionGenerator.scala +++ b/sc/jvm/src/test/scala/sigmastate/ReflectionGenerator.scala @@ -32,8 +32,8 @@ object ReflectionGenerator { val knownPackages = Array( "scalan.primitives.", - "special.collection.", - "special.sigma.", + "sigma.collection.", + "sigma.", "special.wrappers.", "sigmastate.Values.", "sigmastate.lang.Terms.", diff --git a/sc/jvm/src/test/scala/sigmastate/helpers/SigmaPPrintSpec.scala b/sc/jvm/src/test/scala/sigmastate/helpers/SigmaPPrintSpec.scala index 59e08c918f..5abbf7c9c3 100644 --- a/sc/jvm/src/test/scala/sigmastate/helpers/SigmaPPrintSpec.scala +++ b/sc/jvm/src/test/scala/sigmastate/helpers/SigmaPPrintSpec.scala @@ -12,8 +12,8 @@ import sigmastate.lang.Terms.MethodCall import sigmastate.serialization.OpCodes import sigmastate.utils.Helpers import sigmastate.utxo.SelectField -import special.collection.CollType -import special.sigma.SigmaDslTesting +import sigma.collection.CollType +import sigma.SigmaDslTesting import java.math.BigInteger import scala.collection.mutable.ArrayBuffer diff --git a/sc/jvm/src/test/scala/special/collections/BasicBenchmarks.scala b/sc/jvm/src/test/scala/special/collections/BasicBenchmarks.scala index 31ecd890b1..144f731bad 100644 --- a/sc/jvm/src/test/scala/special/collections/BasicBenchmarks.scala +++ b/sc/jvm/src/test/scala/special/collections/BasicBenchmarks.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import org.scalameter.api._ import debox.cfor diff --git a/sc/jvm/src/test/scala/special/collections/BenchmarkGens.scala b/sc/jvm/src/test/scala/special/collections/BenchmarkGens.scala index 7047207a55..a44e40fe38 100644 --- a/sc/jvm/src/test/scala/special/collections/BenchmarkGens.scala +++ b/sc/jvm/src/test/scala/special/collections/BenchmarkGens.scala @@ -1,7 +1,7 @@ -package special.collections +package sigma.collections import org.scalameter.KeyValue -import org.scalameter.api.{Gen, Bench, _} +import org.scalameter.api.{Bench, Gen, _} trait BenchmarkGens extends CollGens { suite: Bench[Double] => def maxSize = 100000 diff --git a/sc/jvm/src/test/scala/special/collections/BufferBenchmark.scala b/sc/jvm/src/test/scala/special/collections/BufferBenchmark.scala index c2327c7a98..e4dd00e9be 100644 --- a/sc/jvm/src/test/scala/special/collections/BufferBenchmark.scala +++ b/sc/jvm/src/test/scala/special/collections/BufferBenchmark.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import debox.Buffer import debox.cfor diff --git a/sc/jvm/src/test/scala/special/collections/CollBenchmark.scala b/sc/jvm/src/test/scala/special/collections/CollBenchmark.scala index c123778137..aa72f7dc49 100644 --- a/sc/jvm/src/test/scala/special/collections/CollBenchmark.scala +++ b/sc/jvm/src/test/scala/special/collections/CollBenchmark.scala @@ -1,10 +1,10 @@ -package special.collections +package sigma.collections import org.scalameter.{execution, Executor} import org.scalameter.api._ import org.scalameter.picklers.Implicits._ -import special.collection.Coll -import special.collection.Extensions._ +import sigma.collection.Coll +import sigma.collection.Extensions._ import debox.cfor diff --git a/sc/jvm/src/test/scala/special/collections/MapBenchmark.scala b/sc/jvm/src/test/scala/special/collections/MapBenchmark.scala index 3a5c78c8e1..06b2e781c6 100644 --- a/sc/jvm/src/test/scala/special/collections/MapBenchmark.scala +++ b/sc/jvm/src/test/scala/special/collections/MapBenchmark.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import org.scalameter.api.Bench import scalan.{AVHashMap, Nullable} diff --git a/sc/jvm/src/test/scala/special/collections/SymBenchmark.scala b/sc/jvm/src/test/scala/special/collections/SymBenchmark.scala index 354177afbc..4710f9fe7e 100644 --- a/sc/jvm/src/test/scala/special/collections/SymBenchmark.scala +++ b/sc/jvm/src/test/scala/special/collections/SymBenchmark.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import debox.{Set => DSet, Map => DMap} import scalan.TestLibrary 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 bba4d81b3e..013c540f73 100644 --- a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala +++ b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSpec.scala @@ -4,7 +4,7 @@ import org.ergoplatform.ErgoBox.{BoxId, NonMandatoryRegisterId, TokenId} import sigmastate.interpreter.{CostedProverResult, ProverResult} import scalan.RType import org.ergoplatform.{ErgoLikeContext, ErgoBox} -import special.sigma.{SigmaDslBuilder, AnyValue, SigmaProp} +import sigma.{SigmaDslBuilder, AnyValue, SigmaProp} import sigmastate.Values.ErgoTree import sigmastate.eval.{IRContext, CostingSigmaDslBuilder} 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 d792663669..acc1ded565 100644 --- a/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala +++ b/sc/shared/src/main/scala/org/ergoplatform/dsl/ContractSyntax.scala @@ -7,7 +7,7 @@ import sigmastate.SType.AnyOps import org.ergoplatform.dsl.ContractSyntax.{ErgoScript, Proposition} import sigmastate.eval.{CostingSigmaDslBuilder, Evaluation} import sigmastate.interpreter.Interpreter.ScriptEnv -import special.sigma.{SigmaProp, SigmaContract, Context, SigmaDslBuilder} +import sigma.{SigmaProp, SigmaContract, Context, SigmaDslBuilder} import scala.language.implicitConversions /** Defines methods to be used in contract implementations based on [[SigmaContract]]. */ diff --git a/sc/shared/src/main/scala/org/ergoplatform/dsl/ErgoContractSpec.scala b/sc/shared/src/main/scala/org/ergoplatform/dsl/ErgoContractSpec.scala index abc025acf9..1592c1d30b 100644 --- a/sc/shared/src/main/scala/org/ergoplatform/dsl/ErgoContractSpec.scala +++ b/sc/shared/src/main/scala/org/ergoplatform/dsl/ErgoContractSpec.scala @@ -1,6 +1,6 @@ package org.ergoplatform.dsl -import special.collection.Coll +import sigma.collection.Coll import sigmastate.interpreter.CostedProverResult import sigmastate.eval.IRContext import org.ergoplatform.dsl.ContractSyntax.{ErgoScript, Proposition, Token} diff --git a/sc/shared/src/main/scala/scalan/GraphIRReflection.scala b/sc/shared/src/main/scala/scalan/GraphIRReflection.scala index e271d5d176..89ce1ab852 100644 --- a/sc/shared/src/main/scala/scalan/GraphIRReflection.scala +++ b/sc/shared/src/main/scala/scalan/GraphIRReflection.scala @@ -3,10 +3,11 @@ package scalan import scalan.primitives.Thunks import scalan.reflection.CommonReflection.registerClassEntry import scalan.reflection.{CommonReflection, mkConstructor, mkMethod} +import sigma.CoreLibReflection import sigmastate.eval.SigmaLibrary -import special.CoreLibReflection -import special.collection.Colls -import special.sigma.SigmaDsl +import sigma.collection.Colls +import sigma.SigmaDsl +import special.wrappers.{OptionWrapSpec, RTypeWrapSpec} import wrappers.scalan.WRTypes /** Registrations of reflection metadata for graph-ir module (see README.md). @@ -68,7 +69,7 @@ object GraphIRReflection { ) ) - { val clazz = classOf[special.sigma.SigmaDsl#SigmaProp] + { val clazz = classOf[sigma.SigmaDsl#SigmaProp] val ctx = null.asInstanceOf[SigmaDsl] // ok! type level only registerClassEntry(clazz, methods = Map( @@ -564,4 +565,40 @@ object GraphIRReflection { ) ) } + { + val clazz = classOf[OptionWrapSpec] + registerClassEntry(clazz, + methods = Map( + mkMethod(clazz, "getOrElse", Array[Class[_]](classOf[Option[_]], classOf[Function0[_]])) { (obj, args) => + val opt = args(0).asInstanceOf[Option[Any]] + val defaultFunc = args(1).asInstanceOf[Function0[Any]] + obj.asInstanceOf[OptionWrapSpec].getOrElse(opt, defaultFunc()) + }, + mkMethod(clazz, "isDefined", Array[Class[_]](classOf[Option[_]])) { (obj, args) => + obj.asInstanceOf[OptionWrapSpec].isDefined(args(0).asInstanceOf[Option[_]]) + }, + mkMethod(clazz, "filter", Array[Class[_]](classOf[Option[_]], classOf[Function1[_, _]])) { (obj, args) => + obj.asInstanceOf[OptionWrapSpec].filter( + args(0).asInstanceOf[Option[Any]], args(1).asInstanceOf[Any => Boolean]) + }, + mkMethod(clazz, "map", Array[Class[_]](classOf[Option[_]], classOf[Function1[_, _]])) { (obj, args) => + obj.asInstanceOf[OptionWrapSpec].map( + args(0).asInstanceOf[Option[Any]], args(1).asInstanceOf[Any => Any]) + }, + mkMethod(clazz, "get", Array[Class[_]](classOf[Option[_]])) { (obj, args) => + obj.asInstanceOf[OptionWrapSpec].get(args(0).asInstanceOf[Option[_]]) + } + ) + ) + } + { + val clazz = classOf[RTypeWrapSpec] + registerClassEntry(clazz, + methods = Map( + mkMethod(clazz, "name", Array[Class[_]](classOf[RType[_]])) { (obj, args) => + obj.asInstanceOf[RTypeWrapSpec].name(args(0).asInstanceOf[RType[_]]) + } + ) + ) + } } diff --git a/sc/shared/src/main/scala/scalan/Library.scala b/sc/shared/src/main/scala/scalan/Library.scala index ac8c5564a6..566c53e4dc 100644 --- a/sc/shared/src/main/scala/scalan/Library.scala +++ b/sc/shared/src/main/scala/scalan/Library.scala @@ -1,7 +1,7 @@ package scalan import scala.language.implicitConversions -import special.collection._ +import sigma.collection._ import special.wrappers.WrappersModule import scalan.util.MemoizedFunc import scalan.ExactIntegral._ diff --git a/sc/shared/src/main/scala/sigmastate/eval/GraphBuilding.scala b/sc/shared/src/main/scala/sigmastate/eval/GraphBuilding.scala index 347468da89..ea8f3bdd74 100644 --- a/sc/shared/src/main/scala/sigmastate/eval/GraphBuilding.scala +++ b/sc/shared/src/main/scala/sigmastate/eval/GraphBuilding.scala @@ -393,7 +393,7 @@ trait GraphBuilding extends SigmaLibrary { IR: IRContext => import sigmastate._ - protected implicit def groupElementToECPoint(g: special.sigma.GroupElement): EcPointType = CostingSigmaDslBuilder.toECPoint(g).asInstanceOf[EcPointType] + protected implicit def groupElementToECPoint(g: sigma.GroupElement): EcPointType = CostingSigmaDslBuilder.toECPoint(g).asInstanceOf[EcPointType] def error(msg: String) = throw new GraphBuildingException(msg, None) def error(msg: String, srcCtx: Option[SourceContext]) = throw new GraphBuildingException(msg, srcCtx) @@ -471,7 +471,7 @@ trait GraphBuilding extends SigmaLibrary { IR: IRContext => case box: SBox => val boxV = liftConst(box) boxV - case tree: special.sigma.AvlTree => + case tree: sigma.AvlTree => val treeV = liftConst(tree) treeV case s: String => diff --git a/sc/shared/src/main/scala/sigmastate/eval/SigmaLibrary.scala b/sc/shared/src/main/scala/sigmastate/eval/SigmaLibrary.scala index bc1e17d228..be17179cbf 100644 --- a/sc/shared/src/main/scala/sigmastate/eval/SigmaLibrary.scala +++ b/sc/shared/src/main/scala/sigmastate/eval/SigmaLibrary.scala @@ -1,11 +1,11 @@ package sigmastate.eval import scalan.Library -import special.sigma.SigmaDslModule +import sigma.SigmaDslModule /** Main trait which represents sigma operations in graph IR cake. */ trait SigmaLibrary extends Library - with special.sigma.wrappers.WrappersModule + with sigma.wrappers.WrappersModule with SigmaDslModule { import WRType._ diff --git a/sc/shared/src/main/scala/special/collection/CollsUnit.scala b/sc/shared/src/main/scala/special/collection/CollsUnit.scala index 217341830d..f3342e7594 100644 --- a/sc/shared/src/main/scala/special/collection/CollsUnit.scala +++ b/sc/shared/src/main/scala/special/collection/CollsUnit.scala @@ -1,10 +1,10 @@ -package special.collection { +package sigma.collection { import scalan._ /** Staged version of collection interfaces which is used in graph-based IR to represent * methods of Coll and CollBuilder. * Each method of Coll and CollBuilder in Colls corresponds to a method of the original - * non-staged class [[special.collection.Coll]] and [[special.collection.CollBuilder]]. + * non-staged class [[sigma.collection.Coll]] and [[sigma.collection.CollBuilder]]. * The semantics of each method is the same as in the original class, please look there * for details. */ diff --git a/sc/shared/src/main/scala/special/collection/impl/CollsImpl.scala b/sc/shared/src/main/scala/special/collection/impl/CollsImpl.scala index 0437f6c97f..e4cb3b0077 100644 --- a/sc/shared/src/main/scala/special/collection/impl/CollsImpl.scala +++ b/sc/shared/src/main/scala/special/collection/impl/CollsImpl.scala @@ -1,4 +1,4 @@ -package special.collection +package sigma.collection import scala.language.{existentials,implicitConversions} import scalan._ @@ -20,8 +20,7 @@ import WOption._ class CollCls extends EntityObject("Coll") { // entityConst: single const for each entity import Liftables._ - import scala.reflect.{ClassTag, classTag} - type SColl[A] = special.collection.Coll[A] + type SColl[A] = sigma.collection.Coll[A] case class CollConst[SA, A]( constValue: SColl[SA], lA: Liftable[SA, A] @@ -496,8 +495,7 @@ object Coll extends CollCls object CollBuilder extends EntityObject("CollBuilder") { // entityConst: single const for each entity import Liftables._ - import scala.reflect.{ClassTag, classTag} - type SCollBuilder = special.collection.CollBuilder + type SCollBuilder = sigma.collection.CollBuilder case class CollBuilderConst( constValue: SCollBuilder ) extends LiftedConst[SCollBuilder, CollBuilder] with CollBuilder @@ -639,9 +637,9 @@ object CollBuilder extends EntityObject("CollBuilder") { } -object CollsModule extends scalan.ModuleInfo("special.collection", "Colls") { +object CollsModule extends scalan.ModuleInfo("sigma.collection", "Colls") { val reflection = GraphIRReflection } } -trait CollsModule extends special.collection.impl.CollsDefs {self: Library =>} +trait CollsModule extends sigma.collection.impl.CollsDefs {self: Library =>} diff --git a/sc/shared/src/main/scala/special/sigma/SigmaDslUnit.scala b/sc/shared/src/main/scala/special/sigma/SigmaDslUnit.scala index 0ac9882574..48548226a5 100644 --- a/sc/shared/src/main/scala/special/sigma/SigmaDslUnit.scala +++ b/sc/shared/src/main/scala/special/sigma/SigmaDslUnit.scala @@ -1,4 +1,4 @@ -package special.sigma { +package sigma { import scalan._ import sigmastate.eval.SigmaLibrary diff --git a/sc/shared/src/main/scala/special/sigma/impl/SigmaDslImpl.scala b/sc/shared/src/main/scala/special/sigma/impl/SigmaDslImpl.scala index c56beb83cb..e36b2eaf3e 100644 --- a/sc/shared/src/main/scala/special/sigma/impl/SigmaDslImpl.scala +++ b/sc/shared/src/main/scala/special/sigma/impl/SigmaDslImpl.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import scala.language.{existentials, implicitConversions} import scalan._ @@ -34,7 +34,7 @@ object BigInt extends EntityObject("BigInt") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SBigInt = special.sigma.BigInt + type SBigInt = sigma.BigInt case class BigIntConst( constValue: SBigInt ) extends LiftedConst[SBigInt, BigInt] with BigInt @@ -269,7 +269,7 @@ object GroupElement extends EntityObject("GroupElement") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SGroupElement = special.sigma.GroupElement + type SGroupElement = sigma.GroupElement case class GroupElementConst( constValue: SGroupElement ) extends LiftedConst[SGroupElement, GroupElement] with GroupElement @@ -409,7 +409,7 @@ object SigmaProp extends EntityObject("SigmaProp") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SSigmaProp = special.sigma.SigmaProp + type SSigmaProp = sigma.SigmaProp case class SigmaPropConst( constValue: SSigmaProp ) extends LiftedConst[SSigmaProp, SigmaProp] with SigmaProp @@ -573,7 +573,7 @@ object Box extends EntityObject("Box") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SBox = special.sigma.Box + type SBox = sigma.Box case class BoxConst( constValue: SBox ) extends LiftedConst[SBox, Box] with Box @@ -819,7 +819,7 @@ object AvlTree extends EntityObject("AvlTree") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SAvlTree = special.sigma.AvlTree + type SAvlTree = sigma.AvlTree case class AvlTreeConst( constValue: SAvlTree ) extends LiftedConst[SAvlTree, AvlTree] with AvlTree @@ -1092,7 +1092,7 @@ object PreHeader extends EntityObject("PreHeader") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SPreHeader = special.sigma.PreHeader + type SPreHeader = sigma.PreHeader case class PreHeaderConst( constValue: SPreHeader ) extends LiftedConst[SPreHeader, PreHeader] with PreHeader @@ -1253,7 +1253,7 @@ object Header extends EntityObject("Header") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SHeader = special.sigma.Header + type SHeader = sigma.Header case class HeaderConst( constValue: SHeader ) extends LiftedConst[SHeader, Header] with Header @@ -1526,7 +1526,7 @@ object Context extends EntityObject("Context") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SContext = special.sigma.Context + type SContext = sigma.Context case class ContextConst( constValue: SContext ) extends LiftedConst[SContext, Context] with Context @@ -1795,7 +1795,7 @@ object SigmaDslBuilder extends EntityObject("SigmaDslBuilder") { // entityConst: single const for each entity import Liftables._ import scala.reflect.{ClassTag, classTag} - type SSigmaDslBuilder = special.sigma.SigmaDslBuilder + type SSigmaDslBuilder = sigma.SigmaDslBuilder case class SigmaDslBuilderConst( constValue: SSigmaDslBuilder ) extends LiftedConst[SSigmaDslBuilder, SigmaDslBuilder] with SigmaDslBuilder @@ -2339,9 +2339,9 @@ object SigmaDslBuilder extends EntityObject("SigmaDslBuilder") { registerEntityObject("SigmaDslBuilder", SigmaDslBuilder) } -object SigmaDslModule extends scalan.ModuleInfo("special.sigma", "SigmaDsl") { +object SigmaDslModule extends scalan.ModuleInfo("sigma", "SigmaDsl") { val reflection = GraphIRReflection } } -trait SigmaDslModule extends special.sigma.impl.SigmaDslDefs {self: SigmaLibrary =>} +trait SigmaDslModule extends sigma.impl.SigmaDslDefs {self: SigmaLibrary =>} diff --git a/sc/shared/src/main/scala/special/sigma/wrappers/WrappersModule.scala b/sc/shared/src/main/scala/special/sigma/wrappers/WrappersModule.scala index 84fc0abdd3..6696788621 100644 --- a/sc/shared/src/main/scala/special/sigma/wrappers/WrappersModule.scala +++ b/sc/shared/src/main/scala/special/sigma/wrappers/WrappersModule.scala @@ -1,4 +1,4 @@ -package special.sigma.wrappers +package sigma.wrappers trait WrappersModule extends special.wrappers.WrappersModule diff --git a/common/shared/src/main/scala/special/wrappers/WrappersSpec.scala b/sc/shared/src/main/scala/special/wrappers/WrappersSpec.scala similarity index 100% rename from common/shared/src/main/scala/special/wrappers/WrappersSpec.scala rename to sc/shared/src/main/scala/special/wrappers/WrappersSpec.scala diff --git a/sc/shared/src/test/scala/org/ergoplatform/ErgoAddressSpecification.scala b/sc/shared/src/test/scala/org/ergoplatform/ErgoAddressSpecification.scala index 22359c1606..e6610e1c7b 100644 --- a/sc/shared/src/test/scala/org/ergoplatform/ErgoAddressSpecification.scala +++ b/sc/shared/src/test/scala/org/ergoplatform/ErgoAddressSpecification.scala @@ -21,7 +21,7 @@ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.serialization.{GroupElementSerializer, ValueSerializer} import sigmastate.utils.Helpers._ import sigmastate.{CompilerCrossVersionProps, SType, SigmaAnd} -import special.sigma.SigmaDslTesting +import sigma.SigmaDslTesting import java.math.BigInteger diff --git a/sc/shared/src/test/scala/org/ergoplatform/ErgoLikeTransactionSpec.scala b/sc/shared/src/test/scala/org/ergoplatform/ErgoLikeTransactionSpec.scala index 25c01af43d..1d644afcb5 100644 --- a/sc/shared/src/test/scala/org/ergoplatform/ErgoLikeTransactionSpec.scala +++ b/sc/shared/src/test/scala/org/ergoplatform/ErgoLikeTransactionSpec.scala @@ -14,8 +14,8 @@ import sigmastate.eval.Extensions._ import sigmastate.SType._ import sigmastate.helpers.TestingHelpers.copyTransaction import sigmastate.utils.Helpers -import special.sigma.SigmaDslTesting -import special.collection.Extensions._ +import sigma.SigmaDslTesting +import sigma.collection.Extensions._ class ErgoLikeTransactionSpec extends SigmaDslTesting { diff --git a/sc/shared/src/test/scala/org/ergoplatform/dsl/TestContractSpec.scala b/sc/shared/src/test/scala/org/ergoplatform/dsl/TestContractSpec.scala index 996db0e184..54e773ea35 100644 --- a/sc/shared/src/test/scala/org/ergoplatform/dsl/TestContractSpec.scala +++ b/sc/shared/src/test/scala/org/ergoplatform/dsl/TestContractSpec.scala @@ -18,7 +18,7 @@ import sigmastate.eval.{CSigmaProp, Evaluation, IRContext, CAnyValue} import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter, CompilerTestingCommons} import sigmastate.helpers.TestingHelpers._ import sigmastate.lang.Terms.ValueOps -import special.sigma.{AnyValue, SigmaProp} +import sigma.{AnyValue, SigmaProp} case class TestContractSpec(testSuite: CompilerTestingCommons)(implicit val IR: IRContext) extends ContractSpec { diff --git a/sc/shared/src/test/scala/scalan/TestContexts.scala b/sc/shared/src/test/scala/scalan/TestContexts.scala index 2b01269672..78147e5da4 100644 --- a/sc/shared/src/test/scala/scalan/TestContexts.scala +++ b/sc/shared/src/test/scala/scalan/TestContexts.scala @@ -1,7 +1,7 @@ package scalan import scalan.reflection.RMethod -import special.CoreLibReflection +import sigma.CoreLibReflection trait TestContexts extends TestUtils { diff --git a/sc/shared/src/test/scala/sigmastate/ErgoTreeSpecification.scala b/sc/shared/src/test/scala/sigmastate/ErgoTreeSpecification.scala index 8025060afc..8a939fbb20 100644 --- a/sc/shared/src/test/scala/sigmastate/ErgoTreeSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/ErgoTreeSpecification.scala @@ -19,8 +19,8 @@ import sigmastate.lang.Terms._ import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.utils.Helpers.TryOps import sigmastate.utxo._ -import special.collection._ -import special.sigma.{ContractsTestkit, SigmaDslTesting} +import sigma.collection._ +import sigma.{ContractsTestkit, SigmaDslTesting} /** Regression tests with ErgoTree related test vectors. diff --git a/sc/shared/src/test/scala/sigmastate/ScriptVersionSwitchSpecification.scala b/sc/shared/src/test/scala/sigmastate/ScriptVersionSwitchSpecification.scala index 11bf2602e5..ad5af68649 100644 --- a/sc/shared/src/test/scala/sigmastate/ScriptVersionSwitchSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/ScriptVersionSwitchSpecification.scala @@ -15,7 +15,7 @@ import sigmastate.interpreter.EvalSettings.EvaluationMode import sigmastate.interpreter.{CostedProverResult, ErgoTreeEvaluator, EvalSettings, Interpreter, ProverResult} import sigmastate.lang.Terms.ValueOps import sigmastate.utils.Helpers._ -import special.sigma.{Box, SigmaDslTesting} +import sigma.{Box, SigmaDslTesting} /** Specification to verify that the interpreter behaves according to docs/aot-jit-switch.md. * diff --git a/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala b/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala index e671f503b0..c576e24096 100644 --- a/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/SoftForkabilitySpecification.scala @@ -20,7 +20,7 @@ import sigmastate.serialization.SigmaSerializer.startReader import sigmastate.serialization._ import sigmastate.utils.Helpers._ import sigmastate.utxo.DeserializeContext -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData class SoftForkabilitySpecification extends SigmaTestingData with CompilerTestingCommons diff --git a/sc/shared/src/test/scala/sigmastate/TypesSpecification.scala b/sc/shared/src/test/scala/sigmastate/TypesSpecification.scala index d9432bbc96..3d5edf22f2 100644 --- a/sc/shared/src/test/scala/sigmastate/TypesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/TypesSpecification.scala @@ -3,7 +3,7 @@ package sigmastate import sigma.Environment import sigmastate.SType.isValueOfType import sigmastate.eval.{CSigmaProp, CostingSigmaDslBuilder} -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData class TypesSpecification extends SigmaTestingData { diff --git a/sc/shared/src/test/scala/sigmastate/eval/ErgoScriptTestkit.scala b/sc/shared/src/test/scala/sigmastate/eval/ErgoScriptTestkit.scala index b1902877e8..5d949d65fc 100644 --- a/sc/shared/src/test/scala/sigmastate/eval/ErgoScriptTestkit.scala +++ b/sc/shared/src/test/scala/sigmastate/eval/ErgoScriptTestkit.scala @@ -14,7 +14,7 @@ import sigmastate.lang.Terms.ValueOps import sigmastate.lang.{CompilerResult, CompilerSettings, LangTests, SigmaCompiler} import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer import sigmastate.{AvlTreeData, CompilerTestsBase, SType} -import special.sigma.{ContractsTestkit, Context => DContext} +import sigma.{ContractsTestkit, Context => DContext} import scala.annotation.unused import scala.util.Success diff --git a/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala b/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala index b2b497e423..ab4df0c3f2 100644 --- a/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala +++ b/sc/shared/src/test/scala/sigmastate/helpers/CompilerTestingCommons.scala @@ -55,10 +55,10 @@ trait CompilerTestingCommons extends TestingCommons // (ctx.HEIGHT method call compiled to Height IR node) // ------- // We add ctx as it's own variable with id = 1 - val ctxVar = Extensions.toAnyValue[special.sigma.Context](ctx)(special.sigma.ContextRType) + val ctxVar = Extensions.toAnyValue[sigma.Context](ctx)(sigma.ContextRType) val newVars = if (ctx.vars.length < 2) { val vars = ctx.vars.toArray - val buf = new Array[special.sigma.AnyValue](2) + val buf = new Array[sigma.AnyValue](2) Array.copy(vars, 0, buf, 0, vars.length) buf(1) = ctxVar CostingSigmaDslBuilder.Colls.fromArray(buf) diff --git a/sc/shared/src/test/scala/sigmastate/helpers/SigmaPPrint.scala b/sc/shared/src/test/scala/sigmastate/helpers/SigmaPPrint.scala index 38ae6c6740..a1b1c97c86 100644 --- a/sc/shared/src/test/scala/sigmastate/helpers/SigmaPPrint.scala +++ b/sc/shared/src/test/scala/sigmastate/helpers/SigmaPPrint.scala @@ -17,8 +17,8 @@ import sigmastate.lang.Terms.MethodCall import sigmastate.serialization.GroupElementSerializer import sigmastate.utxo.SelectField import sigmastate.interpreter.{CompanionDesc, ErgoTreeEvaluator, FixedCostItem, MethodDesc} -import special.collection.{Coll, CollType} -import special.sigma.GroupElement +import sigma.collection.{Coll, CollType} +import sigma.GroupElement import scala.collection.compat.immutable.ArraySeq import scala.collection.mutable diff --git a/sc/shared/src/test/scala/sigmastate/utxo/AVLTreeScriptsSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/AVLTreeScriptsSpecification.scala index 9fd017eeae..520f625a94 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/AVLTreeScriptsSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/AVLTreeScriptsSpecification.scala @@ -17,8 +17,8 @@ import sigmastate.helpers.TestingHelpers._ import sigmastate.interpreter.Interpreter.ScriptNameProp import sigmastate.interpreter.ProverResult import sigmastate.lang.Terms._ -import special.collection.Coll -import special.sigma.{AvlTree, Context} +import sigma.collection.Coll +import sigma.{AvlTree, Context} class AVLTreeScriptsSpecification extends CompilerTestingCommons diff --git a/sc/shared/src/test/scala/sigmastate/utxo/ContextEnrichingSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/ContextEnrichingSpecification.scala index c76606ed96..3e9d7394bd 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/ContextEnrichingSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/ContextEnrichingSpecification.scala @@ -6,7 +6,7 @@ import sigmastate.Values._ import sigmastate._ import sigmastate.lang.Terms._ import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, ErgoLikeContextTesting, ErgoLikeTestInterpreter, CompilerTestingCommons} -import special.collection.Coll +import sigma.collection.Coll class ContextEnrichingSpecification extends CompilerTestingCommons diff --git a/sc/shared/src/test/scala/sigmastate/utxo/UsingContextPropertiesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/UsingContextPropertiesSpecification.scala index dea73e67b4..e83d9a8569 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/UsingContextPropertiesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/UsingContextPropertiesSpecification.scala @@ -3,7 +3,7 @@ package sigmastate.utxo import sigmastate.{TrivialProp, CompilerCrossVersionProps} import sigmastate.eval.{IRContext, CSigmaProp} import sigmastate.eval.Extensions._ -import special.sigma.Context +import sigma.Context import sigmastate.helpers.CompilerTestingCommons import org.ergoplatform.dsl.{SigmaContractSyntax, ContractSpec, TestContractSpec} import org.ergoplatform.ErgoBox diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchange.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchange.scala index c27dd1356d..e1780c3b04 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchange.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchange.scala @@ -1,9 +1,9 @@ package sigmastate.utxo.examples import org.ergoplatform.dsl.ContractSyntax.Token -import special.sigma.Context +import sigma.Context import org.ergoplatform.ErgoBox.{R4, TokenId} -import special.collection.Coll +import sigma.collection.Coll import org.ergoplatform.dsl.{SigmaContractSyntax, ContractSpec, StdContracts} /** Contract specification for assets atomic exchange transactions. diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchangeErgoTests.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchangeErgoTests.scala index 9a84f6cf1d..b5883ec7d6 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchangeErgoTests.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsAtomicExchangeErgoTests.scala @@ -3,7 +3,7 @@ package sigmastate.utxo.examples import sigmastate.helpers.CompilerTestingCommons import org.ergoplatform.dsl.ContractSyntax.Token import org.ergoplatform.dsl.ErgoContractSpec -import special.collection.Coll +import sigma.collection.Coll import scorex.crypto.hash.Blake2b256 import sigmastate.eval.Digest32Coll diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsPartialFilling.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsPartialFilling.scala index ad5126d626..c7c3b88458 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsPartialFilling.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/AssetsPartialFilling.scala @@ -2,8 +2,8 @@ package sigmastate.utxo.examples import org.ergoplatform.ErgoBox.TokenId import org.ergoplatform.dsl.ContractSyntax.Token -import special.sigma.Context -import special.collection.Coll +import sigma.Context +import sigma.collection.Coll import org.ergoplatform.dsl.{SigmaContractSyntax, ContractSpec, StdContracts} /** diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/CrowdFunding.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/CrowdFunding.scala index ebbf021fb8..d73c0721df 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/CrowdFunding.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/CrowdFunding.scala @@ -1,6 +1,6 @@ package sigmastate.utxo.examples -import special.sigma.{Context, Box} +import sigma.{Context, Box} import org.ergoplatform.dsl.{SigmaContractSyntax, ContractSpec, StdContracts} /** @param backer The party, who wants to fund some amount of Ergs to the project. diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/DummyExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/DummyExamplesSpecification.scala index 9206a6502c..c24b629b7d 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/DummyExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/DummyExamplesSpecification.scala @@ -4,8 +4,8 @@ import org.ergoplatform.ErgoBox import org.ergoplatform.dsl.{ContractSpec, SigmaContractSyntax, StdContracts, TestContractSpec} import scorex.crypto.hash import sigmastate.helpers.CompilerTestingCommons -import special.collection.Coll -import special.sigma.{Box, Context} +import sigma.collection.Coll +import sigma.{Box, Context} import sigmastate.eval.Extensions class DummyExamplesSpecification extends CompilerTestingCommons { suite => diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/ExecuteFromExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/ExecuteFromExamplesSpecification.scala index 34fbc5e356..5ea4ef7a05 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/ExecuteFromExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/ExecuteFromExamplesSpecification.scala @@ -3,7 +3,7 @@ package sigmastate.utxo.examples import org.ergoplatform._ import org.ergoplatform.dsl.{ContractSpec, SigmaContractSyntax, StdContracts, TestContractSpec} import sigmastate.helpers.CompilerTestingCommons -import special.sigma.Context +import sigma.Context import sigmastate.eval.Extensions._ class ExecuteFromExamplesSpecification extends CompilerTestingCommons { suite => diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleDataInputsExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleDataInputsExamplesSpecification.scala index 002d1836c9..0be9e3d02c 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleDataInputsExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleDataInputsExamplesSpecification.scala @@ -6,8 +6,8 @@ import org.ergoplatform.dsl.{ContractSpec, SigmaContractSyntax, StdContracts, Te import scorex.crypto.hash.Blake2b256 import sigmastate.eval.Digest32Coll import sigmastate.helpers.CompilerTestingCommons -import special.collection.Coll -import special.sigma.Context +import sigma.collection.Coll +import sigma.Context class OracleDataInputsExamplesSpecification extends CompilerTestingCommons { suite => implicit lazy val IR: TestingIRContext = new TestingIRContext diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleExamplesSpecification.scala index 384f0d4b63..c477638d6f 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleExamplesSpecification.scala @@ -19,7 +19,7 @@ import sigmastate.crypto.{BigIntegers, CryptoFacade} import sigmastate.eval.Extensions.ArrayOps import sigmastate.interpreter.Interpreter.{ScriptNameProp, emptyEnv} import sigmastate.utxo._ -import special.sigma.Context +import sigma.Context import sigmastate.utils.Helpers._ class OracleExamplesSpecification extends CompilerTestingCommons diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleTokenExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleTokenExamplesSpecification.scala index 7087854598..a9e254cc37 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleTokenExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/OracleTokenExamplesSpecification.scala @@ -6,8 +6,8 @@ import org.ergoplatform.dsl.{ContractSpec, SigmaContractSyntax, StdContracts, Te import scorex.crypto.hash.Blake2b256 import sigmastate.eval.Digest32Coll import sigmastate.helpers.CompilerTestingCommons -import special.collection.Coll -import special.sigma.Context +import sigma.collection.Coll +import sigma.Context class OracleTokenExamplesSpecification extends CompilerTestingCommons { suite => implicit lazy val IR: TestingIRContext = new TestingIRContext diff --git a/sc/shared/src/test/scala/sigmastate/utxo/examples/RevenueSharingExamplesSpecification.scala b/sc/shared/src/test/scala/sigmastate/utxo/examples/RevenueSharingExamplesSpecification.scala index 90cf1871a6..41d3b59039 100644 --- a/sc/shared/src/test/scala/sigmastate/utxo/examples/RevenueSharingExamplesSpecification.scala +++ b/sc/shared/src/test/scala/sigmastate/utxo/examples/RevenueSharingExamplesSpecification.scala @@ -3,7 +3,7 @@ package sigmastate.utxo.examples import org.ergoplatform.dsl.{SigmaContractSyntax, ContractSpec, TestContractSpec, StdContracts} import sigmastate.eval.Extensions import sigmastate.helpers.CompilerTestingCommons -import special.sigma.Context +import sigma.Context class RevenueSharingExamplesSpecification extends CompilerTestingCommons { suite => implicit lazy val IR = new TestingIRContext diff --git a/sc/shared/src/test/scala/special/collections/CollsStagingTests.scala b/sc/shared/src/test/scala/special/collections/CollsStagingTests.scala index 7abe786b04..8df061299d 100644 --- a/sc/shared/src/test/scala/special/collections/CollsStagingTests.scala +++ b/sc/shared/src/test/scala/special/collections/CollsStagingTests.scala @@ -1,4 +1,4 @@ -package special.collections +package sigma.collections import scala.language.reflectiveCalls import special.wrappers.WrappersTests @@ -47,7 +47,7 @@ class CollsStagingTests extends WrappersTests { import EnvRep._ import Liftables._ - val Cols: SCollBuilder = new special.collection.CollOverArrayBuilder + val Cols: SCollBuilder = new sigma.collection.CollOverArrayBuilder val arr = Array(1, 2, 3) val col = Cols.fromArray(arr) @@ -63,7 +63,7 @@ class CollsStagingTests extends WrappersTests { import Coll._ import CollBuilder._ - val Cols: SCollBuilder = new special.collection.CollOverArrayBuilder + val Cols: SCollBuilder = new sigma.collection.CollOverArrayBuilder val colData = Cols.replicate(10, 10) val colSym = colBuilder.replicate(10, 10) val resSym = colSym.append(colSym) diff --git a/sc/shared/src/test/scala/special/sigma/DataValueComparerSpecification.scala b/sc/shared/src/test/scala/special/sigma/DataValueComparerSpecification.scala index eaca756182..9cf9562e50 100644 --- a/sc/shared/src/test/scala/special/sigma/DataValueComparerSpecification.scala +++ b/sc/shared/src/test/scala/special/sigma/DataValueComparerSpecification.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import org.scalatest.BeforeAndAfterAll import scalan.RType @@ -8,7 +8,7 @@ import sigmastate.Values.ErgoTree import sigmastate.eval.{CSigmaProp, Profiler, SigmaDsl} import sigmastate.helpers.SigmaPPrint import sigmastate.interpreter.{CostAccumulator, ErgoTreeEvaluator, EvalSettings, TracedCost} -import special.collection.Coll +import sigma.collection.Coll import scala.util.{Success, Try} diff --git a/sc/shared/src/test/scala/special/sigma/LoopTests.scala b/sc/shared/src/test/scala/special/sigma/LoopTests.scala index 37ff177c8e..ae1b2438f0 100644 --- a/sc/shared/src/test/scala/special/sigma/LoopTests.scala +++ b/sc/shared/src/test/scala/special/sigma/LoopTests.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import sigmastate.helpers.CompilerTestingCommons diff --git a/sc/shared/src/test/scala/special/sigma/SigmaDslSpecification.scala b/sc/shared/src/test/scala/special/sigma/SigmaDslSpecification.scala index 812092d668..afb3868cdf 100644 --- a/sc/shared/src/test/scala/special/sigma/SigmaDslSpecification.scala +++ b/sc/shared/src/test/scala/special/sigma/SigmaDslSpecification.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import java.math.BigInteger import org.ergoplatform._ @@ -20,8 +20,8 @@ import sigmastate.eval.Extensions._ import sigmastate.eval._ import sigmastate.lang.Terms.{MethodCall, PropertyCall} import sigmastate.utxo._ -import special.collection._ -import special.collection.Extensions._ +import sigma.collection._ +import sigma.collection.Extensions._ import sigmastate.serialization.OpCodes.OpCode import sigmastate.utils.Helpers import sigmastate.utils.Helpers._ @@ -6891,7 +6891,7 @@ class SigmaDslSpecification extends SigmaDslTesting )), preGeneratedSamples = Some(samples)) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.forall_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.forall_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq((Coll[Box](), Expected(error))), existingFeature[Coll[Box], Boolean]({ (x: Coll[Box]) => throw error }, @@ -6967,7 +6967,7 @@ class SigmaDslSpecification extends SigmaDslTesting )), preGeneratedSamples = Some(samples)) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq((Coll[Box](), Expected(error))), existingFeature[Coll[Box], Boolean]({ (x: Coll[Box]) => throw error }, @@ -7072,7 +7072,7 @@ class SigmaDslSpecification extends SigmaDslTesting ) ))) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( (Coll[BigInt](), Expected(error)) ), existingFeature[Coll[BigInt], Boolean]( @@ -7187,7 +7187,7 @@ class SigmaDslSpecification extends SigmaDslTesting ) ))) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.exist_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( (Coll[BigInt](), Expected(error)) ), existingFeature[Coll[BigInt], Boolean]( @@ -7795,7 +7795,7 @@ class SigmaDslSpecification extends SigmaDslTesting ) ))) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,java.lang.Object,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,java.lang.Object,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( ((Coll[Byte](), 0), Expected(error)) ), existingFeature[(Coll[Byte], Int), Int]( @@ -8073,7 +8073,7 @@ class SigmaDslSpecification extends SigmaDslTesting ) ) )) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,int,int,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,int,int,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( ((Coll[Byte](), 0), Expected(error)) ), existingFeature( @@ -8739,7 +8739,7 @@ class SigmaDslSpecification extends SigmaDslTesting )), preGeneratedSamples = Some(samples)) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.slice_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,int,int,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.slice_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,int,int,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( (Coll[Int](), (-1, 0)) -> Expected(error) ), existingFeature({ (x: (Coll[Int], (Int, Int))) => throw error; x._1.slice(x._2._1, x._2._2) }, @@ -8818,7 +8818,7 @@ class SigmaDslSpecification extends SigmaDslTesting ) ))) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.append_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,special.collection.Coll,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.append_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,sigma.collection.Coll,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( (Coll[Int](), Coll[Int]()) -> Expected(error) ), existingFeature( @@ -9948,7 +9948,7 @@ class SigmaDslSpecification extends SigmaDslTesting preGeneratedSamples = Some(Seq.empty) ) } else { - def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,special.collection.Coll,java.lang.Object,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") + def error = new java.lang.NoSuchMethodException("sigmastate.SCollection$.fold_eval(sigmastate.lang.Terms$MethodCall,sigma.collection.Coll,java.lang.Object,scala.Function1,sigmastate.interpreter.ErgoTreeEvaluator))") verifyCases( Seq( (keys, initial) -> Expected(error) ), existingFeature[(Coll[Coll[Byte]], Coll[Byte]), Coll[Byte]]( diff --git a/sc/shared/src/test/scala/special/sigma/SigmaDslStaginTests.scala b/sc/shared/src/test/scala/special/sigma/SigmaDslStaginTests.scala index 97ee39d07a..1c67410585 100644 --- a/sc/shared/src/test/scala/special/sigma/SigmaDslStaginTests.scala +++ b/sc/shared/src/test/scala/special/sigma/SigmaDslStaginTests.scala @@ -1,14 +1,13 @@ -package special.sigma +package sigma -import org.scalatest.{BeforeAndAfterAll} -import special.collection._ - -import scala.language.reflectiveCalls +import org.scalatest.BeforeAndAfterAll import scalan.{BaseCtxTests, BaseLiftableTests} -import sigma.VersionContext -import sigmastate.{eval, TrivialProp} +import sigma.collection._ import sigmastate.eval.Extensions._ import sigmastate.eval._ +import sigmastate.{TrivialProp, eval} + +import scala.language.reflectiveCalls class SigmaDslStaginTests extends BaseCtxTests with ErgoScriptTestkit with BaseLiftableTests with BeforeAndAfterAll { class Ctx extends TestContext with IRContext with LiftableTestKit { @@ -17,13 +16,13 @@ class SigmaDslStaginTests extends BaseCtxTests with ErgoScriptTestkit with BaseL test("invokeUnlifted") { val cake = new Ctx import cake._ - import Liftables._ - import Context._ - import Coll._ import Box._ - import SigmaProp._ - import SigmaDslBuilder._ + import Coll._ + import Context._ import EnvRep._ + import Liftables._ + import SigmaDslBuilder._ + import SigmaProp._ val dsl: SSigmaDslBuilder = eval.SigmaDsl type RSigmaDslBuilder = cake.SigmaDslBuilder @@ -47,7 +46,7 @@ class SigmaDslStaginTests extends BaseCtxTests with ErgoScriptTestkit with BaseL cake.check(boxA1, { env: EnvRep[RBox] => for { obj <- env } yield obj.value }, boxA1.value) cake.check(boxA1, { env: EnvRep[RBox] => for { obj <- env } yield obj.creationInfo }, boxA1.creationInfo) - cake.check(boxA1, { env: EnvRep[RBox] => for { obj <- env; arg <- lifted(1) } yield obj.getReg[Coll[Byte]](arg) }, boxA1.getReg[special.collection.Coll[Byte]](1)) + cake.check(boxA1, { env: EnvRep[RBox] => for { obj <- env; arg <- lifted(1) } yield obj.getReg[Coll[Byte]](arg) }, boxA1.getReg[sigma.collection.Coll[Byte]](1)) } diff --git a/sc/shared/src/test/scala/special/sigma/SigmaDslTesting.scala b/sc/shared/src/test/scala/special/sigma/SigmaDslTesting.scala index 0f1e84f5b7..66b0ec6558 100644 --- a/sc/shared/src/test/scala/special/sigma/SigmaDslTesting.scala +++ b/sc/shared/src/test/scala/special/sigma/SigmaDslTesting.scala @@ -1,4 +1,4 @@ -package special.sigma +package sigma import debox.cfor import org.ergoplatform._ @@ -36,7 +36,7 @@ import sigmastate.serialization.generators.ObjectGenerators import sigmastate.utils.Helpers._ import sigmastate.utxo.{DeserializeContext, DeserializeRegister, GetVar, OptionGet} import sigmastate.{SOption, SSigmaProp, SType, SigmaLeaf, eval} -import special.collection.{Coll, CollType} +import sigma.collection.{Coll, CollType} import java.util import scala.collection.mutable @@ -352,7 +352,7 @@ class SigmaDslTesting extends AnyPropSpec ) // We add ctx as it's own variable with id = 1 - val ctxVar = eval.Extensions.toAnyValue[special.sigma.Context](ctx)(special.sigma.ContextRType) + val ctxVar = eval.Extensions.toAnyValue[sigma.Context](ctx)(sigma.ContextRType) val carolVar = eval.Extensions.toAnyValue[Coll[Byte]](pkCarolBytes.toColl)(RType[Coll[Byte]]) val newCtx = ctx .withUpdatedVars(1 -> ctxVar, 2 -> carolVar) diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/AvlTree.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/AvlTree.scala index 19edc35f40..f1cf64377c 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/AvlTree.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/AvlTree.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import scala.scalajs.js.UndefOr import scala.scalajs.js.annotation.JSExportTopLevel -/** Equivalent of [[special.sigma.AvlTree]] available from JS. */ +/** Equivalent of [[sigma.AvlTree]] available from JS. */ @JSExportTopLevel("AvlTree") class AvlTree( val digest: String, diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/GroupElement.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/GroupElement.scala index cc20e704bb..857592d4a2 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/GroupElement.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/GroupElement.scala @@ -6,7 +6,7 @@ import sigmastate.eval.Extensions.ArrayByteOps import scala.scalajs.js import scala.scalajs.js.annotation.JSExportTopLevel -/** Equivalent of [[special.sigma.GroupElement]] available from JS. */ +/** Equivalent of [[sigma.GroupElement]] available from JS. */ @JSExportTopLevel("GroupElement") class GroupElement(val point: Ecp) extends js.Object { /** Returns the point encoded as hex string (ASN.1 encoding). diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Header.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Header.scala index fecd4ef67c..43ea9ecb29 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Header.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Header.scala @@ -3,7 +3,7 @@ package org.ergoplatform.sdk.js import scala.scalajs.js import scala.scalajs.js.annotation.JSExportTopLevel -/** Equivalent of [[special.sigma.Header]] available from JS. */ +/** Equivalent of [[sigma.Header]] available from JS. */ @JSExportTopLevel("Header") class Header( val id: String, 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 4ee64c9b96..f97edd0ab9 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 @@ -21,10 +21,9 @@ import sigmastate.fleetSdkCommon.{distEsmTypesBoxesMod => boxesMod, distEsmTypes import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.serialization.{ErgoTreeSerializer, ValueSerializer} import sigmastate.{AvlTreeData, AvlTreeFlags, SType} -import special.collection.Coll -import special.collection.Extensions.CollBytesOps -import special.sigma -import special.sigma.GroupElement +import sigma.collection.Coll +import sigma.collection.Extensions.CollBytesOps +import sigma.GroupElement import java.math.BigInteger import scala.collection.immutable.ListMap @@ -111,7 +110,7 @@ object Isos { } } - implicit val isoHeader: Iso[Header, special.sigma.Header] = new Iso[Header, special.sigma.Header] { + implicit val isoHeader: Iso[Header, sigma.Header] = new Iso[Header, sigma.Header] { override def to(a: Header): sigma.Header = { CHeader( id = isoStringToColl.to(a.id), @@ -153,7 +152,7 @@ object Isos { } } - implicit val isoPreHeader: Iso[PreHeader, special.sigma.PreHeader] = new Iso[PreHeader, special.sigma.PreHeader] { + implicit val isoPreHeader: Iso[PreHeader, sigma.PreHeader] = new Iso[PreHeader, sigma.PreHeader] { override def to(a: PreHeader): sigma.PreHeader = { CPreHeader( version = a.version, @@ -255,7 +254,7 @@ object Isos { override def from(x: DataInput): inputsMod.DataInput = inputsMod.DataInput(x.boxId.convertTo[boxesMod.BoxId]) } - implicit val isoBigInt: Iso[js.BigInt, special.sigma.BigInt] = new Iso[js.BigInt, special.sigma.BigInt] { + implicit val isoBigInt: Iso[js.BigInt, sigma.BigInt] = new Iso[js.BigInt, sigma.BigInt] { override def to(x: js.BigInt): sigma.BigInt = { CBigInt(new BigInteger(x.toString(10))) } diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/PreHeader.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/PreHeader.scala index 7e38032446..a3b7eeb7f3 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/PreHeader.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/PreHeader.scala @@ -3,7 +3,7 @@ package org.ergoplatform.sdk.js import scala.scalajs.js import scala.scalajs.js.annotation.JSExportTopLevel -/** Equivalent of [[special.sigma.PreHeader]] available from JS. */ +/** Equivalent of [[sigma.PreHeader]] available from JS. */ @JSExportTopLevel("PreHeader") class PreHeader( val version: Byte, diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/SigmaProp.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/SigmaProp.scala index bc2da23561..c44a6a19db 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/SigmaProp.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/SigmaProp.scala @@ -6,7 +6,7 @@ import sigmastate.basics.DLogProtocol.ProveDlog import scala.scalajs.js import scala.scalajs.js.annotation.JSExportTopLevel -/** Equivalent of [[special.sigma.SigmaProp]] available from JS. */ +/** Equivalent of [[sigma.SigmaProp]] available from JS. */ @JSExportTopLevel("SigmaProp") class SigmaProp(val sigmaBoolean: SigmaBoolean) extends js.Object { } diff --git a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Type.scala b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Type.scala index ba4c7128b9..9565ce5b73 100644 --- a/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Type.scala +++ b/sdk/js/src/main/scala/org/ergoplatform/sdk/js/Type.scala @@ -32,33 +32,33 @@ object Type extends js.Object { val Long = new Type(RType.LongType) /** Descriptor of ErgoScript type BigInt. */ - val BigInt = new Type(special.sigma.BigIntRType) + val BigInt = new Type(sigma.BigIntRType) /** Descriptor of ErgoScript type GroupElement. */ - val GroupElement = new Type(special.sigma.GroupElementRType) + val GroupElement = new Type(sigma.GroupElementRType) /** Descriptor of ErgoScript type SigmaProp. */ - val SigmaProp = new Type(special.sigma.SigmaPropRType) + val SigmaProp = new Type(sigma.SigmaPropRType) /** Descriptor of ErgoScript type Box. */ - val Box = new Type(special.sigma.BoxRType) + val Box = new Type(sigma.BoxRType) /** Descriptor of ErgoScript type AvlTree. */ - val AvlTree = new Type(special.sigma.AvlTreeRType) + val AvlTree = new Type(sigma.AvlTreeRType) /** Descriptor of ErgoScript type Context. */ - val Context = new Type(special.sigma.ContextRType) + val Context = new Type(sigma.ContextRType) /** Descriptor of ErgoScript type Header. */ - val Header = new Type(special.sigma.HeaderRType) + val Header = new Type(sigma.HeaderRType) /** Descriptor of ErgoScript type PreHeader. */ - val PreHeader = new Type(special.sigma.PreHeaderRType) + val PreHeader = new Type(sigma.PreHeaderRType) /** Descriptor of ErgoScript type Global. * @see SigmaDslBuilder, SGlobal */ - val SigmaDslBuilder = new Type(special.sigma.SigmaDslBuilderRType) + val SigmaDslBuilder = new Type(sigma.SigmaDslBuilderRType) /** Constructs a new descriptor of ErgoScript pair type (l, r). * @param l first component of the pair @@ -73,6 +73,6 @@ object Type extends js.Object { * @param elemType type descriptor of collection elements */ def collType(elemType: Type): Type = { - new Type(special.collection.collRType(elemType.rtype)) + new Type(sigma.collection.collRType(elemType.rtype)) } } \ No newline at end of file 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 0c30216dbc..39fc89c058 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 @@ -13,7 +13,7 @@ import sigmastate.fleetSdkCommon.distEsmTypesCommonMod import sigmastate.fleetSdkCommon.distEsmTypesRegistersMod.NonMandatoryRegisters import sigmastate.lang.DeserializationSigmaBuilder import sigmastate.serialization.{ConstantSerializer, DataSerializer, SigmaSerializer} -import special.collection.{Coll, CollType} +import sigma.collection.{Coll, CollType} import java.math.BigInteger import scala.scalajs.js @@ -85,19 +85,19 @@ object Value extends js.Object { case RType.BooleanType => data case RType.ByteType | RType.ShortType | RType.IntType => data case RType.LongType => java.lang.Long.parseLong(data.asInstanceOf[js.BigInt].toString(10)) - case special.sigma.BigIntRType => + case sigma.BigIntRType => val v = data.asInstanceOf[js.BigInt] SigmaDsl.BigInt(new BigInteger(v.toString(16), 16)) - case special.sigma.GroupElementRType => + case sigma.GroupElementRType => val ge = data.asInstanceOf[GroupElement] SigmaDsl.GroupElement(ge.point) - case special.sigma.SigmaPropRType => + case sigma.SigmaPropRType => val p = data.asInstanceOf[SigmaProp] SigmaDsl.SigmaProp(p.sigmaBoolean) - case special.sigma.AvlTreeRType => + case sigma.AvlTreeRType => val t = data.asInstanceOf[AvlTree] Isos.isoAvlTree.to(t) - case special.sigma.BoxRType => + case sigma.BoxRType => val t = data.asInstanceOf[Box[distEsmTypesCommonMod.Amount, NonMandatoryRegisters]] SigmaDsl.Box(Isos.isoBox.to(t)) case ct: CollType[a] => @@ -125,17 +125,17 @@ object Value extends js.Object { case RType.BooleanType => value case RType.ByteType | RType.ShortType | RType.IntType => value case RType.LongType => js.BigInt(value.asInstanceOf[Long].toString) - case special.sigma.BigIntRType => - val hex = SigmaDsl.toBigInteger(value.asInstanceOf[special.sigma.BigInt]).toString(10) + case sigma.BigIntRType => + val hex = SigmaDsl.toBigInteger(value.asInstanceOf[sigma.BigInt]).toString(10) js.BigInt(hex) - case special.sigma.GroupElementRType => + case sigma.GroupElementRType => val point = value.asInstanceOf[CGroupElement].wrappedValue.asInstanceOf[Platform.Ecp] new GroupElement(point) - case special.sigma.SigmaPropRType => + case sigma.SigmaPropRType => new SigmaProp(value.asInstanceOf[CSigmaProp].wrappedValue) - case special.sigma.AvlTreeRType => + case sigma.AvlTreeRType => Isos.isoAvlTree.from(value.asInstanceOf[CAvlTree]) - case special.sigma.BoxRType => + case sigma.BoxRType => Isos.isoBox.from(value.asInstanceOf[CostingBox].wrappedValue) case ct: CollType[a] => val arr = value.asInstanceOf[Coll[a]].toArray @@ -162,11 +162,11 @@ object Value extends js.Object { if (n < MinLong || n > MaxLong) throw new ArithmeticException(s"value $n is out of long range") n - case special.sigma.BigIntRType => + case sigma.BigIntRType => data.asInstanceOf[js.BigInt] - case special.sigma.GroupElementRType => + case sigma.GroupElementRType => data.asInstanceOf[GroupElement] - case special.sigma.SigmaPropRType => + case sigma.SigmaPropRType => data.asInstanceOf[SigmaProp] case PairType(l, r) => data match { case arr: js.Array[Any @unchecked] => 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 47eedf2706..250d34b5cd 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 @@ -13,9 +13,8 @@ import sigmastate.Values.Constant import sigmastate.eval.Colls import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.serialization.generators.ObjectGenerators -import special.collection.Coll -import special.sigma -import special.sigma.GroupElement +import sigma.collection.Coll +import sigma.GroupElement import scala.scalajs.js diff --git a/sdk/js/src/test/scala/org/ergoplatform/sdk/js/ValueSpec.scala b/sdk/js/src/test/scala/org/ergoplatform/sdk/js/ValueSpec.scala index 54ace98db5..85bba2b1c8 100644 --- a/sdk/js/src/test/scala/org/ergoplatform/sdk/js/ValueSpec.scala +++ b/sdk/js/src/test/scala/org/ergoplatform/sdk/js/ValueSpec.scala @@ -13,7 +13,7 @@ import sigmastate.eval.CSigmaProp import sigmastate.lang.DeserializationSigmaBuilder import sigmastate.serialization.ConstantSerializer import sigmastate.utils.Helpers -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData import java.math.BigInteger diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/BlockchainContext.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/BlockchainContext.scala index d5b6edaf69..317fda331c 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/BlockchainContext.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/BlockchainContext.scala @@ -1,8 +1,8 @@ package org.ergoplatform.sdk import org.ergoplatform.sdk.wallet.protocol.context.BlockchainStateContext -import special.collection.Coll -import special.sigma.Header +import sigma.collection.Coll +import sigma.Header /** Represents a specific context of blockchain for execution * of transaction building scenario. diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/DataJsonEncoder.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/DataJsonEncoder.scala index d36bd947a3..fd49f1b3d9 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/DataJsonEncoder.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/DataJsonEncoder.scala @@ -12,8 +12,8 @@ import sigmastate.Values.{Constant, EvaluatedValue} import sigmastate._ import sigmastate.lang.SigmaParser import sigmastate.eval._ -import special.collection.Coll -import special.sigma._ +import sigma.collection.Coll +import sigma._ import debox.cfor import sigmastate.exceptions.SerializerException import scala.collection.compat.immutable.ArraySeq diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/Extensions.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/Extensions.scala index 426090b125..6744bf746e 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/Extensions.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/Extensions.scala @@ -4,8 +4,8 @@ import debox.cfor import scalan.RType import scalan.rtypeToClassTag // actually used import sigmastate.eval.CPreHeader -import special.collection.{Coll, CollBuilder, PairColl} -import special.sigma.{Header, PreHeader} +import sigma.collection.{Coll, CollBuilder, PairColl} +import sigma.{Header, PreHeader} import scala.collection.compat.BuildFrom import scala.collection.{GenIterable, immutable} 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 52c653e9db..5e516256c3 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JavaHelpers.scala @@ -1,7 +1,7 @@ package org.ergoplatform.sdk import scalan.RType -import special.collection.Coll +import sigma.collection.Coll import scala.collection.{JavaConverters, mutable} import org.ergoplatform._ @@ -12,7 +12,7 @@ import sigmastate.serialization.{ErgoTreeSerializer, GroupElementSerializer, Sig import scorex.crypto.authds.ADKey import org.ergoplatform.settings.ErgoAlgos import sigmastate.eval.{CPreHeader, Colls, CostingSigmaDslBuilder, Digest32Coll, Evaluation} -import special.sigma.{AnyValue, AvlTree, GroupElement, Header} +import sigma.{AnyValue, AvlTree, GroupElement, Header} import sigmastate.utils.Helpers._ // don't remove, required for Scala 2.11 import java.util @@ -249,8 +249,8 @@ object JavaHelpers { implicit val JLongRType: RType[JLong] = RType.LongType.asInstanceOf[RType[JLong]] implicit val JBooleanRType: RType[JBoolean] = RType.BooleanType.asInstanceOf[RType[JBoolean]] - val HeaderRType: RType[Header] = special.sigma.HeaderRType - val PreHeaderRType: RType[special.sigma.PreHeader] = special.sigma.PreHeaderRType + val HeaderRType: RType[Header] = sigma.HeaderRType + val PreHeaderRType: RType[sigma.PreHeader] = sigma.PreHeaderRType def Algos: ErgoAlgos = org.ergoplatform.settings.ErgoAlgos @@ -359,17 +359,17 @@ object JavaHelpers { DataInput(ADKey @@ boxIdBytes) } - def collRType[T](tItem: RType[T]): RType[Coll[T]] = special.collection.collRType(tItem) + def collRType[T](tItem: RType[T]): RType[Coll[T]] = sigma.collection.collRType(tItem) - def BigIntRType: RType[special.sigma.BigInt] = special.sigma.BigIntRType + def BigIntRType: RType[sigma.BigInt] = sigma.BigIntRType - def GroupElementRType: RType[special.sigma.GroupElement] = special.sigma.GroupElementRType + def GroupElementRType: RType[sigma.GroupElement] = sigma.GroupElementRType - def SigmaPropRType: RType[special.sigma.SigmaProp] = special.sigma.SigmaPropRType + def SigmaPropRType: RType[sigma.SigmaProp] = sigma.SigmaPropRType - def AvlTreeRType: RType[special.sigma.AvlTree] = special.sigma.AvlTreeRType + def AvlTreeRType: RType[sigma.AvlTree] = sigma.AvlTreeRType - def BoxRType: RType[special.sigma.Box] = special.sigma.BoxRType + def BoxRType: RType[sigma.Box] = sigma.BoxRType def SigmaDsl: CostingSigmaDslBuilder = sigmastate.eval.SigmaDsl @@ -409,7 +409,7 @@ object JavaHelpers { * @return a mapping from asset id to to balance and total assets number */ def extractAssets(boxes: IndexedSeq[ErgoBoxCandidate]): (Map[Digest32Coll, Long], Int) = { - import special.collection.Extensions.CollOps + import sigma.collection.Extensions.CollOps val map = mutable.Map[Digest32Coll, Long]() val assetsNum = boxes.foldLeft(0) { case (acc, box) => require(box.additionalTokens.length <= SigmaConstants.MaxTokens.value, "too many assets in one box") 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 52e1565ca3..604a8ac081 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,8 @@ import sigmastate.eval.{CPreHeader, WrapperOf, _} import sigmastate.exceptions.SigmaException import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.{AvlTreeData, AvlTreeFlags, SType} -import special.collection.Coll -import special.sigma.{AnyValue, Header, PreHeader} +import sigma.collection.Coll +import sigma.{AnyValue, Header, PreHeader} import scala.util.Try import sigmastate.utils.Helpers._ // required for Scala 2.11 @@ -62,11 +62,11 @@ trait JsonCodecs { fromTry(Try.apply(DataJsonEncoder.decodeAnyValue(cursor.value))) }) - implicit val sigmaBigIntEncoder: Encoder[special.sigma.BigInt] = Encoder.instance({ bigInt => + implicit val sigmaBigIntEncoder: Encoder[sigma.BigInt] = Encoder.instance({ bigInt => JsonNumber.fromDecimalStringUnsafe(bigInt.asInstanceOf[WrapperOf[BigInteger]].wrappedValue.toString).asJson }) - implicit val sigmaBigIntDecoder: Decoder[special.sigma.BigInt] = Decoder.instance({ implicit cursor => + implicit val sigmaBigIntDecoder: Decoder[sigma.BigInt] = Decoder.instance({ implicit cursor => for { jsonNumber <- cursor.as[JsonNumber] bigInt <- fromOption(jsonNumber.toBigInt) @@ -153,7 +153,7 @@ trait JsonCodecs { minerPk <- cursor.downField("minerPk").as[Coll[Byte]] powOnetimePk <- cursor.downField("powOnetimePk").as[Coll[Byte]] powNonce <- cursor.downField("powNonce").as[Coll[Byte]] - powDistance <- cursor.downField("powDistance").as[special.sigma.BigInt] + powDistance <- cursor.downField("powDistance").as[sigma.BigInt] votes <- cursor.downField("votes").as[Coll[Byte]] } yield new CHeader(id, version, parentId, adProofsRoot, stateRoot, transactionsRoot, timestamp, nBits, height, extensionRoot, SigmaDsl.decodePoint(minerPk), SigmaDsl.decodePoint(powOnetimePk), powNonce, powDistance, votes) diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/ProverBuilder.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/ProverBuilder.scala index 0704cbe8d6..5525dbcc4d 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/ProverBuilder.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/ProverBuilder.scala @@ -4,7 +4,7 @@ import org.ergoplatform.ErgoAddressEncoder.{MainnetNetworkPrefix, NetworkPrefix} import org.ergoplatform.sdk.wallet.secrets.ExtendedSecretKey import sigmastate.basics.DLogProtocol.DLogProverInput import sigmastate.basics.{DLogProtocol, DiffieHellmanTupleProverInput} -import special.sigma.GroupElement +import sigma.GroupElement import java.math.BigInteger import scala.collection.mutable.ArrayBuffer diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/SigmaProver.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/SigmaProver.scala index 8090627083..aa281f5b10 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/SigmaProver.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/SigmaProver.scala @@ -6,7 +6,7 @@ import org.ergoplatform.sdk.wallet.protocol.context.BlockchainStateContext import sigmastate.eval.{CostingSigmaDslBuilder, SigmaDsl} import sigmastate.interpreter.HintsBag import sigmastate.utils.Helpers.TryOps -import special.sigma.{BigInt, SigmaProp} +import sigma.{BigInt, SigmaProp} /** Represents a prover for signing Ergo transactions and messages. * diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/UnsignedTransactionBuilder.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/UnsignedTransactionBuilder.scala index e48f26fd6f..6030bf2aa9 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/UnsignedTransactionBuilder.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/UnsignedTransactionBuilder.scala @@ -9,9 +9,9 @@ import org.ergoplatform.sdk.wallet.{AssetUtils, TokensMap} import scorex.util.{ModifierId, bytesToId} import sigmastate.eval.Extensions.ArrayOps import sigmastate.utils.Extensions.ModifierIdOps -import special.collection.Coll -import special.collection.Extensions.CollBytesOps -import special.sigma.PreHeader +import sigma.collection.Coll +import sigma.collection.Extensions.CollBytesOps +import sigma.PreHeader import scala.collection.mutable.ArrayBuffer import scala.util.Try diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/utils/Zero.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/utils/Zero.scala index 2115d774a0..e2b57100cc 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/utils/Zero.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/utils/Zero.scala @@ -10,9 +10,9 @@ import sigmastate.Values.ErgoTree import sigmastate.basics.CryptoConstants import sigmastate.eval._ import sigmastate.{AvlTreeData, AvlTreeFlags, TrivialProp} -import special.Types.TupleType -import special.collection.{Coll, CollType} -import special.sigma.{AvlTree, AvlTreeRType, BigInt, BigIntRType, Box, BoxRType, GroupElement, GroupElementRType, SigmaProp, SigmaPropRType} +import sigma.Types.TupleType +import sigma.collection.{Coll, CollType} +import sigma.{AvlTree, AvlTreeRType, BigInt, BigIntRType, Box, BoxRType, GroupElement, GroupElementRType, SigmaProp, SigmaPropRType} import java.math.BigInteger import scala.language.implicitConversions diff --git a/sdk/shared/src/main/scala/org/ergoplatform/sdk/wallet/protocol/context/BlockchainStateContext.scala b/sdk/shared/src/main/scala/org/ergoplatform/sdk/wallet/protocol/context/BlockchainStateContext.scala index 5c8d97df4f..41ba7ee8d1 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/wallet/protocol/context/BlockchainStateContext.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/wallet/protocol/context/BlockchainStateContext.scala @@ -1,6 +1,6 @@ package org.ergoplatform.sdk.wallet.protocol.context -import special.collection.Coll +import sigma.collection.Coll /** Blockchain context used in tx signing. * @@ -9,7 +9,7 @@ import special.collection.Coll * @param sigmaPreHeader returns pre-header (header without certain fields) of the current block */ case class BlockchainStateContext( - sigmaLastHeaders: Coll[special.sigma.Header], + sigmaLastHeaders: Coll[sigma.Header], previousStateDigest: Coll[Byte], - sigmaPreHeader: special.sigma.PreHeader + sigmaPreHeader: sigma.PreHeader ) diff --git a/sdk/shared/src/test/scala/org/ergoplatform/sdk/ContractTemplateSpecification.scala b/sdk/shared/src/test/scala/org/ergoplatform/sdk/ContractTemplateSpecification.scala index c660f44e02..268012ac3c 100644 --- a/sdk/shared/src/test/scala/org/ergoplatform/sdk/ContractTemplateSpecification.scala +++ b/sdk/shared/src/test/scala/org/ergoplatform/sdk/ContractTemplateSpecification.scala @@ -8,7 +8,7 @@ import sigmastate._ import sigmastate.eval.CBigInt import sigmastate.helpers.NegativeTesting import sigmastate.serialization.{SerializationSpecification, SigmaSerializer} -import special.sigma.ContractsTestkit +import sigma.ContractsTestkit import java.math.BigInteger 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 cdcd0906c0..d89ac0f6c5 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.basics.CryptoConstants.EcPointType import sigmastate.exceptions.SerializerException -import special.sigma.{Box, AvlTree} +import sigma.{Box, AvlTree} import sigmastate.serialization.SerializationSpecification class DataJsonEncoderSpecification extends SerializationSpecification { diff --git a/sdk/shared/src/test/scala/org/ergoplatform/sdk/ExtensionsSpec.scala b/sdk/shared/src/test/scala/org/ergoplatform/sdk/ExtensionsSpec.scala index 72c75ace73..97fe775e73 100644 --- a/sdk/shared/src/test/scala/org/ergoplatform/sdk/ExtensionsSpec.scala +++ b/sdk/shared/src/test/scala/org/ergoplatform/sdk/ExtensionsSpec.scala @@ -3,10 +3,10 @@ package org.ergoplatform.sdk import org.scalatest.matchers.should.Matchers import org.scalatest.propspec.AnyPropSpec import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks -import special.collection.Coll -import special.collections.CollGens +import sigma.collection.Coll import org.ergoplatform.sdk.Extensions.{CollBuilderOps, CollOps, GenIterableOps, PairCollOps} import scalan.RType +import sigma.collections.CollGens import sigmastate.eval.CostingSigmaDslBuilder class ExtensionsSpec extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers with CollGens { diff --git a/sdk/shared/src/test/scala/org/ergoplatform/sdk/JsonSerializationSpec.scala b/sdk/shared/src/test/scala/org/ergoplatform/sdk/JsonSerializationSpec.scala index e85757985e..a764b6e7de 100644 --- a/sdk/shared/src/test/scala/org/ergoplatform/sdk/JsonSerializationSpec.scala +++ b/sdk/shared/src/test/scala/org/ergoplatform/sdk/JsonSerializationSpec.scala @@ -17,8 +17,8 @@ import sigmastate.eval.Digest32Coll import sigmastate.interpreter.{ContextExtension, ProverResult} import sigmastate.serialization.SerializationSpecification import sigmastate.utils.Helpers.DecoderResultOps // required for Scala 2.11 (extension method toTry) -import special.collection.Coll -import special.sigma.{Header, PreHeader} +import sigma.collection.Coll +import sigma.{Header, PreHeader} import org.ergoplatform.{DataInput, ErgoBox, ErgoBoxCandidate, ErgoLikeContext, ErgoLikeTransaction, ErgoLikeTransactionTemplate, Input, UnsignedErgoLikeTransaction, UnsignedInput} import scala.collection.mutable @@ -35,7 +35,7 @@ class JsonSerializationSpec extends SerializationSpecification with JsonCodecs { } property("sigma.BigInt should be encoded into JSON and decoded back correctly") { - forAll { v: special.sigma.BigInt => jsonRoundTrip(v) } + forAll { v: sigma.BigInt => jsonRoundTrip(v) } } property("byte array should be encoded into JSON and decoded back correctly") { diff --git a/sdk/shared/src/test/scala/org/ergoplatform/sdk/multisig/SigningSpec.scala b/sdk/shared/src/test/scala/org/ergoplatform/sdk/multisig/SigningSpec.scala index bde2e04fcf..e45fd0d8dd 100644 --- a/sdk/shared/src/test/scala/org/ergoplatform/sdk/multisig/SigningSpec.scala +++ b/sdk/shared/src/test/scala/org/ergoplatform/sdk/multisig/SigningSpec.scala @@ -11,7 +11,7 @@ import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import scalan.util.CollectionUtil.AnyOps import sigmastate.TestsBase import sigmastate.Values.{Constant, ErgoTree} -import special.sigma.SigmaTestingData +import sigma.SigmaTestingData class SigningSpec extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers with TestsBase