Skip to content

Commit dde6a62

Browse files
committed
refactor(sp-client): Use json instead of format
Signed-off-by: Lucas Åström <[email protected]>
1 parent 19ff6d8 commit dde6a62

File tree

1 file changed

+8
-3
lines changed
  • storage-provider/client/src/commands

1 file changed

+8
-3
lines changed

storage-provider/client/src/commands/proofs.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use primitives::{
2121
randomness::{draw_randomness, DomainSeparationTag},
2222
sector::SectorNumber,
2323
};
24+
use serde_json::json;
2425
use storagext::multipair::{MultiPairArgs, MultiPairSigner};
2526
use subxt::tx::Signer;
2627

@@ -229,9 +230,13 @@ async fn calculate_piece_commitment(input_path: PathBuf) -> Result<(), CliError>
229230
commp(&input_path).map_err(|err| UtilsCommandError::CommPError(err))?;
230231
let cid = commitment.cid();
231232

232-
// NOTE(@jmg-duarte,09/10/2024): too lazy for proper json
233-
// plus adding an extra structure for such a small thing seems wasteful
234-
println!("{{\n\t\"cid\": \"{cid}\",\n\t\"size\": {padded_piece_size}\n}}");
233+
println!(
234+
"{:#}",
235+
json!({
236+
"cid": cid.to_string(),
237+
"size": padded_piece_size
238+
})
239+
);
235240
Ok(())
236241
}
237242

0 commit comments

Comments
 (0)