Skip to content

Commit

Permalink
feat: Add root hashes to catalog.json
Browse files Browse the repository at this point in the history
  • Loading branch information
mpernambuco committed Dec 5, 2023
1 parent bbe87c7 commit 0bddf08
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/uarch-riscv-tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,14 @@ local function create_catalog_json_log(contexts)
util.indentout(
out,
1,
'{"path": "%s", "steps": %d, "proofs":%s, "proofsFrequency":%d}',
'{"path": "%s", "steps": %d, "proofs":%s, "proofsFrequency":%d, '
.. '"initialRootHash": "%s", "finalRootHash": "%s"}',
path,
ctx.step_count,
proofs,
proofs_frequency
proofs_frequency,
util.hexhash(ctx.initial_root_hash),
util.hexhash(ctx.final_root_hash)
)
if i < n then
out:write(",\n")
Expand Down Expand Up @@ -424,7 +427,9 @@ local function json_step_logs(tests)
contexts[#contexts + 1] = ctx
local machine <close> = build_machine(ctx.ram_image)
io.write(ctx.ram_image, ": ")
ctx.initial_root_hash = machine:get_root_hash()
run_machine_writing_json_logs(machine, ctx)
ctx.final_root_hash = machine:get_root_hash()
check_test_result(machine, ctx, errors)
if ctx.failed then
print("failed")
Expand Down

0 comments on commit 0bddf08

Please sign in to comment.