Skip to content

Commit

Permalink
versioned header check
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Oct 2, 2024
1 parent 3c06856 commit 40fe947
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/jvm/src/main/scala/sigma/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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))
case h: Header if VersionContext.current.isV6SoftForkActivated => Nullable(mkConstant[SHeader.type](h, SHeader))

// todo: check UnsignedBigInt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ class SigmaBuilderTest extends AnyPropSpec with ScalaCheckPropertyChecks with Ma
property("liftToConstant Header") {
val h = TestData.h1
val c = HeaderConstant(h)
test[SHeader.type](h, c)
if (VersionContext.current.isV6SoftForkActivated) {
testSuccess(h, c)
} else {
testFailure(h)
}
testFailure(Array.fill(10)(h))
testColl[SHeader.type](h, c)
}
Expand Down

0 comments on commit 40fe947

Please sign in to comment.