Add a proper database trait

This commit is contained in:
Luke Parker
2022-06-05 06:00:21 -04:00
parent 3617ed4eb7
commit a46432b829
4 changed files with 88 additions and 28 deletions

View File

@@ -2,14 +2,14 @@ use std::rc::Rc;
use rand::rngs::OsRng;
use crate::{Coin, coins::monero::Monero, wallet::{WalletKeys, Wallet}};
use crate::{Coin, coins::monero::Monero, wallet::{WalletKeys, MemCoinDb, Wallet}};
#[tokio::test]
async fn test() {
let monero = Monero::new("http://127.0.0.1:18081".to_string());
println!("{}", monero.get_height().await.unwrap());
let mut keys = frost::tests::key_gen::<_, <Monero as Coin>::Curve>(&mut OsRng);
let mut wallet = Wallet::new(monero);
let mut wallet = Wallet::new(MemCoinDb::new(), monero);
wallet.acknowledge_height(0, 0);
wallet.add_keys(&WalletKeys::new(Rc::try_unwrap(keys.remove(&1).take().unwrap()).unwrap(), 0));
dbg!(0);