Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release Candidate v5.0.13 #927

Closed
wants to merge 116 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
8d1ea8f
sigma-ast: SType moved to sigma.ast package of core module
aslesarenko Aug 27, 2023
55e4a8e
sigma-ast: tests pass in core, interpreter, parsers, sdk
aslesarenko Aug 27, 2023
f8fafbc
sigma-ast: all code compiles
aslesarenko Aug 27, 2023
d479754
sigma-ast: all tests passed
aslesarenko Aug 27, 2023
6d2bb9d
sigma-ast: fix Scala 2.11 compilation
aslesarenko Aug 27, 2023
d0bff03
sigma-ast: fix ReflectionData
aslesarenko Aug 27, 2023
e629124
sigma-ast: TypeSerializer code moved to CoreTypeSerializer
aslesarenko Sep 8, 2023
142fcc8
sigma-ast: TypeSerializer code moved to CoreTypeSerializer (fix compi…
aslesarenko Sep 9, 2023
01190bb
sigma-ast: AvlTreeData moved to core
aslesarenko Sep 10, 2023
f5d01ff
sigma-ast: everything compiles
aslesarenko Sep 10, 2023
69d4f7a
sigma-ast: fix Reflection initialization
aslesarenko Sep 10, 2023
a5c27b3
Merge remote-tracking branch 'origin/minimize-modules' into sigma-ast
aslesarenko Sep 10, 2023
c7fd85d
sigma-ast: fix after merge
aslesarenko Sep 10, 2023
e162665
sigma-ast: CryptoContext moved to core
aslesarenko Sep 10, 2023
a22282d
sigma-ast: GroupElementSerializer moved to core
aslesarenko Sep 10, 2023
02f6ad2
Merge remote-tracking branch 'origin/sigma-ast' into core-serializers
aslesarenko Sep 10, 2023
0e45513
sigma-ast: fix after merge
aslesarenko Sep 10, 2023
1a86c84
sigma-ast: fix Reflection for SigmaCompiler
aslesarenko Sep 10, 2023
fedb4f6
sigma-ast: fix Reflection for SigmaCompiler
aslesarenko Sep 10, 2023
c6585e1
Merge remote-tracking branch 'origin/sigma-ast' into core-serializers
aslesarenko Sep 11, 2023
61f2bda
core-serializers: CGroupElement moved to core
aslesarenko Sep 11, 2023
0c7e09a
core-serializers: fix compilation Scala 2.11
aslesarenko Sep 11, 2023
198e028
core-serializers: removed toBits unfinished method
aslesarenko Sep 11, 2023
5b07d30
core-serializers: removed all xxxQ methods from BigInt
aslesarenko Sep 11, 2023
637ecff
core-serializers: introduced SPCodes
aslesarenko Sep 11, 2023
d12e488
core-serializers: SigmaBoolean moved to a separate file
aslesarenko Sep 11, 2023
e16540d
core-serializers: SigmaBoolean became sealed
aslesarenko Sep 11, 2023
728895b
core-serializers: SigmaBoolean moved to core
aslesarenko Sep 11, 2023
c8de983
core-serializers: CSigmaProp moved to core
aslesarenko Sep 11, 2023
44d2463
core-serializers: CSigmaProp.propBytes implemented without ErgoTree
aslesarenko Sep 12, 2023
2d00c56
core-serializers: toColl extension method moved to core
aslesarenko Sep 12, 2023
c8c5eda
Merge remote-tracking branch 'origin/v5.0.12-RC' into sigma-ast
aslesarenko Sep 12, 2023
744c381
sigma-ast: cleanups
aslesarenko Sep 12, 2023
d9b6b23
core-serializers: CAvlTree moved to core
aslesarenko Sep 13, 2023
dd91fa3
core-serializers: CoreDataSerializer introduced
aslesarenko Sep 13, 2023
c973adb
core-serializers: js.Type moved to core.js
aslesarenko Sep 13, 2023
4912a3c
Merge remote-tracking branch 'origin/sigma-ast' into core-serializers
aslesarenko Sep 13, 2023
5695687
core-serializers: fixes after merge
aslesarenko Sep 13, 2023
4fcd2a7
core-serializers: Value moved to core.js
aslesarenko Sep 13, 2023
feebe24
core-serializers2: renamed CostingBox -> CBox
aslesarenko Sep 20, 2023
d503dbe
core-serializers2: renamed CostingSigmaDslBuilder -> CSigmaDslBuilder
aslesarenko Sep 20, 2023
094beeb
core-serializers2: renamed CostingDataContext -> CContext
aslesarenko Sep 20, 2023
3f85433
core-serializers2: moved CAnyValue to core
aslesarenko Sep 20, 2023
2ddc80d
core-serializers2: moved Digest32Coll to core
aslesarenko Sep 20, 2023
42541ac
core-serializers2: ErgoTree moved out of Values object
aslesarenko Sep 20, 2023
731409f
core-serializers2: fix Scala 2.11 compilation
aslesarenko Sep 20, 2023
7f7120a
ergotree-version: introduced HeaderType
aslesarenko Sep 23, 2023
11c98a3
ergotree-version: upgrade default VersionContext
aslesarenko Sep 24, 2023
c2f27b2
ergotree-version: update DefaultHeader to latest version
aslesarenko Sep 24, 2023
ebb8f51
ergotree-version: fix test
aslesarenko Sep 24, 2023
8e64044
ergotree-version: fix tests (2)
aslesarenko Sep 24, 2023
3c25033
ergotree-version: abstract classes for BlockchainParameters and Block…
aslesarenko Sep 25, 2023
32a4652
ergotree-version: removed implicit conversions to ErgoTree
aslesarenko Sep 25, 2023
9d8b446
sigma-ast: addressed review comments
aslesarenko Oct 3, 2023
8442400
Merge pull request #913 from ScorexFoundation/sigma-ast
aslesarenko Oct 3, 2023
b43dfe1
Merge remote-tracking branch 'origin/v5.0.13-RC' into ergotree-version
aslesarenko Oct 3, 2023
484622b
ergotree-version: fixes after merge
aslesarenko Oct 3, 2023
17e5c59
ergotree-version: use ZeroHeader as DefaultHeader
aslesarenko Oct 3, 2023
9cdcbde
Merge remote-tracking branch 'origin/ergotree-version' into core-seri…
aslesarenko Oct 4, 2023
a8ba147
core-serializers: fixes after merge
aslesarenko Oct 4, 2023
9617c12
Merge remote-tracking branch 'origin/core-serializers' into core-seri…
aslesarenko Oct 4, 2023
69a9148
core-serializers2: fixes after merge
aslesarenko Oct 4, 2023
26345ad
move-js-export: js.ErgoTree moved to interpreter module
aslesarenko Oct 5, 2023
3e12acd
towards-data-module: AvlTreeVerifier into separate file
aslesarenko Oct 5, 2023
c3f4ef4
towards-data-module: cleanup code + v6.0 todos
aslesarenko Oct 5, 2023
2d767ae
towards-data-module: Value class moved to sigma.ast package (Values r…
aslesarenko Oct 5, 2023
0ded24b
towards-data-module: partially removed code related to TaggedVar
aslesarenko Oct 5, 2023
dc23717
core-serializers2: cleanup code
aslesarenko Oct 5, 2023
c9d30ce
Merge remote-tracking branch 'origin/core-serializers2' into towards-…
aslesarenko Oct 6, 2023
a79834b
towards-data-module: types.scala moved to sigma.ast package
aslesarenko Oct 6, 2023
7638ec5
towards-data-module: renaming types.scala -> methods.scala
aslesarenko Oct 6, 2023
3af15da
towards-data-module: JitCost and CostKind moved to sigma.ast package
aslesarenko Oct 6, 2023
e265ade
towards-data-module: Operations.scala moved to sigma.ast
aslesarenko Oct 6, 2023
cd36fbf
towards-data-module: SMethod moved to sigma.ast
aslesarenko Oct 6, 2023
d99cdc9
towards-data-module: trees.scala moved to sigma.ast
aslesarenko Oct 6, 2023
fb12391
towards-data-module: transformers.scala moved to sigma.ast
aslesarenko Oct 6, 2023
5e298d1
towards-data-module: serializers moved to sigma package
aslesarenko Oct 6, 2023
dc5c693
towards-data-module: more ops moved to sigma.ast package
aslesarenko Oct 6, 2023
061629c
towards-data-module: Fold.sum moved to tests
aslesarenko Oct 6, 2023
b903cd5
towards-data-module: move some crypto to sigma.crypto
aslesarenko Oct 7, 2023
19381c1
towards-data-module: Overloading.scala moved to sigma.utils
aslesarenko Oct 7, 2023
f3517ed
towards-data-module: SparseArrayContainer.scala moved to sigma.utils
aslesarenko Oct 7, 2023
9be3489
towards-data-module: ValueOps moved to sigma.ast.defs
aslesarenko Oct 7, 2023
bf2d61f
towards-data-module: Terms.scala removed and the contents moved to si…
aslesarenko Oct 7, 2023
19bca73
towards-data-module: SigmaExceptions.scala moved to sigma.exceptions
aslesarenko Oct 7, 2023
95f1749
towards-data-module: SigmaBuilder, SigmaPredef, SourceContext moved t…
aslesarenko Oct 7, 2023
935fcf5
towards-data-module: CostItem, InterpreterReflection, DataValueCompar…
aslesarenko Oct 7, 2023
5b4c0fb
towards-data-module: exceptions moved to sigma.exception
aslesarenko Oct 7, 2023
9fd2386
towards-data-module: remove dependence on Interpreter
aslesarenko Oct 7, 2023
3239444
towards-data-module: moved to sigma.data
aslesarenko Oct 8, 2023
8c9d672
towards-data-module: Exceptions.scala moved to sigma.exceptions
aslesarenko Oct 8, 2023
523051a
towards-data-module: BigInt moved to sigma.exceptions
aslesarenko Oct 8, 2023
2a77625
towards-data-module: SigmaDsl moved to sigma.eval
aslesarenko Oct 8, 2023
cd088ca
towards-data-module: some Extensions moved to sigma.eval
aslesarenko Oct 8, 2023
3027599
towards-data-module: ensureTypeCarringValue moved to sigma.eval
aslesarenko Oct 8, 2023
7c37b92
towards-data-module: rename CErgoTreeEvaluator
aslesarenko Oct 8, 2023
f758de7
towards-data-module: replace CErgoTreeEvaluator with ErgoTreeEvaluator
aslesarenko Oct 9, 2023
1331a44
towards-data-module: moved EvalSettings.scala to sigma.eval
aslesarenko Oct 9, 2023
034530c
towards-data-module: introduced Profiler
aslesarenko Oct 9, 2023
8f45459
towards-data-module: CAvlTreeVerifier
aslesarenko Oct 9, 2023
6b7201c
towards-data-module: AvlTreeVerifier abstraction
aslesarenko Oct 9, 2023
f509f2f
towards-data-module: sigmastate.Platform moved to sigma package
aslesarenko Oct 11, 2023
f4dadd4
towards-data-module: `sigma` package moved to `data` module
aslesarenko Oct 11, 2023
b0bf543
towards-data-module: js.ErgoTree moved to `data` module
aslesarenko Oct 11, 2023
0b9279e
Merge pull request #920 from ScorexFoundation/ergotree-version
aslesarenko Oct 21, 2023
3435531
Merge pull request #917 from ScorexFoundation/core-serializers2
aslesarenko Oct 21, 2023
af2cb8f
towards-data-module: moved AvlTree operations to CErgoTreeEvaluator
aslesarenko Oct 21, 2023
7b6659d
towards-data-module: added missing ScalaDocs
aslesarenko Oct 21, 2023
0ef3efa
towards-data-module: added missing ScalaDocs (2)
aslesarenko Oct 24, 2023
bd606fc
towards-data-module: added missing ScalaDocs (3)
aslesarenko Oct 24, 2023
0c2e59a
towards-data-module: def isProven extension method removed
aslesarenko Oct 28, 2023
2630ed8
towards-data-module: renamed sigmastate.lang.syntax -> sigmastate.lan…
aslesarenko Oct 28, 2023
aae4118
towards-data-module: renamed defs -> syntax
aslesarenko Oct 28, 2023
77623d2
towards-data-module: ScalaDocs for sigma.ast.syntax methods
aslesarenko Oct 28, 2023
b5c5dbb
towards-data-module: cleanup code, more ScalaDocs
aslesarenko Oct 28, 2023
90c51a0
Merge pull request #924 from ScorexFoundation/towards-data-module
aslesarenko Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
78 changes: 42 additions & 36 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import scala.language.postfixOps
import scala.sys.process._
import org.scalajs.linker.interface.CheckedBehavior
import scala.sys.process.*
import org.scalajs.linker.interface.{CheckedBehavior, ModuleSplitStyle}

organization := "org.scorexfoundation"

Expand Down Expand Up @@ -196,7 +196,12 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
scorexUtilDependency,
publish / skip := true
)
.jvmSettings( crossScalaSettings )
.jvmSettings(
crossScalaSettings,
libraryDependencies ++= Seq(
bouncycastleBcprov
)
)
.jsSettings(
crossScalaSettingsJS,
scalacOptions ++= Seq(
Expand All @@ -212,10 +217,40 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
)
lazy val coreJS = core.js
.enablePlugins(ScalaJSBundlerPlugin)
.enablePlugins(ScalablyTypedConverterGenSourcePlugin)
.settings(
stOutputPackage := "sigmastate",
scalaJSLinkerConfig ~= { conf =>
conf.withSourceMap(false)
.withModuleKind(ModuleKind.CommonJSModule)
},
Compile / npmDependencies ++= Seq(
"sigmajs-crypto-facade" -> sigmajsCryptoFacadeVersion,
"@fleet-sdk/common" -> "0.1.3"
)
)

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

lazy val interpreter = crossProject(JVMPlatform, JSPlatform)
.in(file("interpreter"))
.dependsOn(core % allConfigDependency)
.dependsOn(core % allConfigDependency, data % allConfigDependency)
.settings(
commonSettings ++ testSettings2,
commonDependenies2,
Expand All @@ -226,24 +261,10 @@ lazy val interpreter = crossProject(JVMPlatform, JSPlatform)
.jvmSettings( crossScalaSettings )
.jsSettings(
crossScalaSettingsJS,
libraryDependencies ++= Seq (
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0"
),
useYarn := true
)
lazy val interpreterJS = interpreter.js
.enablePlugins(ScalaJSBundlerPlugin)
.enablePlugins(ScalablyTypedConverterGenSourcePlugin)
.settings(
stOutputPackage := "sigmastate",
scalaJSLinkerConfig ~= { conf =>
conf.withSourceMap(false)
},
Compile / npmDependencies ++= Seq(
"sigmajs-crypto-facade" -> sigmajsCryptoFacadeVersion,
"@fleet-sdk/common" -> "0.1.3"
)
)

lazy val parsers = crossProject(JVMPlatform, JSPlatform)
.in(file("parsers"))
Expand All @@ -260,9 +281,6 @@ lazy val parsers = crossProject(JVMPlatform, JSPlatform)
)
.jsSettings(
crossScalaSettingsJS,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0"
),
useYarn := true
)
lazy val parsersJS = parsers.js
Expand All @@ -271,14 +289,11 @@ lazy val parsersJS = parsers.js
scalaJSLinkerConfig ~= { conf =>
conf.withSourceMap(false)
},
Compile / npmDependencies ++= Seq(
"sigmajs-crypto-facade" -> sigmajsCryptoFacadeVersion
)
)

