-
Notifications
You must be signed in to change notification settings - Fork 41
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
[6.0] Revise liftToConstant method #1021
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please see comments
case n: sigma.BigInt => Nullable(mkConstant[SBigInt.type](n, SBigInt)) | ||
case n: sigma.UnsignedBigInt => Nullable(mkConstant[SUnsignedBigInt.type](n, SUnsignedBigInt)) | ||
case ge: GroupElement => Nullable(mkConstant[SGroupElement.type](ge, SGroupElement)) | ||
case b: Boolean => Nullable(if (b) TrueLeaf else FalseLeaf) | ||
case v: String => Nullable(mkConstant[SString.type](v, SString)) | ||
case v: String if !VersionContext.current.isV6SoftForkActivated => Nullable(mkConstant[SString.type](v, SString)) | ||
case h: Header if VersionContext.current.isV6SoftForkActivated => Nullable(mkConstant[SHeader.type](h, SHeader)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PreHeader is also supported type, they usually come together everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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 v: String => Nullable(mkConstant[SString.type](v, SString)) | ||
case h: Header if VersionContext.current.isV6SoftForkActivated => Nullable(mkConstant[SHeader.type](h, SHeader)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PreHeader is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -122,6 +122,13 @@ class SigmaBuilderTest extends AnyPropSpec with ScalaCheckPropertyChecks with Ma | |||
testSuccess(arr, TransformingSigmaBuilder.mkCollectionConstant(arr, c.tpe)) | |||
} | |||
|
|||
def testArrayFailure[T <: SType] | |||
(v: T#WrappedType, c: Constant[T])(implicit t: RType[T#WrappedType]) = { | |||
// for any Byte and Short value `v`, lifting of array should succeed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't is generic enough to work for any type? Comment somewhat misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
interpreter/shared/src/test/scala/sigma/ast/SigmaBuilderTest.scala
Outdated
Show resolved
Hide resolved
…cala Co-authored-by: Alexander Slesarenko <[email protected]>
Close #905