mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
walletdb: added retrieve default address method
This commit is contained in:
@@ -11,6 +11,7 @@ use sqlx::{
|
||||
|
||||
use crate::{
|
||||
crypto::{
|
||||
address::Address,
|
||||
coin::Coin,
|
||||
keypair::{Keypair, PublicKey, SecretKey},
|
||||
merkle_node::MerkleNode,
|
||||
@@ -161,6 +162,13 @@ impl WalletDb {
|
||||
|
||||
Ok(Keypair { secret, public })
|
||||
}
|
||||
|
||||
pub async fn get_default_address(&self) -> Result<Address> {
|
||||
debug!("Returning default address");
|
||||
let keypair = self.get_default_keypair().await?;
|
||||
|
||||
Ok(Address::from(keypair.public))
|
||||
}
|
||||
|
||||
pub async fn get_keypairs(&self) -> Result<Vec<Keypair>> {
|
||||
debug!("Returning keypairs");
|
||||
|
||||
Reference in New Issue
Block a user