lazy val sdk = crossProject(JVMPlatform, JSPlatform)
.in(file("sdk"))
.dependsOn(core % allConfigDependency, interpreter % allConfigDependency, parsers % allConfigDependency)
.dependsOn(core % allConfigDependency, data % allConfigDependency, interpreter % allConfigDependency, parsers % allConfigDependency)
.settings(commonSettings ++ testSettings2,
commonDependenies2,
testingDependencies2,
Expand All @@ -290,9 +305,6 @@ lazy val sdk = crossProject(JVMPlatform, JSPlatform)
)
.jsSettings(
crossScalaSettingsJS,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0"
),
useYarn := true
)
lazy val sdkJS = sdk.js
Expand All @@ -302,9 +314,6 @@ lazy val sdkJS = sdk.js
conf.withSourceMap(false)
.withModuleKind(ModuleKind.CommonJSModule)
},
Compile / npmDependencies ++= Seq(
"sigmajs-crypto-facade" -> sigmajsCryptoFacadeVersion
)
)

lazy val sc = crossProject(JVMPlatform, JSPlatform)
Expand Down Expand Up @@ -348,20 +357,17 @@ lazy val scJS = sc.js
.withArrayIndexOutOfBounds(CheckedBehavior.Compliant)
)
},
Compile / npmDependencies ++= Seq(
"sigmajs-crypto-facade" -> sigmajsCryptoFacadeVersion
)
)


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

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

