Skip to content

Commit

Permalink
[rooch-networkgh-2381] format the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliciss committed Sep 6, 2024
1 parent 9c4ff32 commit 89db2a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crates/rooch/src/commands/account/commands/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use clap::Parser;
use moveos_types::state::MoveState;
use rooch_key::keystore::account_keystore::AccountKeystore;
use rooch_types::{
address::ParsedAddress, crypto::Signature, error::RoochResult, framework::auth_payload::{SignData, MESSAGE_INFO_PREFIX}
address::ParsedAddress,
crypto::Signature,
error::RoochResult,
framework::auth_payload::{SignData, MESSAGE_INFO_PREFIX},
};

/// Sign a message with a parsed address
Expand Down Expand Up @@ -49,10 +52,7 @@ impl CommandAction<Option<Signature>> for SignCommand {
if self.json {
Ok(Some(signature))
} else {
println!(
"Sign message succeeded with the signatue {:?}",
signature
);
println!("Sign message succeeded with the signatue {:?}", signature);
Ok(None)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rooch/src/commands/account/commands/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl CommandAction<Option<bool>> for VerifyCommand {
SignData::new_without_tx_hash(MESSAGE_INFO_PREFIX.to_vec(), self.message.to_bytes());
let encoded_sign_data = sign_data.encode();
let message_hash = sha2_256_of(&encoded_sign_data).0.to_vec();

pk.verify_with_hash::<Sha256>(&message_hash, &sig)
.map_err(|e| RoochError::CommandArgumentError(format!("Failed verification: {}", e)))?;

Expand Down

0 comments on commit 89db2a3

Please sign in to comment.