ran cargo fmt and updated todo.md

This commit is contained in:
lunar-mining
2021-08-15 12:38:59 +02:00
parent 390a1afea2
commit 730714e312
6 changed files with 20 additions and 21 deletions

View File

@@ -1,15 +1,15 @@
use std::net::SocketAddr;
use async_std::sync::Arc;
use std::net::SocketAddr;
use std::{path::Path, path::PathBuf};
//use toml;
use drk::blockchain::{rocks::columns, Rocks, RocksColumn};
use drk::cli::{CashierdCli, CashierdConfig, Config};
use drk::service::CashierService;
use drk::service::GatewayClient;
use drk::wallet::CashierDb;
use drk::blockchain::{rocks::columns, Rocks, RocksColumn};
use drk::util::join_config_path;
use drk::wallet::CashierDb;
use drk::{Error, Result};
use log::*;

View File

@@ -3,8 +3,8 @@ use crate::serial::serialize;
use crate::service::btc::PubAddress;
use crate::wallet::WalletDb;
use crate::{Error, Result};
use std::string::ToString;
use std::str::FromStr;
use std::string::ToString;
use log::*;

View File

@@ -72,7 +72,6 @@ impl BitcoinKeys {
}
async fn _watch_address(&self) -> Result<()> {
Ok(())
}

View File

@@ -5,11 +5,11 @@ use super::btc::{BitcoinKeys, PubAddress};
use super::GatewayClient;
use crate::blockchain::Slab;
use crate::{Error, Result};
use crate::serial::{Encodable, serialize, deserialize};
use crate::wallet::CashierDbPtr;
use crate::tx;
use crate::crypto::load_params;
use crate::serial::{deserialize, serialize, Encodable};
use crate::tx;
use crate::wallet::CashierDbPtr;
use crate::{Error, Result};
use bellman::groth16;
use bls12_381::Bls12;
@@ -46,7 +46,6 @@ impl CashierService {
wallet: CashierDbPtr,
gateway: GatewayClient,
) -> Result<Arc<CashierService>> {
// Load trusted setup parameters
let (mint_params, mint_pvk) = load_params("mint.params")?;
let (spend_params, spend_pvk) = load_params("spend.params")?;
@@ -127,7 +126,7 @@ impl CashierService {
msg,
cashier_wallet,
send_queue.clone(),
executor.clone()
executor.clone(),
))
.detach();
}
@@ -175,10 +174,8 @@ impl CashierService {
// start scheduler for checking balance
let _result = btc_keys.start_scheduler(executor.clone());
info!("Waiting for address balance");
}
1 => {
let _btc_address = request.get_payload();
let address = cashier_wallet.get_cashier_public()?;
@@ -186,7 +183,7 @@ impl CashierService {
let mut reply = Reply::from(&request, CashierError::NoError as u32, vec![]);
reply.set_payload(serialize(&address));
send_queue.send((peer, reply)).await?;
info!("Received withdraw request");
@@ -226,7 +223,7 @@ impl CashierClient {
.protocol
.request(
CashierCommand::Withdraw as u8,
vec![], //TODO convert btc_address to bytes,
vec![], //TODO convert btc_address to bytes,
handle_error,
)
.await?;

View File

@@ -146,8 +146,10 @@ impl CashierDb {
pub_keys.push(key?);
}
let public: jubjub::SubgroupPoint = self.get_value_deserialized(
pub_keys.pop().expect("unable to load public_key from cashierdb"),
)?;
pub_keys
.pop()
.expect("unable to load public_key from cashierdb"),
)?;
Ok(public)
}
pub fn get_cashier_private(&self) -> Result<jubjub::Fr> {
@@ -161,8 +163,9 @@ impl CashierDb {
keys.push(key?);
}
let private: jubjub::Fr = self.get_value_deserialized(
keys.pop().expect("unable to load private_key from cashierdb"),
)?;
keys.pop()
.expect("unable to load private_key from cashierdb"),
)?;
Ok(private)
}

View File

@@ -26,10 +26,10 @@
## withdraw
[X] drk: withdraw cli option
[ ] darkfid: check address is valid
[X] darkfid: check address is valid
[X] darkfid: send cashout request to cashier with btc pub key
[X] cashierd: receive cashout request, reply with drk pub key
[ ] darkfid: send dbtc to the cashier drk pub key
[X] darkfid: send dbtc to the cashier drk pub key
[ ] cashierd: burn dbtc, send back btc (see tx.rs)
## drk -> drk