lazy val rootSettings = Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package sigmastate.crypto
package sigma.crypto

import sigma.data.RType
import scorex.util.encode.Base16
import sigmastate._
import sigma.Coll
import sigma._
import sigma.ast._

import java.math.BigInteger
import scala.scalajs.js
Expand Down Expand Up @@ -128,7 +129,7 @@ object Platform {
class Curve

// TODO JS: Use JS library for secure source of randomness
type SecureRandom = sigmastate.crypto.SecureRandomJS
type SecureRandom = sigma.crypto.SecureRandomJS

/** Opaque point type. */
@js.native
Expand Down Expand Up @@ -184,28 +185,28 @@ object Platform {
private val ctx = new CryptoContextJs

/** The underlying elliptic curve descriptor. */
override def curve: crypto.Curve = ???
override def curve: Curve = ???

override def fieldCharacteristic: BigInteger = Convert.bigIntToBigInteger(ctx.getModulus())

override def order: BigInteger = Convert.bigIntToBigInteger(ctx.getOrder())

override def validatePoint(x: BigInteger, y: BigInteger): crypto.Ecp = {
override def validatePoint(x: BigInteger, y: BigInteger): Ecp = {
val point = ctx.validatePoint(Convert.bigIntegerToBigInt(x), Convert.bigIntegerToBigInt(y))
new Ecp(point)
}

override def infinity(): crypto.Ecp =
override def infinity(): Ecp =
new Ecp(ctx.getInfinity())

override def decodePoint(encoded: Array[Byte]): crypto.Ecp = {
override def decodePoint(encoded: Array[Byte]): Ecp = {
if (encoded(0) == 0) {
return infinity()
}
new Ecp(ctx.decodePoint(Base16.encode(encoded)))
}

override def generator: crypto.Ecp =
override def generator: Ecp =
new Ecp(ctx.getGenerator())
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sigmastate.crypto
package sigma.crypto

import debox.cfor

Expand Down
50 changes: 50 additions & 0 deletions core/js/src/main/scala/sigma/js/AvlTree.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package sigma.js

import sigma.Extensions.ArrayOps
import sigma.data.Iso.{isoStringToArray, isoStringToColl}
import sigma.data.{AvlTreeData, AvlTreeFlags, CAvlTree, Iso}

import scala.scalajs.js
import scala.scalajs.js.UndefOr
import scala.scalajs.js.annotation.JSExportTopLevel

/** Equivalent of [[sigma.AvlTree]] available from JS. */
@JSExportTopLevel("AvlTree")
class AvlTree(
val digest: String,
val insertAllowed: Boolean,
val updateAllowed: Boolean,
val removeAllowed: Boolean,
val keyLength: Int,
val valueLengthOpt: UndefOr[Int]
) extends js.Object

object AvlTree {

implicit val isoAvlTree: Iso[AvlTree, sigma.AvlTree] = new Iso[AvlTree, sigma.AvlTree] {
override def to(x: AvlTree): sigma.AvlTree = {
CAvlTree(
AvlTreeData(
digest = isoStringToArray.to(x.digest).toColl,
treeFlags = AvlTreeFlags(x.insertAllowed, x.updateAllowed, x.removeAllowed),
x.keyLength,
valueLengthOpt = sigma.js.Isos.isoUndefOr(Iso.identityIso[Int]).to(x.valueLengthOpt),
),
)
}

override def from(x: sigma.AvlTree): AvlTree = {
val tree = x.asInstanceOf[CAvlTree]
val data = tree.treeData
new AvlTree(
digest = isoStringToColl.from(tree.digest),
insertAllowed = data.treeFlags.insertAllowed,
updateAllowed = data.treeFlags.updateAllowed,
removeAllowed = data.treeFlags.removeAllowed,
keyLength = data.keyLength,
valueLengthOpt = sigma.js.Isos.isoUndefOr(Iso.identityIso[Int]).from(data.valueLengthOpt),
)
}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.ergoplatform.sdk.js
package sigma.js

import sigmastate.crypto.{CryptoFacade, CryptoFacadeJs, Ecp, Platform}
import sigmastate.eval.Extensions.ArrayByteOps
import sigma.Extensions.CoreArrayByteOps
import sigma.crypto.{CryptoFacade, CryptoFacadeJs, Ecp, Platform}

import scala.scalajs.js
import scala.scalajs.js.annotation.JSExportTopLevel
Expand Down
29 changes: 29 additions & 0 deletions core/js/src/main/scala/sigma/js/Isos.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package sigma.js

import sigma.{Coll, Colls}
import sigma.data.{Iso, RType}

import scala.reflect.ClassTag
import scala.scalajs.js
import scala.scalajs.js.JSConverters.JSRichOption

object Isos {

implicit def isoUndefOr[A, B](implicit iso: Iso[A, B]): Iso[js.UndefOr[A], Option[B]] = new Iso[js.UndefOr[A], Option[B]] {
override def to(x: js.UndefOr[A]): Option[B] = x.toOption.map(iso.to)
override def from(x: Option[B]): js.UndefOr[A] = x.map(iso.from).orUndefined
}

implicit def isoArrayToColl[A, B](iso: Iso[A, B])
(implicit ctA: ClassTag[A], tB: RType[B]): Iso[js.Array[A], Coll[B]] = new Iso[js.Array[A], Coll[B]] {
override def to(x: js.Array[A]): Coll[B] = Colls.fromArray(x.map(iso.to).toArray(tB.classTag))
override def from(x: Coll[B]): js.Array[A] = js.Array(x.toArray.map(iso.from): _*)
}

implicit def isoArrayToIndexed[A, B](iso: Iso[A, B])
(implicit cB: ClassTag[B]): Iso[js.Array[A], IndexedSeq[B]] = new Iso[js.Array[A], IndexedSeq[B]] {
override def to(x: js.Array[A]): IndexedSeq[B] = x.map(iso.to).toArray(cB).toIndexedSeq
override def from(x: IndexedSeq[B]): js.Array[A] = js.Array(x.map(iso.from): _*)
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.ergoplatform.sdk.js
package sigma.js

import sigmastate.Values.SigmaBoolean
import sigmastate.crypto.DLogProtocol.ProveDlog
import sigma.data.{ProveDlog, SigmaBoolean}

import scala.scalajs.js
import scala.scalajs.js.annotation.JSExportTopLevel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.ergoplatform.sdk.js
package sigma.js

import sigma.data.RType

Expand All @@ -10,7 +10,7 @@ import scala.scalajs.js.annotation.JSExportTopLevel
* wrapper around {@link RType} type descriptor.
*/
@JSExportTopLevel("Type")
class Type(private[js] final val rtype: RType[_]) extends js.Object {
class Type(final val rtype: RType[_]) extends js.Object {
/** Syntactically correct type name (type expression as String) */
def name: String = rtype.name

Expand Down
Loading
Loading