Skip to content

Commit

Permalink
[CLI] Optimize sui keytool decode-multi-sig command response
Browse files Browse the repository at this point in the history
  • Loading branch information
howtosui committed May 28, 2024
1 parent f50d3bd commit 1b49984
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/sui/src/keytool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub struct DecodedMultiSigOutput {
participating_keys_signatures: Vec<DecodedMultiSig>,
pub_keys: Vec<MultiSigOutput>,
threshold: usize,
transaction_result: String,
sig_verify_result: String,
}

#[derive(Serialize)]
Expand Down Expand Up @@ -517,7 +517,7 @@ impl KeyToolCommand {
participating_keys_signatures: vec![],
pub_keys,
threshold,
transaction_result: "".to_string(),
sig_verify_result: "".to_string(),
};

for (sig, i) in sigs.iter().zip(bitmap) {
Expand All @@ -543,7 +543,11 @@ impl KeyToolCommand {
&VerifyParams::default(),
Arc::new(VerifiedDigestCache::new_empty()),
);
output.transaction_result = format!("{:?}", res);

match res {
Ok(()) => output.sig_verify_result = "OK".to_string(),
Err(e) => output.sig_verify_result = format!("{:?}", e),
};
};

CommandOutput::DecodeMultiSig(output)
Expand Down

0 comments on commit 1b49984

Please sign in to comment.