From 928bc47ec2e568bc159ab0d468cb282747d9a788 Mon Sep 17 00:00:00 2001 From: Martin Minkov Date: Wed, 26 Oct 2022 16:43:27 -0700 Subject: [PATCH] Add args to the callback method invocation (#516) * Add args to the callback method invocation * Changelog --- CHANGELOG.md | 1 + src/lib/zkapp.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23d18b7416..332c71fe14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Proof verification on the web version https://github.com/o1-labs/snarkyjs/pull/476 +- Callback arguments are properly passed into method invocations https://github.com/o1-labs/snarkyjs/pull/516 ## [0.6.0](https://github.com/o1-labs/snarkyjs/compare/f2ad423...ba688523) diff --git a/src/lib/zkapp.ts b/src/lib/zkapp.ts index adb8ce0b51..34e160c08a 100644 --- a/src/lib/zkapp.ts +++ b/src/lib/zkapp.ts @@ -558,7 +558,7 @@ class Callback extends GenericArgument { // call the callback, leveraging composability (if this is inside a smart contract method) // to prove to the outer circuit that we called it - let result = (instance[methodName] as Function)(); + let result = (instance[methodName] as Function)(...args); let accountUpdate = instance.self; let callback = new Callback({