From d0a5ac54460ed9ed9794e05784e32784e149a13e Mon Sep 17 00:00:00 2001 From: dante <45801863+alexander-camuto@users.noreply.github.com> Date: Sat, 14 Oct 2023 17:56:06 +0100 Subject: [PATCH] fix: update examples to use hex instances (#548) --- examples/notebooks/ezkl_demo.ipynb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/notebooks/ezkl_demo.ipynb b/examples/notebooks/ezkl_demo.ipynb index 7ad7b8204..c5eea3199 100644 --- a/examples/notebooks/ezkl_demo.ipynb +++ b/examples/notebooks/ezkl_demo.ipynb @@ -681,13 +681,21 @@ "source": [ "onchain_input_array = []\n", "\n", - "for value in proof[\"instances\"]:\n", - " for field_element in value:\n", - " onchain_input_array.append(ezkl.vecu64_to_int(field_element))\n", + "# using a loop\n", + "# avoiding printing last comma\n", + "formatted_output = \"[\"\n", + "for i, value in enumerate(proof[\"instances\"]):\n", + " for j, field_element in enumerate(value):\n", + " onchain_input_array.append(ezkl.vecu64_to_felt(field_element))\n", + " formatted_output += str(onchain_input_array[-1])\n", + " if j != len(value) - 1:\n", + " formatted_output += \", \"\n", + " formatted_output += \"]\"\n", + "\n", "# This will be the values you use onchain\n", "# copy them over to remix and see if they verify\n", "# What happens when you change a value?\n", - "print(\"pubInputs: \", onchain_input_array)\n", + "print(\"pubInputs: \", formatted_output)\n", "print(\"proof: \", \"0x\" + proof[\"proof\"])" ] },