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

Candidate for 6.0.0 release #930

Open
wants to merge 301 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
301 commits
Select commit Hold shift + click to select a range
038afc7
Merge branch 'develop' of github.com:ScorexFoundation/sigmastate-inte…
kushti May 6, 2024
2ad11df
i966-template-compiler: use default values of parameters in compiler env
aslesarenko May 9, 2024
98fd5b7
i966-template-compiler: fix type of ContractParam field
aslesarenko May 9, 2024
232c25d
i966-template-compiler: fix for Scala 2.11
aslesarenko May 9, 2024
eb6270c
i966-template-compiler: create ConstantPlaceholder for each parameter…
aslesarenko May 12, 2024
6abf292
i966-template-compiler: added ErgoTreeUtils.explainTreeHeader
aslesarenko May 12, 2024
efabf24
i966-template-compiler: test ContractTemplate.applyTemplate method
aslesarenko May 12, 2024
dcee258
i966-template-compiler: more tests for CompilerTemplate.applyTemplate
aslesarenko May 12, 2024
ba6abad
i966-template-compiler: fix ErgoTreeUtilsSpec
aslesarenko May 12, 2024
28f7e15
i966-template-compiler: addressed review comments
aslesarenko May 12, 2024
8af5260
Merge pull request #977 from ScorexFoundation/i966-template-compiler
aslesarenko May 12, 2024
4004cc9
i486-toBytes: tests added to SigmaTyperTest
aslesarenko May 14, 2024
b55d336
i486-toBytes: ExactNumeric.toBytes implemented
aslesarenko May 14, 2024
9d83125
Merge branch 'develop' into i486-toBytes
aslesarenko May 14, 2024
d6efd22
v6.0.0-fix-tests: necessary changes due to MaxSupportedVersion upgrade
aslesarenko May 14, 2024
e865264
Merge remote-tracking branch 'origin/v6.0.0-fix-tests' into i486-toBytes
aslesarenko May 14, 2024
302b09d
refactor-ir-cake: removed Library trait (merged with Scalan)
aslesarenko May 14, 2024
f0c34e6
Merge pull request #985 from ScorexFoundation/v6.0.0-fix-tests
kushti May 14, 2024
3ffafe7
refactor-ir-cake: removed SigmaLibrary.scala
aslesarenko May 15, 2024
30d3bd9
refactor-ir-cake: Scalan moved to sigma.compiler package
aslesarenko May 15, 2024
bd0feb0
refactor-ir-cake: IRContext moved to sigma.compiler
aslesarenko May 15, 2024
f4bd542
refactor-ir-cake: everything is assembled in Scalan cake
aslesarenko May 15, 2024
26da1fa
refactor-ir-cake: Scalan renamed to IRContext
aslesarenko May 15, 2024
9c9ddc5
refactor-ir-cake: `staged` package removed
aslesarenko May 16, 2024
291f255
refactor-ir-cake: IR classes moved to sigma.compiler.ir package
aslesarenko May 16, 2024
7247cf8
refactor-ir-cake: move classes around in sigma.compiler.ir
aslesarenko May 16, 2024
80114f1
refactor-ir-cake: SigmaCompiler moved to sigma.compiler package
aslesarenko May 16, 2024
66daf52
refactor-ir-cake: wrappers moved to sigma.compiler.ir.wrappers package
aslesarenko May 16, 2024
baab0a8
refactor-ir-cake: wrappers moved to sigma.compiler.ir.wrappers packag…
aslesarenko May 16, 2024
7c18eef
refactor-ir-cake: wrappers moved to sigma.compiler.ir.wrappers packag…
aslesarenko May 16, 2024
3dd55aa
refactor-ir-cake: SizeOf, CostOf removed from IR + more ScalaDocs
aslesarenko May 16, 2024
f56df6a
refactor-ir-cake: removed WSpecialPredefs.scala
aslesarenko May 16, 2024
318c05b
Merge branch 'refs/heads/refactor-ir-cake' into v6.0.0-refactor-ir-cake
aslesarenko May 16, 2024
d4ff7b5
Merge remote-tracking branch 'refs/remotes/origin/v6.0.0-refactor-ir-…
aslesarenko May 16, 2024
c1d3ce1
v6.0-serialize: SigmaDslBuilder.serialize added SMethod declaration
aslesarenko May 16, 2024
eeb0d4a
v6.0-serialize: added SMethod.runtimeTypeArgs
aslesarenko May 17, 2024
5cbd065
v6.0-serialize: support of explicitTypeArgs in MethodCallSerializer
aslesarenko May 17, 2024
3f4508a
v6.0-serialize: SigmaParserTest for serialize()
aslesarenko May 17, 2024
12a958c
Option[T] (de)serialization
kushti May 17, 2024
4f2fb23
versioning and tests
kushti May 17, 2024
06386d4
v6.0-serialize: SigmaBinderTest and SigmaTyperTest
aslesarenko May 17, 2024
f7beab4
v6.0-serialize: refactor SigmaDslSpecification towards LanguageSpecif…
aslesarenko May 17, 2024
cfd6e7b
v6.0-serialize: feature tests for Byte an Short
aslesarenko May 19, 2024
4fb3daa
v6.0-serialize: all new features move to LanguageSpecificationV6
aslesarenko May 19, 2024
553bee8
refactor-ir-cake: add ScalaDoc
aslesarenko May 21, 2024
2b72e1a
Merge pull request #986 from ScorexFoundation/refactor-ir-cake
aslesarenko May 21, 2024
a63631f
Merge remote-tracking branch 'refs/remotes/origin/develop' into v6.0.…
aslesarenko May 21, 2024
d09d735
i994-fix-subst-constants: implementation + tests
aslesarenko May 22, 2024
d4bbccc
v6.0-serialize: fix JS tests (added reflection data)
aslesarenko May 23, 2024
9e312bb
Merge remote-tracking branch 'refs/remotes/origin/v6.0-serialize' int…
aslesarenko May 23, 2024
de18eeb
i994-fix-subst-constants: more tests
aslesarenko May 23, 2024
727be9b
Merge remote-tracking branch 'refs/remotes/origin/i994-fix-subst-cons…
aslesarenko May 23, 2024
3ccf11e
i486-toBytes: fixes after merge
aslesarenko May 23, 2024
e5a32c8
i486-toBytes: Versioned.scala added
aslesarenko May 25, 2024
bba2230
i486-toBytes: ensure VersionContext.current in tests
aslesarenko May 25, 2024
dc361a1
i486-toBytes: ErgoTreeSpecification versioned and updated
aslesarenko May 25, 2024
70786a0
i486-toBytes: clarified description of demotion of SNumericType
aslesarenko May 25, 2024
c76ac1a
i486-toBytes: GraphBuilding to handle numeric methods
aslesarenko May 25, 2024
2427db3
i486-toBytes: added userDefinedInvoke handler to SMethod
aslesarenko May 25, 2024
02e2d06
i486-toBytes: toBigEndianBytes implemented
aslesarenko May 25, 2024
2e23a2c
v6.0-serialize: CheckMinimalErgoTreeVersion rule removed
aslesarenko May 28, 2024
fe68c66
v6.0-serialize: cleanup + ScalaDocs
aslesarenko May 28, 2024
a5321af
v6.0-serialize: added CoreByteWriter.checkCostLimit
aslesarenko May 28, 2024
3fe08a0
Merge pull request #987 from ScorexFoundation/v6.0.0-refactor-ir-cake
kushti May 29, 2024
432addc
v6.0-serialize: cost accumulation in SigmaByteWriter and serialize_ev…
aslesarenko May 29, 2024
97377c2
v6.0-serialize: cleanup + ScalaDocs
aslesarenko Jun 3, 2024
b78ff7a
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Jun 3, 2024
bc71b2f
todo removed, tests improved
kushti Jun 3, 2024
767fbb4
v6.0-serialize: tests for cost trace
aslesarenko Jun 3, 2024
ea91fae
Some(None) test
kushti Jun 3, 2024
fd8e5d7
i994-fix-subst-constants: cleanup + ScalaDocs
aslesarenko Jun 3, 2024
2baf8ca
Merge pull request #990 from ScorexFoundation/i659
kushti Jun 3, 2024
66003f4
merging w. 6.0.0
kushti Jun 4, 2024
7795e5d
remove non-PR related code, improved DataSerializerSpecification
kushti Jun 4, 2024
d6e1bec
merging w. 6.0.0
kushti Jun 5, 2024
361c7a4
merging with i969, removing BouncyCastle dep from Autolykos2PowValida…
kushti Jun 5, 2024
d01469c
fixing and improving tests
kushti Jun 4, 2024
07945e9
fixing DataJsonEncoder
kushti Jun 5, 2024
15de2e2
merging i969
kushti Jun 5, 2024
17f5eb6
CHeader from i969
kushti Jun 5, 2024
fd8d6eb
checkPow cost
kushti Jun 5, 2024
928d8cb
LangSpec.md update
kushti Jun 5, 2024
0478069
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Jun 6, 2024
07b8644
moving newFeature related code from serializePR
kushti Jun 6, 2024
e2faf71
merging with newfeature pr
kushti Jun 6, 2024
37ac921
BasicOpsSpecification tests for serialize
kushti Jun 6, 2024
074d609
MethodCall deserialization round trip for Global.serialize
kushti Jun 6, 2024
bf53a6b
spam tests, test for serialize(long) producing different result from …
kushti Jun 6, 2024
93a100f
merging w. v6.0-newFeature
kushti Jun 7, 2024
91a9729
removing serialize from tests
kushti Jun 7, 2024
dd7bdc6
removing serialize
kushti Jun 7, 2024
4b27c86
merging w. 6.0-newfeature
kushti Jun 7, 2024
e1bfb1c
remove serialize from GraphBuilding and ErgoTreeSpecification
kushti Jun 7, 2024
15e21a4
importing new test for ErgoTreeSpecification from i486
kushti Jun 7, 2024
e7bd2a3
moving newFeature related code from serializePR
aslesarenko Jun 6, 2024
11777ef
MethodCall new functionality extraction from i486
aslesarenko Jun 7, 2024
17ab381
Merge pull request #1001 from ScorexFoundation/v6.0-newfeature
kushti Jun 9, 2024
33033fc
importing CheckMinimalErgoTreeVersion from i994
kushti Jun 10, 2024
a5406ef
merging w. 6.0.0, serialize removed
kushti Jun 10, 2024
d7fd8e1
merging w. 6.0.0
kushti Jun 10, 2024
312167b
merging w. 6.0.0
kushti Jun 10, 2024
81f285b
mrging w.6.0.0
kushti Jun 10, 2024
ca3bde4
merging w/ 6.0.0
kushti Jun 10, 2024
76f1a90
merging w. 969
kushti Jun 10, 2024
01ede1c
MethodCallSerializerSpecification fix
kushti Jun 10, 2024
40d5e54
relaxed check in check pow test before activation
kushti Jun 10, 2024
df4b0b9
failing test
kushti Jun 10, 2024
e7a1aaf
removing more serialize artefacts and HeaderTypeOps
kushti Jun 11, 2024
38d8969
bigint downcasting fix
kushti Jun 11, 2024
11b9cf3
BigInt.down- and upcast to self fixed
kushti Jun 11, 2024
dd62bd7
failing tests
kushti Jun 11, 2024
aaef77e
close #906: lazy evaluation of default in Option.getOrElse and Coll.g…
kushti Jun 11, 2024
a8234b9
review comments addressed
kushti Jun 12, 2024
7ccce9a
distinct and reverse (w. no costing)
kushti Jun 12, 2024
2fa224b
startsWith and endsWith
kushti Jun 12, 2024
b17c8c8
get
kushti Jun 12, 2024
fc3be57
non-execution of get_eval todo
kushti Jun 12, 2024
f7f31e3
fix w/out tests (only manual tests are done)
kushti Jun 13, 2024
62fd2a3
initial stub and roundtrip test with longToByteArray
kushti Jun 17, 2024
8bcc1ef
impl and tests done without costing etc
kushti Jun 18, 2024
b7e2a38
first failing test
kushti Jun 19, 2024
828ba27
passing test from getVar from another input
kushti Jun 27, 2024
b80ef29
invalid tests
kushti Jun 28, 2024
6a3cbac
initial failing test & impl
kushti Jun 29, 2024
af92a3f
test passing
kushti Jun 29, 2024
a731962
simplifying the code
kushti Jul 5, 2024
cb7e262
initial toBits failing tests
kushti Jul 6, 2024
f577fd3
passing test (compilation fixed)
kushti Jul 8, 2024
cadf53d
tests for Byte and BigInt
kushti Jul 8, 2024
81ed008
Merge branch 'i486-toBytes' of github.com:ScorexFoundation/sigmastate…
kushti Jul 8, 2024
ee59083
Byte.toBits test passing
kushti Jul 8, 2024
3fde5fa
toBits tests for Long and BigInt(failing)
kushti Jul 8, 2024
9ea7597
BigInt.toBits test passing
kushti Jul 8, 2024
be77315
bitwise inversion
kushti Jul 9, 2024
a575d38
bitwiseInverse tests for Long and Byte
kushti Jul 9, 2024
7ff3542
bitwise or impl
kushti Jul 10, 2024
868fbb1
bitwiseAnd
kushti Jul 10, 2024
f21436d
bitwiseXor
kushti Jul 10, 2024
ced229f
shiftLeft
kushti Jul 11, 2024
9519ef6
shiftRight
kushti Jul 16, 2024
7f3a33c
extending tests in LanguageSpecificationV6
kushti Jul 24, 2024
271ec30
Merge pull request #1007 from ScorexFoundation/i877
kushti Jul 24, 2024
793af1b
merging w. 6.0
kushti Jul 26, 2024
1271a79
ScalaDoc for headerDecoder
kushti Jul 26, 2024
b677b18
merging w. i969
kushti Jul 26, 2024
e501a8b
polishing, LSV6 test
kushti Jul 26, 2024
8f9b549
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Jul 30, 2024
4c63a60
LSV5 & LSV6 tests
kushti Jul 30, 2024
89f2df6
checkPoW added to collectMethods
kushti Jul 31, 2024
61f90cd
assertEXceptionThrown
kushti Jul 31, 2024
ba878b8
fixing GraphIRReflection for checkPow, test for isoHeader for known v…
kushti Jul 31, 2024
b41d16c
test vectors for Blake2b256 and Long -> BigInt
kushti Jul 31, 2024
c2788b4
fixing checkPow test in JS
kushti Aug 1, 2024
26809c9
passing but improper changedFeature test
kushti Aug 2, 2024
eb219dd
merging w. 6.0.0
kushti Aug 2, 2024
bfd1049
yarn.lock added to .gitignore
kushti Aug 2, 2024
8133fad
yarn.lock removed
kushti Aug 2, 2024
6f509f9
Merge branch 'SethDusek-develop' into v6.0.0
kushti Aug 2, 2024
962a484
merging w. 6.0.0 , set tree size flag for trees v0 in SigmaDslTesting…
kushti Aug 3, 2024
04f6fee
test for substConstants with 5 elems
kushti Aug 4, 2024
f851b62
LSV5 fix
kushti Aug 5, 2024
3f7e784
Scala 2.11 compilation fix, ScalaDoc returned
kushti Aug 5, 2024
75a1fdb
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Aug 5, 2024
8b17643
fixed regression in CrossVersionProps
kushti Aug 5, 2024
b6aad2c
userDefinedInvoke ScalaDoc
kushti Aug 5, 2024
2a3c72d
Merge pull request #995 from ScorexFoundation/i994-fix-subst-constants
kushti Aug 5, 2024
17c3e6b
mrging w. 6.0.0
kushti Aug 5, 2024
2cfd2ff
Merge pull request #1002 from ScorexFoundation/v6.0-methodcall
kushti Aug 6, 2024
2e3db09
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Aug 6, 2024
e7fde10
versioned execution depending on tree version, newFeature test
kushti Aug 6, 2024
fed22d6
merging w. 6.0.0, AutolykosSolution eq and hashcode
kushti Aug 6, 2024
04eb6aa
Merge branch 'i969' of github.com:ScorexFoundation/sigmastate-interpr…
kushti Aug 6, 2024
57ba522
merging w. 6.0.0
kushti Aug 8, 2024
8da3575
fixed tests in LSV6
kushti Aug 9, 2024
ea0890b
tree versioning removed, scaladoc
kushti Aug 12, 2024
26f92f1
merging w. 6.0.0
kushti Aug 12, 2024
12e888d
scala 2.11 compilation fix
kushti Aug 12, 2024
b0fbfbb
fixing getVar typing during tree building, simpler execution for getV…
kushti Aug 13, 2024
65144a9
merging w. 6.0.0
kushti Aug 13, 2024
49a393c
merged w. 6.0.0
kushti Aug 19, 2024
649069b
fixed cost, improved args list for SigmaDslBuilder.fromBigEndianBytes
kushti Aug 19, 2024
3037f1a
merging w 6.0.0, fixing ErgoTreeSpec
kushti Aug 27, 2024
016262b
removing unused SNumericTypeMethods.getMethods
kushti Aug 27, 2024
5063bae
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Aug 27, 2024
acb76c9
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Aug 27, 2024
877ed78
adding new methods to GraphIRReflection
kushti Aug 30, 2024
a988d90
Merge pull request #972 from ScorexFoundation/i969
kushti Sep 2, 2024
2cd57e1
Merge pull request #968 from ScorexFoundation/i958-2
kushti Sep 2, 2024
baef87f
more efficient toBits impl
kushti Sep 2, 2024
c7918ad
merging v6.0.0
kushti Sep 2, 2024
8208dd8
Box.getReg with computable index
kushti Sep 3, 2024
05c9e67
merging w. 6.0.0
kushti Sep 3, 2024
8e46b69
Merge pull request #1015 from ScorexFoundation/i416
kushti Sep 3, 2024
b068b10
Serialize SFunc in TypeSerializer
kushti Sep 3, 2024
1990030
Merge pull request #1020 from ScorexFoundation/i847
kushti Sep 3, 2024
5a983b3
merging w. 6.0.0
kushti Sep 3, 2024
2e8d8f4
optimizing imports, polishing
kushti Sep 3, 2024
d284f79
fixing post-merging failing test
kushti Sep 3, 2024
0c674fe
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Sep 4, 2024
ed5b8f5
fixing SigmaTyperTest
kushti Sep 4, 2024
b2de9cf
scaladoc
kushti Sep 6, 2024
eccc9ca
6.0 methods for Byte in LSV6
kushti Sep 10, 2024
f566b7b
6.0 methods for Short in LSV6
kushti Sep 10, 2024
8cf4264
6.0 methods for Int in LSV6
kushti Sep 10, 2024
fa2c2df
Long tests in LSV6, shift check in shiftRight
kushti Sep 11, 2024
48db432
shiftLeft/shiftRight shift limit
kushti Sep 11, 2024
a2f3030
bigint - LSV6 tests
kushti Sep 11, 2024
297265f
arg descs, 2.11 comp fix, BOS tests fixed
kushti Sep 12, 2024
f20635e
merging w v6.0.0
kushti Sep 13, 2024
7e3b676
fixing method calls check test
kushti Sep 16, 2024
55d03cd
addressing review comments
kushti Sep 16, 2024
4343bc9
fix for longToByteArray support in JS
kushti Sep 17, 2024
5f0c5c5
scaladoc improvements, Ints.toBits
kushti Sep 20, 2024
3d88fc2
Merge pull request #1017 from ScorexFoundation/i1006
kushti Sep 20, 2024
9c310c7
merging w. 6.0.0
kushti Sep 20, 2024
f5feee5
Merge pull request #989 from ScorexFoundation/v6.0-serialize
kushti Sep 20, 2024
43db8df
scrypto 3.0.0
kushti Sep 23, 2024
9fd499a
merging w. 6.0.0
kushti Sep 24, 2024
8136c8f
new methods added to ReflectionData
kushti Sep 24, 2024
1999a2a
merging w. 6.0.0
kushti Sep 26, 2024
586aadd
LSV6 tests, predefined method
kushti Sep 26, 2024
2cdc34e
fixing JS tests
kushti Sep 26, 2024
d738ac5
fixing JS tests
kushti Sep 27, 2024
1989d19
LSV6 tests
kushti Sep 27, 2024
8f45909
merging w 6.0.0
kushti Sep 27, 2024
6459b07
fix ErgoTreeSpec
kushti Sep 27, 2024
ee35792
merging w. 6.0.0
kushti Sep 29, 2024
a3f25ef
LSV6 tests
kushti Sep 30, 2024
f24e9ad
predefined fn, LangSpec notes, polishing PR
kushti Sep 30, 2024
166c261
merging w. 6.0.0
kushti Sep 30, 2024
edc91ba
tests
kushti Sep 30, 2024
af792b5
addressing review comments
kushti Oct 1, 2024
6fa801c
Merge pull request #1013 from ScorexFoundation/i993
kushti Oct 1, 2024
e052255
merging w. 6.0.0
kushti Oct 3, 2024
d8fab5e
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Oct 3, 2024
5c4ccf1
merging w. 6.0.0
kushti Oct 3, 2024
1d47d5f
addressing review comments
kushti Oct 7, 2024
83ba4a4
Merge pull request #1010 from ScorexFoundation/i1004
kushti Oct 7, 2024
11d869f
merging w. 6.0.0
kushti Oct 7, 2024
29ed83a
Merge branch 'v6.0.0' of github.com:ScorexFoundation/sigmastate-inter…
kushti Oct 8, 2024
f151e1d
merging w. 6.0.0
kushti Oct 8, 2024
5cabedd
equalsPairCollWithCollOverArray
kushti Oct 18, 2024
571e721
Merge pull request #1011 from ergoplatform/i909
kushti Oct 18, 2024
c21ed63
Merge pull request #1008 from ergoplatform/i906
kushti Oct 21, 2024
35fe87a
merging w. 6.0.0
kushti Oct 21, 2024
9036aec
improving tests in BasicOpsSpecification, type test for getVarFromInput
kushti Oct 21, 2024
8ae51e4
split in LSV6
kushti Oct 21, 2024
1fbd4e5
Update docs/LangSpec.md
kushti Oct 24, 2024
208a191
Update docs/LangSpec.md
kushti Oct 24, 2024
b074b28
Merge pull request #1016 from ergoplatform/i978
kushti Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*.fdb_latexmk
*.gz

