Skip to content

Commit

Permalink
fix: update examples to use hex instances (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-camuto authored Oct 14, 2023
1 parent cf35332 commit d0a5ac5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions examples/notebooks/ezkl_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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\"])"
]
},
Expand Down

0 comments on commit d0a5ac5

Please sign in to comment.