Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
brianp committed Jul 18, 2024
1 parent 478f44f commit 61a308e
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions base_layer/core/src/transactions/key_manager/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,28 @@ where TBackend: KeyManagerBackend<PublicKey> + 'static
}

async fn get_private_comms_key(&self) -> Result<PrivateKey, KeyManagerServiceError> {
self.get_private_key(&TariKeyId::Managed {
branch: TransactionKeyManagerBranch::Spend.get_branch_key(),
index: 0,
})
.await
let branch = TransactionKeyManagerBranch::Spend.get_branch_key();
let index = 0;

match self.wallet_type {
WalletType::Software | WalletType::Imported(_) => {
self.get_private_key(&TariKeyId::Managed {
branch: branch.clone(),
index,
})
.await
},
WalletType::Ledger(_) => {
let km = self
.key_managers
.get(&branch)
.ok_or(KeyManagerServiceError::UnknownKeyBranch)?
.read()
.await;
let key = km.get_private_key(index)?;
Ok(key)
},
}
}

fn get_domain_hasher(
Expand Down

0 comments on commit 61a308e

Please sign in to comment.