Skip to content

Commit 6812150

Browse files
authored
feat: allow generating in-memory witness (#77)
1 parent e991841 commit 6812150

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/utils/src/commands/witness/dump.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ pub struct DumpWitnessCommand {
6868
}
6969

7070
impl DumpWitnessCommand {
71-
pub async fn run(self) -> anyhow::Result<()> {
71+
pub async fn run(self) -> anyhow::Result<BlockWitness> {
7272
let started = Instant::now();
7373

7474
if self.out_dir.is_file() {
7575
anyhow::bail!("Output path is a file");
7676
}
7777
std::fs::create_dir_all(&self.out_dir)?;
7878
if !self.json && !self.rkyv {
79-
anyhow::bail!("No output format specified");
79+
eprintln!("{}No output format specified", Emoji("⚠️ ", ""));
8080
}
8181

8282
if self.ancestors < 1 || self.ancestors > 256 {
@@ -259,7 +259,7 @@ impl DumpWitnessCommand {
259259
Emoji("✨ ", ":-)"),
260260
HumanDuration(started.elapsed())
261261
);
262-
Ok(())
262+
Ok(witness)
263263
}
264264
}
265265

crates/utils/src/commands/witness/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub enum WitnessCommands {
1414
impl WitnessCommands {
1515
pub async fn run(self) -> anyhow::Result<()> {
1616
match self {
17-
WitnessCommands::Dump(cmd) => cmd.run().await,
17+
WitnessCommands::Dump(cmd) => cmd.run().await.map(|_| ()),
1818
WitnessCommands::Rkyv(cmd) => cmd.run().await,
1919
}
2020
}

0 commit comments

Comments
 (0)