From 2a22f6daf195af3c965d50dc6b02f97d80475e6f Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Sun, 6 Oct 2024 21:59:31 +0300 Subject: [PATCH] fixing reflection data --- .../src/main/scala/sigma/reflection/ReflectionData.scala | 2 +- .../src/main/scala/sigma/compiler/ir/GraphIRReflection.scala | 3 ++- .../sigma/compiler/ir/wrappers/sigma/impl/SigmaDslImpl.scala | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/shared/src/main/scala/sigma/reflection/ReflectionData.scala b/core/shared/src/main/scala/sigma/reflection/ReflectionData.scala index b17cb83f3..0daced64c 100644 --- a/core/shared/src/main/scala/sigma/reflection/ReflectionData.scala +++ b/core/shared/src/main/scala/sigma/reflection/ReflectionData.scala @@ -454,7 +454,7 @@ object ReflectionData { mkMethod(clazz, "fromBigEndianBytes", Array[Class[_]](cColl, classOf[RType[_]])) { (obj, args) => obj.asInstanceOf[SigmaDslBuilder].fromBigEndianBytes(args(0).asInstanceOf[Coll[Byte]])(args(1).asInstanceOf[RType[_]]) }, - mkMethod(clazz, "powHit", Array[Class[_]](cColl)) { (obj, args) => + mkMethod(clazz, "powHit", Array[Class[_]](classOf[Int], cColl, cColl, cColl, classOf[Int])) { (obj, args) => obj.asInstanceOf[SigmaDslBuilder].powHit(args(0).asInstanceOf[Int], args(1).asInstanceOf[Coll[Byte]], args(2).asInstanceOf[Coll[Byte]], args(3).asInstanceOf[Coll[Byte]], args(4).asInstanceOf[Int]) } diff --git a/sc/shared/src/main/scala/sigma/compiler/ir/GraphIRReflection.scala b/sc/shared/src/main/scala/sigma/compiler/ir/GraphIRReflection.scala index ba5f8ac85..12db4b73a 100644 --- a/sc/shared/src/main/scala/sigma/compiler/ir/GraphIRReflection.scala +++ b/sc/shared/src/main/scala/sigma/compiler/ir/GraphIRReflection.scala @@ -513,7 +513,8 @@ object GraphIRReflection { mkMethod(clazz, "serialize", Array[Class[_]](classOf[Base#Ref[_]])) { (obj, args) => obj.asInstanceOf[ctx.SigmaDslBuilder].serialize(args(0).asInstanceOf[ctx.Ref[Any]]) }, - mkMethod(clazz, "powHit", Array[Class[_]](classOf[Base#Ref[_]])) { (obj, args) => + mkMethod(clazz, "powHit", Array[Class[_]](classOf[Base#Ref[_]], classOf[Base#Ref[_]], + classOf[Base#Ref[_]], classOf[Base#Ref[_]], classOf[Base#Ref[_]])) { (obj, args) => obj.asInstanceOf[ctx.SigmaDslBuilder].powHit(args(0).asInstanceOf[ctx.Ref[Int]], args(1).asInstanceOf[ctx.Ref[ctx.Coll[Byte]]], args(2).asInstanceOf[ctx.Ref[ctx.Coll[Byte]]], args(3).asInstanceOf[ctx.Ref[ctx.Coll[Byte]]], args(4).asInstanceOf[ctx.Ref[Int]]) diff --git a/sc/shared/src/main/scala/sigma/compiler/ir/wrappers/sigma/impl/SigmaDslImpl.scala b/sc/shared/src/main/scala/sigma/compiler/ir/wrappers/sigma/impl/SigmaDslImpl.scala index 535e2d2b7..95aee4fce 100644 --- a/sc/shared/src/main/scala/sigma/compiler/ir/wrappers/sigma/impl/SigmaDslImpl.scala +++ b/sc/shared/src/main/scala/sigma/compiler/ir/wrappers/sigma/impl/SigmaDslImpl.scala @@ -1981,7 +1981,7 @@ object SigmaDslBuilder extends EntityObject("SigmaDslBuilder") { override def powHit(k: Ref[Int], msg: Ref[Coll[Byte]], nonce: Ref[Coll[Byte]], h: Ref[Coll[Byte]], N: Ref[Int]): Ref[BigInt] = { asRep[BigInt](mkMethodCall(self, - SigmaDslBuilderClass.getMethod("powHit", classOf[Sym], classOf[Sym]), + SigmaDslBuilderClass.getMethod("powHit", classOf[Sym], classOf[Sym], classOf[Sym], classOf[Sym], classOf[Sym]), Array[AnyRef](k, msg, nonce, h, N), true, false, element[BigInt])) } @@ -2146,6 +2146,7 @@ object SigmaDslBuilder extends EntityObject("SigmaDslBuilder") { } def powHit(k: Ref[Int], msg: Ref[Coll[Byte]], nonce: Ref[Coll[Byte]], h: Ref[Coll[Byte]], N: Ref[Int]): Ref[BigInt] = { + println(SigmaDslBuilderClass.getDeclaredMethods().mkString(", ")) asRep[BigInt](mkMethodCall(source, SigmaDslBuilderClass.getMethod("powHit", classOf[Sym], classOf[Sym], classOf[Sym], classOf[Sym], classOf[Sym]), Array[AnyRef](k, msg, nonce, h, N),