yarn.lock
*.log
yarn.lock
docs/spec/out/
test-out/
flamegraphs/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This library is
on Maven repository and can be added to the SBT configuration of Scala project.

```scala
libraryDependencies += "org.scorexfoundation" %% "sigma-state" % "5.0.14"
libraryDependencies += "org.scorexfoundation" %% "sigma-state" % "6.0.0"
```

## Repository Organization
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ ThisBuild / dynverSeparator := "-"

val bouncycastleBcprov = "org.bouncycastle" % "bcprov-jdk15on" % "1.66"

val scrypto = "org.scorexfoundation" %% "scrypto" % "2.3.0-4-a0bc6176-SNAPSHOT"
val scrypto = "org.scorexfoundation" %% "scrypto" % "3.0.0"
val scryptoDependency =
libraryDependencies += "org.scorexfoundation" %%% "scrypto" % "2.3.0-4-a0bc6176-SNAPSHOT"
libraryDependencies += "org.scorexfoundation" %%% "scrypto" % "3.0.0"

val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.2.1"
val scorexUtilDependency =
Expand Down
4 changes: 2 additions & 2 deletions core/js/src/main/scala/sigma/js/GroupElement.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sigma.js

import sigma.Extensions.CoreArrayByteOps
import scorex.util.encode.Base16
import sigma.crypto.{CryptoFacade, CryptoFacadeJs, Ecp, Platform}

