walletdb: added retrieve default address method

This commit is contained in:
aggstam
2022-04-25 19:51:57 +03:00
parent 9679138e35
commit 145a7c9a51

View File

@@ -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");