|
@@ -14,35 +14,35 @@ impl RpcAdapter {
|
|
|
|
|
|
|
|
pub async fn key_gen() -> Result<PathBuf> {
|
|
pub async fn key_gen() -> Result<PathBuf> {
|
|
|
debug!(target: "adapter", "key_gen() [START]");
|
|
debug!(target: "adapter", "key_gen() [START]");
|
|
|
- let path = WalletDB::path("wallet.db").await.expect("Failed to get path");
|
|
|
|
|
|
|
+ let path = WalletDB::path("wallet.db").expect("Failed to get path");
|
|
|
//WalletDB::key_gen(path).await?;
|
|
//WalletDB::key_gen(path).await?;
|
|
|
Ok(path)
|
|
Ok(path)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub async fn new_wallet() -> Result<()> {
|
|
pub async fn new_wallet() -> Result<()> {
|
|
|
debug!(target: "adapter", "new_wallet() [START]");
|
|
debug!(target: "adapter", "new_wallet() [START]");
|
|
|
- let path = WalletDB::path("wallet.db").await.expect("Failed to get path");
|
|
|
|
|
|
|
+ let path = WalletDB::path("wallet.db").expect("Failed to get path");
|
|
|
WalletDB::new(path).await?;
|
|
WalletDB::new(path).await?;
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub async fn new_cashier_wallet() -> Result<()> {
|
|
pub async fn new_cashier_wallet() -> Result<()> {
|
|
|
debug!(target: "adapter", "new_cashier_wallet() [START]");
|
|
debug!(target: "adapter", "new_cashier_wallet() [START]");
|
|
|
- let path = WalletDB::path("cashier.db").await.expect("Failed to get path");
|
|
|
|
|
|
|
+ let path = WalletDB::path("cashier.db").expect("Failed to get path");
|
|
|
WalletDB::new(path).await?;
|
|
WalletDB::new(path).await?;
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub async fn save_cash_key(pubkey: Vec<u8>) -> Result<()> {
|
|
pub async fn save_cash_key(pubkey: Vec<u8>) -> Result<()> {
|
|
|
debug!(target: "adapter", "save_cash_key() [START]");
|
|
debug!(target: "adapter", "save_cash_key() [START]");
|
|
|
- let path = WalletDB::path("cashier.db").await.expect("Failed to get path");
|
|
|
|
|
|
|
+ let path = WalletDB::path("cashier.db").expect("Failed to get path");
|
|
|
WalletDB::save(path, pubkey).await?;
|
|
WalletDB::save(path, pubkey).await?;
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub async fn save_key(pubkey: Vec<u8>) -> Result<()> {
|
|
pub async fn save_key(pubkey: Vec<u8>) -> Result<()> {
|
|
|
debug!(target: "adapter", "save_key() [START]");
|
|
debug!(target: "adapter", "save_key() [START]");
|
|
|
- let path = WalletDB::path("wallet.db").await.expect("Failed to get path");
|
|
|
|
|
|
|
+ let path = WalletDB::path("wallet.db").expect("Failed to get path");
|
|
|
WalletDB::save(path, pubkey).await?;
|
|
WalletDB::save(path, pubkey).await?;
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|