From c3fc85fd4ace2a196bd5f7f3d2b92a4dc7ee112c Mon Sep 17 00:00:00 2001 From: oskarth Date: Sat, 11 Nov 2023 13:32:33 +0300 Subject: [PATCH] feat(ios): Add init action for keccak zkey --- .../MoproKit/KeccakZkeyViewController.swift | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mopro-ios/MoproKit/Example/MoproKit/KeccakZkeyViewController.swift b/mopro-ios/MoproKit/Example/MoproKit/KeccakZkeyViewController.swift index 803a7045..f488191b 100644 --- a/mopro-ios/MoproKit/Example/MoproKit/KeccakZkeyViewController.swift +++ b/mopro-ios/MoproKit/Example/MoproKit/KeccakZkeyViewController.swift @@ -64,8 +64,23 @@ class KeccakZkeyViewController: UIViewController { @objc func runInitAction() { // Logic for init - // TODO: Add this and call init for zkey - textView.text += "NYI: Init\n" + do { + textView.text += "Initializing library\n" + // Record start time + let start = CFAbsoluteTimeGetCurrent() + + try initializeMopro() + + // Record end time and compute duration + let end = CFAbsoluteTimeGetCurrent() + let timeTaken = end - start + + textView.text += "Initializing arkzkey took \(timeTaken) seconds.\n" + } catch let error as MoproError { + print("MoproError: \(error)") + } catch { + print("Unexpected error: \(error)") + } } @objc func runProveAction() {