import scala.scalajs.js
Expand All @@ -13,7 +13,7 @@ class GroupElement(val point: Ecp) extends js.Object {
* @see CryptoFacade.getASN1Encoding
*/
def toPointHex(): String = {
CryptoFacade.getASN1Encoding(point, true).toHex
Base16.encode(CryptoFacade.getASN1Encoding(point, true))
}
}

Expand Down
3 changes: 3 additions & 0 deletions core/js/src/main/scala/sigma/js/Isos.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import scala.reflect.ClassTag
import scala.scalajs.js
import scala.scalajs.js.JSConverters.JSRichOption

/** Definitions of isomorphisms for sigma-core module.
* @see sigma.data.Iso
*/
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]] {
Expand Down
25 changes: 25 additions & 0 deletions core/shared/src/main/scala/sigma/Colls.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ trait Coll[@specialized A] {
*/
def apply(i: Int): A

/** The element at given index or None if there is no such element. Indices start at `0`.
*
* @param i the index
* @return the element at the given index, or None if there is no such element
*/
def get(i: Int): Option[A] = {
if (isDefinedAt(i)) {
Some(apply(i))
} else {
None
}
}

/** Tests whether this $coll contains given index.
*
* The implementations of methods `apply` and `isDefinedAt` turn a `Coll[A]` into
Expand Down Expand Up @@ -76,6 +89,18 @@ trait Coll[@specialized A] {
* produces a collection ((x0, y0), ..., (xK, yK)) where K = min(N, M) */
def zip[@specialized B](ys: Coll[B]): Coll[(A, B)]

/**
* @return true if first elements of this collection form given `ys` collection, false otherwise.
* E.g. [1,2,3] starts with [1,2]
*/
def startsWith(ys: Coll[A]): Boolean

/**
* @return true if last elements of this collection form given `ys` collection, false otherwise.
* E.g. [1,2,3] ends with [2,3]
*/
def endsWith(ys: Coll[A]): Boolean

/** Tests whether a predicate holds for at least one element of this collection.
* @param p the predicate used to test elements.
* @return `true` if the given predicate `p` is satisfied by at least one element of this collection, otherwise `false`
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/sigma/Environment.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sealed abstract class Environment {

object Environment {
/** Current runtime environment. */
implicit val current: Environment = new Environment {
val current: Environment = new Environment {
override def isJVM: Boolean = runtimePlatform == RuntimePlatform.JVM
override def isJS: Boolean = runtimePlatform == RuntimePlatform.JS
override def runtimePlatform: RuntimePlatform = sigma.reflection.Platform.runtimePlatform
Expand Down
5 changes: 0 additions & 5 deletions core/shared/src/main/scala/sigma/Extensions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import sigma.data.RType
* See `implicit class ...` wrappers below.
*/
object Extensions {
/** Extension methods for `Array[Byte]` not available for generic `Array[T]`. */
implicit class CoreArrayByteOps(val arr: Array[Byte]) extends AnyVal {
/** Encodes array into hex string */
@inline def toHex: String = Base16.encode(arr)
}

/** Extension methods for `Array[T]` where implicit descriptor `RType[T]` is also
* required.
Expand Down
57 changes: 53 additions & 4 deletions core/shared/src/main/scala/sigma/SigmaDsl.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package sigma

import java.math.BigInteger
import sigma.ast.SType

import java.math.BigInteger
import sigma.data._

/**
* All `modQ` operations assume that Q is a global constant (an order of the only one cryptographically strong group
* which is used for all cryptographic operations).
* So it is globally and implicitly used in all methods.
* Functions defined for 256-bit signed integers
* */
trait BigInt {
/** Convert this BigInt value to Byte.
Expand Down Expand Up @@ -154,6 +153,22 @@ trait BigInt {
*/
def or(that: BigInt): BigInt
def |(that: BigInt): BigInt = or(that)

/**
* @return a big integer whose value is `this xor that`.
* This method returns a negative BigInteger if and only if exactly one of this and val are negative.
*/
def xor(that: BigInt): BigInt

/**
* @return a 256-bit signed integer whose value is (this << n). `n` should be in 0..255 range (inclusive).
*/
def shiftLeft(n: Int): BigInt

/**
* @return a 256-bit signed integer whose value is (this >> n). `n` should be in 0..255 range (inclusive).
*/
def shiftRight(n: Int): BigInt
}

/** Base class for points on elliptic curves. */
Expand Down Expand Up @@ -459,6 +474,23 @@ trait Header {

/** Miner votes for changing system parameters. */
def votes: Coll[Byte] //3 bytes

/** Bytes which are coming from future versions of the protocol, so
* their meaning is not known to current version of Sigma, but they
* are stored to get the same id as future version users.
*/
def unparsedBytes: Coll[Byte]

/**
* @return header bytes without proof of work, a PoW is generated over them
*/
def serializeWithoutPoW: Coll[Byte]

/**
* @return result of header's proof-of-work validation
*/
def checkPow: Boolean

}

/** Runtime representation of Context ErgoTree type.
Expand Down Expand Up @@ -557,6 +589,17 @@ trait Context {
*/
def getVar[T](id: Byte)(implicit cT: RType[T]): Option[T]

/**
* A variant of `getVar` to extract a context variable by id and type from any input
*
* @param inputIndex - input index
* @param id - context variable id
* @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
*/
def getVarFromInput[T](inputIndex: Short, id: Byte)(implicit cT: RType[T]): Option[T]

def vars: Coll[AnyValue]

/** Maximum version of ErgoTree currently activated on the network.
Expand Down Expand Up @@ -727,7 +770,13 @@ trait SigmaDslBuilder {
/** Construct a new authenticated dictionary with given parameters and tree root digest. */
def avlTree(operationFlags: Byte, digest: Coll[Byte], keyLength: Int, valueLengthOpt: Option[Int]): AvlTree

/** Serializes the given `value` into bytes using the default serialization format. */
def serialize[T](value: T)(implicit cT: RType[T]): Coll[Byte]

/** Returns a byte-wise XOR of the two collections of bytes. */
def xor(l: Coll[Byte], r: Coll[Byte]): Coll[Byte]

/** Returns a number decoded from provided big-endian bytes array. */
def fromBigEndianBytes[T](bytes: Coll[Byte])(implicit cT: RType[T]): T
}

18 changes: 15 additions & 3 deletions core/shared/src/main/scala/sigma/VersionContext.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sigma

import VersionContext.JitActivationVersion
import VersionContext.{JitActivationVersion, V6SoftForkVersion}

import scala.util.DynamicVariable

Expand All @@ -21,6 +21,10 @@ case class VersionContext(activatedVersion: Byte, ergoTreeVersion: Byte) {
/** @return true, if the activated script version of Ergo protocol on the network is
* greater than v1. */
def isJitActivated: Boolean = activatedVersion >= JitActivationVersion

/** @return true, if the activated script version of Ergo protocol on the network is
* including v6.0 update. */
def isV6SoftForkActivated: Boolean = activatedVersion >= V6SoftForkVersion
}

object VersionContext {
Expand All @@ -31,13 +35,21 @@ object VersionContext {
* - version 3.x this value must be 0
* - in v4.0 must be 1
* - in v5.x must be 2
* - in 6.x must be 3
* etc.
*/
val MaxSupportedScriptVersion: Byte = 2 // supported versions 0, 1, 2
val MaxSupportedScriptVersion: Byte = 3 // supported versions 0, 1, 2, 3

/** The first version of ErgoTree starting from which the JIT costing interpreter is used. */
/** The first version of ErgoTree starting from which the JIT costing interpreter must be used.
* It must also be used for all subsequent versions (3, 4, etc).
*/
val JitActivationVersion: Byte = 2

/**
* The version of ErgoTree corresponding to "evolution" (6.0) soft-fork
*/
val V6SoftForkVersion: Byte = 3

private val _defaultContext = VersionContext(
activatedVersion = 1 /* v4.x */,
ergoTreeVersion = 1
Expand Down
Loading
Loading