Skip to content

Commit

Permalink
fix(iota-genesis-builder): cache all checkpoint digests when loading …
Browse files Browse the repository at this point in the history
…the UnsignedGenesis from file
  • Loading branch information
miker83z committed Feb 11, 2025
1 parent 27cfe10 commit 1c7eab9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/iota-genesis-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,14 @@ impl Builder {
builder
})
.await?;
loaded_genesis.checkpoint_contents.digest(); // cache digest before compare
// cache digests before compare
let built_genesis = builder.get_or_build_unsigned_genesis();
built_genesis.checkpoint_contents.digest();
built_genesis.checkpoint.digest();
loaded_genesis.checkpoint_contents.digest();
loaded_genesis.checkpoint.digest();
assert!(
*builder.get_or_build_unsigned_genesis() == loaded_genesis,
*built_genesis == loaded_genesis,
"loaded genesis does not match built genesis"
);

Expand Down

0 comments on commit 1c7eab9

Please sign in to comment.