Skip to content

Commit

Permalink
merging w. 6.0.0, Header support
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Sep 30, 2024
1 parent 19a3e7f commit 3901ba2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/jvm/src/main/scala/sigma/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ object Platform {
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 h: Header => Nullable(mkConstant[SHeader.type](h, SHeader))

// todo: check Header and UnsignedBigInt
// todo: check UnsignedBigInt

case v: String if !VersionContext.current.isV6SoftForkActivated => Nullable(mkConstant[SString.type](v, SString))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ class SigmaBuilderTest extends AnyPropSpec with ScalaCheckPropertyChecks with Ma
testColl[SGroupElement.type](v, c)
}

property("liftToConstant Header") {
val h = TestData.h1
val c = HeaderConstant(h)
test[SHeader.type](h, c)
testFailure(Array.fill(10)(h))
testColl[SHeader.type](h, c)
}

property("liftToConstant ErgoBox") {
val v = TestData.b2.asInstanceOf[CBox].wrappedValue
val c = BoxConstant(TestData.b2)
Expand Down

0 comments on commit 3901ba2

Please sign in to comment.