diff --git a/interpreter/js/src/test/scala/sigmastate/crypto/CryptoFacadeJsSpec.scala b/interpreter/js/src/test/scala/sigmastate/crypto/CryptoFacadeJsSpec.scala index 9fc4e43d86..63839e67ef 100644 --- a/interpreter/js/src/test/scala/sigmastate/crypto/CryptoFacadeJsSpec.scala +++ b/interpreter/js/src/test/scala/sigmastate/crypto/CryptoFacadeJsSpec.scala @@ -2,7 +2,6 @@ package sigmastate.crypto import org.scalatest.matchers.should.Matchers import org.scalatest.propspec.AnyPropSpec -import scorex.util.encode.Base16 import scala.scalajs.js import scala.scalajs.js.typedarray.Uint8Array diff --git a/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala b/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala index 73e0a96370..937aa37fda 100644 --- a/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala +++ b/interpreter/shared/src/main/scala/sigmastate/interpreter/InterpreterContext.scala @@ -9,6 +9,8 @@ import sigmastate.utils.{SigmaByteReader, SigmaByteWriter} import special.sigma import special.sigma.AnyValue +import scala.collection.mutable + /** * User-defined variables to be put into context. * Each variable is identified by `id: Byte` and can be accessed from a script @@ -20,7 +22,7 @@ import special.sigma.AnyValue * * @param values internal container of the key-value pairs */ -case class ContextExtension(values: Map[Byte, EvaluatedValue[_ <: SType]]) { +case class ContextExtension(values: scala.collection.Map[Byte, EvaluatedValue[_ <: SType]]) { def add(bindings: VarBinding*): ContextExtension = ContextExtension(values ++ bindings) } @@ -49,8 +51,7 @@ object ContextExtension { error(s"Negative amount of context extension values: $extSize") val ext = (0 until extSize) .map(_ => (r.getByte(), r.getValue().asInstanceOf[EvaluatedValue[_ <: SType]])) - .toMap[Byte, EvaluatedValue[_ <: SType]] - ContextExtension(ext) + ContextExtension(mutable.LinkedHashMap(ext:_*)) } } 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 fd88370d93..92538aca22 100644 --- a/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala +++ b/interpreter/shared/src/test/scala/sigmastate/serialization/generators/ObjectGenerators.scala @@ -27,7 +27,7 @@ import special.sigma._ import java.math.BigInteger import scala.collection.compat.immutable.ArraySeq -import scala.collection.immutable.ListMap +import scala.collection.mutable import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag @@ -238,8 +238,8 @@ trait ObjectGenerators extends TypeGenerators val unsignedShortGen: Gen[Short] = Gen.chooseNum(0, Short.MaxValue).map(_.toShort) lazy val contextExtensionGen: Gen[ContextExtension] = for { - values <- Gen.sequence(contextExtensionValuesGen(0, 5))(Buildable.buildableSeq) - } yield ContextExtension(ListMap.empty ++ values.sortBy(_._1)) + values: 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 { bytes <- arrayOfRange(1, 100, arbByte.arbitrary) 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 42d25e09d4..aae3410df4 100644 --- a/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala +++ b/sdk/shared/src/main/scala/org/ergoplatform/sdk/JsonCodecs.scala @@ -1,7 +1,6 @@ package org.ergoplatform.sdk import java.math.BigInteger - import cats.syntax.either._ import io.circe._ import io.circe.syntax._ @@ -33,6 +32,8 @@ import org.ergoplatform.ErgoLikeTransactionTemplate import org.ergoplatform.ErgoBoxCandidate import org.ergoplatform.ErgoLikeContext +import scala.collection.mutable + trait JsonCodecs { def fromTry[T](tryResult: Try[T])(implicit cursor: ACursor): Either[DecodingFailure, T] = { @@ -244,7 +245,7 @@ trait JsonCodecs { implicit val contextExtensionDecoder: Decoder[ContextExtension] = Decoder.instance({ cursor => for { - values <- cursor.as[Map[Byte, EvaluatedValue[SType]]] + values <- cursor.as[mutable.LinkedHashMap[Byte, EvaluatedValue[SType]]] } yield ContextExtension(values) })