Skip to content

Commit

Permalink
Minor refactoring for readability and convention
Browse files Browse the repository at this point in the history
  • Loading branch information
brianp committed May 15, 2024
1 parent 2f7f267 commit 064329a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions base_layer/core/src/transactions/key_manager/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,23 +740,23 @@ where TBackend: KeyManagerBackend<PublicKey> + 'static
branch,
label: _,
index,
} => {
if let WalletType::Software(_, _) = self.wallet_type {
} => match &self.wallet_type {
WalletType::Software(_, _) => {
total_script_private_key =
total_script_private_key + self.get_private_key(script_key_id).await?;
continue;
}

let km = self
.key_managers
.get(branch)
.ok_or(KeyManagerServiceError::UnknownKeyBranch)?
.read()
.await;
let branch_key = km
.get_private_key(*index)
.map_err(|e| TransactionError::KeyManagerError(e.to_string()))?;
derived_key_commitments.push(branch_key);
},
WalletType::Ledger(_) => {
let km = self
.key_managers
.get(branch)
.ok_or(KeyManagerServiceError::UnknownKeyBranch)?
.read()
.await;
let branch_key = km
.get_private_key(*index)
.map_err(|e| TransactionError::KeyManagerError(e.to_string()))?;
derived_key_commitments.push(branch_key);
},
},
}
}
Expand Down

0 comments on commit 064329a

Please sign in to comment.