From df5ce01caed378a01bff8859d5c9dc0949512f8e Mon Sep 17 00:00:00 2001 From: Buffrr Date: Sat, 25 Apr 2026 19:16:49 +0200 Subject: [PATCH] fix(checkpoint): preserve write_integrity arity for semver --- checkpoint/src/builder.rs | 2 +- checkpoint/src/lib.rs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/checkpoint/src/builder.rs b/checkpoint/src/builder.rs index 51d9da1..e533851 100644 --- a/checkpoint/src/builder.rs +++ b/checkpoint/src/builder.rs @@ -85,7 +85,7 @@ fn main() -> anyhow::Result<()> { eprintln!("SHA-256: {}", hex::encode(digest)); if let Some(path) = args.integrity_out.as_deref() { - spaces_checkpoint::write_integrity(path, height, &block_hash, &digest)?; + spaces_checkpoint::write_integrity_to(path, height, &block_hash, &digest)?; eprintln!("Updated {}", path.display()); } diff --git a/checkpoint/src/lib.rs b/checkpoint/src/lib.rs index c8fdd2c..725c982 100644 --- a/checkpoint/src/lib.rs +++ b/checkpoint/src/lib.rs @@ -302,9 +302,21 @@ pub fn checkpoint() -> super::Checkpoint {{ ) } +/// Write the checkpoint constant to `checkpoint/src/integrity.rs` relative to +/// the current working directory. Must be run from the workspace root. +#[cfg(feature = "cli")] +pub fn write_integrity(height: u32, block_hash: &str, digest: &[u8; 32]) -> anyhow::Result<()> { + write_integrity_to( + Path::new("checkpoint/src/integrity.rs"), + height, + block_hash, + digest, + ) +} + /// Write the checkpoint constant to a Rust source file at `path`. #[cfg(feature = "cli")] -pub fn write_integrity( +pub fn write_integrity_to( path: &Path, height: u32, block_hash: &str,