Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akaladarshi committed Feb 5, 2025
1 parent 3221430 commit eec7c20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/shim/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,17 @@ impl Signature {
anyhow::bail!("Empty signature bytes");
}

let first_byte = bytes
.first()
.ok_or_else(|| anyhow::anyhow!("Invalid signature bytes"))?;

let signature_data = bytes
.get(1..)
.ok_or_else(|| anyhow::anyhow!("Signature bytes too short"))?
.ok_or_else(|| anyhow::anyhow!("Invalid signature bytes"))?
.to_vec();

// first byte in signature represents the signature type
let sig_type = SignatureType::try_from(bytes[0])?;
let sig_type = SignatureType::try_from(*first_byte)?;
match sig_type {
SignatureType::Secp256k1 => Ok(Self::new_secp256k1(signature_data)),
SignatureType::Bls => Ok(Self::new_bls(signature_data)),
Expand Down
3 changes: 1 addition & 2 deletions src/wallet/subcommands/wallet_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,9 @@ impl WalletCommands {
.unwrap_or(42);

println!(
"{:<width_addr$} {:<width_default$} {}",
"{:<width_addr$} {:<width_default$} Balance",
"Address",
"Default",
"Balance",
width_addr = max_addr_len,
width_default = 7,
);
Expand Down

0 comments on commit eec7c20

Please sign in to comment.