Kaynağa Gözat

moved event notifications to log::trace

lunar-mining 4 yıl önce
ebeveyn
işleme
4133b5e02f

+ 6 - 6
src/bin/cashierd.rs

@@ -6,7 +6,7 @@ use async_trait::async_trait;
 use clap::clap_app;
 use clap::clap_app;
 use easy_parallel::Parallel;
 use easy_parallel::Parallel;
 use incrementalmerkletree::bridgetree::BridgeTree;
 use incrementalmerkletree::bridgetree::BridgeTree;
-use log::{debug, info};
+use log::{debug, trace, info};
 use rand::rngs::OsRng;
 use rand::rngs::OsRng;
 use serde_json::{json, Value};
 use serde_json::{json, Value};
 
 
@@ -83,7 +83,7 @@ impl RequestHandler for Cashierd {
 
 
 impl Cashierd {
 impl Cashierd {
     async fn new(config: CashierdConfig) -> Result<Self> {
     async fn new(config: CashierdConfig) -> Result<Self> {
-        debug!(target: "CASHIER DAEMON", "Initialize");
+        trace!(target: "CASHIER DAEMON", "Initialize");
 
 
         let wallet_path =
         let wallet_path =
             format!("sqlite://{}", expand_path(&config.cashier_wallet_path)?.to_str().unwrap());
             format!("sqlite://{}", expand_path(&config.cashier_wallet_path)?.to_str().unwrap());
@@ -462,7 +462,7 @@ impl Cashierd {
             match network.name {
             match network.name {
                 #[cfg(feature = "sol")]
                 #[cfg(feature = "sol")]
                 NetworkName::Solana => {
                 NetworkName::Solana => {
-                    debug!(target: "CASHIER DAEMON", "Adding solana network");
+                    trace!(target: "CASHIER DAEMON", "Adding solana network");
                     use drk::service::{sol::SolFailed, SolClient};
                     use drk::service::{sol::SolFailed, SolClient};
                     use solana_sdk::{signature::Signer, signer::keypair::Keypair};
                     use solana_sdk::{signature::Signer, signer::keypair::Keypair};
 
 
@@ -505,7 +505,7 @@ impl Cashierd {
 
 
                 #[cfg(feature = "eth")]
                 #[cfg(feature = "eth")]
                 NetworkName::Ethereum => {
                 NetworkName::Ethereum => {
-                    debug!(target: "CASHIER DAEMON", "Adding ethereum network");
+                    trace!(target: "CASHIER DAEMON", "Adding ethereum network");
                     use drk::service::{
                     use drk::service::{
                         eth::{generate_privkey, Keypair},
                         eth::{generate_privkey, Keypair},
                         EthClient,
                         EthClient,
@@ -562,7 +562,7 @@ impl Cashierd {
 
 
                 #[cfg(feature = "btc")]
                 #[cfg(feature = "btc")]
                 NetworkName::Bitcoin => {
                 NetworkName::Bitcoin => {
-                    debug!(target: "CASHIER DAEMON", "Adding bitcoin network");
+                    trace!(target: "CASHIER DAEMON", "Adding bitcoin network");
                     use drk::service::btc::{BtcClient, BtcFailed, Keypair};
                     use drk::service::btc::{BtcClient, BtcFailed, Keypair};
 
 
                     let bridge2 = self.bridge.clone();
                     let bridge2 = self.bridge.clone();
@@ -638,7 +638,7 @@ impl Cashierd {
         let listen_for_notification_from_bridge_task: smol::Task<Result<()>> =
         let listen_for_notification_from_bridge_task: smol::Task<Result<()>> =
             executor.spawn(async move {
             executor.spawn(async move {
                 while let Some(token_notification) = bridge2.clone().listen().await {
                 while let Some(token_notification) = bridge2.clone().listen().await {
-                    debug!(target: "CASHIER DAEMON", "Received notification from bridge");
+                    trace!(target: "CASHIER DAEMON", "Received notification from bridge");
 
 
                     let token_notification = token_notification?;
                     let token_notification = token_notification?;
 
 

+ 5 - 5
src/blockchain/slabstore.rs

@@ -1,6 +1,6 @@
 use std::sync::Arc;
 use std::sync::Arc;
 
 
-use log::debug;
+use log::{debug, trace};
 
 
 use super::{
 use super::{
     rocks::{columns, IteratorMode, RocksColumn},
     rocks::{columns, IteratorMode, RocksColumn},
@@ -21,14 +21,14 @@ impl SlabStore {
     }
     }
 
 
     pub fn get(&self, key: Vec<u8>) -> Result<Option<Vec<u8>>> {
     pub fn get(&self, key: Vec<u8>) -> Result<Option<Vec<u8>>> {
-        debug!(target: "SLABSTORE", "get value");
+        trace!(target: "SLABSTORE", "get value");
         let key: u64 = deserialize(&key)?;
         let key: u64 = deserialize(&key)?;
         let value = self.rocks.get(key)?;
         let value = self.rocks.get(key)?;
         Ok(value)
         Ok(value)
     }
     }
 
 
     pub fn put(&self, slab: Slab) -> Result<Option<u64>> {
     pub fn put(&self, slab: Slab) -> Result<Option<u64>> {
-        debug!(target: "SLABSTORE", "Put slab");
+        trace!(target: "SLABSTORE", "Put slab");
         let last_index = self.get_last_index()?;
         let last_index = self.get_last_index()?;
         let key = last_index + 1;
         let key = last_index + 1;
 
 
@@ -45,7 +45,7 @@ impl SlabStore {
     }
     }
 
 
     pub fn get_last_index(&self) -> Result<u64> {
     pub fn get_last_index(&self) -> Result<u64> {
-        debug!(target: "SLABSTORE", "Get last index");
+        trace!(target: "SLABSTORE", "Get last index");
         let last_index = self.rocks.iterator(IteratorMode::End)?.next();
         let last_index = self.rocks.iterator(IteratorMode::End)?.next();
         match last_index {
         match last_index {
             Some((index, _)) => Ok(deserialize(&index)?),
             Some((index, _)) => Ok(deserialize(&index)?),
@@ -54,7 +54,7 @@ impl SlabStore {
     }
     }
 
 
     pub fn get_last_index_as_bytes(&self) -> Result<Vec<u8>> {
     pub fn get_last_index_as_bytes(&self) -> Result<Vec<u8>> {
-        debug!(target: "SLABSTORE", "Get last index as bytes");
+        trace!(target: "SLABSTORE", "Get last index as bytes");
         let last_index = self.rocks.iterator(IteratorMode::End)?.next();
         let last_index = self.rocks.iterator(IteratorMode::End)?.next();
         match last_index {
         match last_index {
             Some((index, _)) => Ok(index.to_vec()),
             Some((index, _)) => Ok(index.to_vec()),

+ 22 - 22
src/client.rs

@@ -1,6 +1,6 @@
 use async_std::sync::{Arc, Mutex};
 use async_std::sync::{Arc, Mutex};
 use incrementalmerkletree::Tree;
 use incrementalmerkletree::Tree;
-use log::{debug, info, warn};
+use log::{debug, trace, info, warn};
 use smol::Executor;
 use smol::Executor;
 use url::Url;
 use url::Url;
 
 
@@ -93,7 +93,7 @@ impl Client {
         let main_keypair = wallet.get_keypairs().await?[0];
         let main_keypair = wallet.get_keypairs().await?[0];
         info!("Main keypair: {}", bs58::encode(&serialize(&main_keypair.public)).into_string());
         info!("Main keypair: {}", bs58::encode(&serialize(&main_keypair.public)).into_string());
 
 
-        debug!("Creating GatewayClient");
+        trace!("Creating GatewayClient");
         let slabstore = RocksColumn::<columns::Slabs>::new(rocks);
         let slabstore = RocksColumn::<columns::Slabs>::new(rocks);
         let gateway = GatewayClient::new(gateway_addrs.0, gateway_addrs.1, slabstore)?;
         let gateway = GatewayClient::new(gateway_addrs.0, gateway_addrs.1, slabstore)?;
 
 
@@ -119,7 +119,7 @@ impl Client {
         clear_input: bool,
         clear_input: bool,
         state: Arc<Mutex<State>>,
         state: Arc<Mutex<State>>,
     ) -> ClientResult<Vec<Coin>> {
     ) -> ClientResult<Vec<Coin>> {
-        debug!("Start build slab from tx");
+        trace!("Begin building slab from tx");
         let mut clear_inputs: Vec<tx::TransactionBuilderClearInputInfo> = vec![];
         let mut clear_inputs: Vec<tx::TransactionBuilderClearInputInfo> = vec![];
         let mut inputs: Vec<tx::TransactionBuilderInputInfo> = vec![];
         let mut inputs: Vec<tx::TransactionBuilderInputInfo> = vec![];
         let mut outputs: Vec<tx::TransactionBuilderOutputInfo> = vec![];
         let mut outputs: Vec<tx::TransactionBuilderOutputInfo> = vec![];
@@ -131,7 +131,7 @@ impl Client {
             let input = tx::TransactionBuilderClearInputInfo { value, token_id, signature_secret };
             let input = tx::TransactionBuilderClearInputInfo { value, token_id, signature_secret };
             clear_inputs.push(input);
             clear_inputs.push(input);
         } else {
         } else {
-            debug!("Start build inputs");
+            trace!("Start building tx inputs");
             let mut inputs_value = 0_u64;
             let mut inputs_value = 0_u64;
             let state_m = state.lock().await;
             let state_m = state.lock().await;
             let own_coins = self.wallet.get_own_coins().await?;
             let own_coins = self.wallet.get_own_coins().await?;
@@ -172,7 +172,7 @@ impl Client {
                 });
                 });
             }
             }
 
 
-            debug!("End build inputs");
+            trace!("Finish building inputs");
         }
         }
 
 
         outputs.push(tx::TransactionBuilderOutputInfo { value, token_id, public: pubkey });
         outputs.push(tx::TransactionBuilderOutputInfo { value, token_id, public: pubkey });
@@ -184,15 +184,15 @@ impl Client {
         tx.encode(&mut tx_data).expect("encode tx");
         tx.encode(&mut tx_data).expect("encode tx");
 
 
         let slab = Slab::new(tx_data);
         let slab = Slab::new(tx_data);
-        debug!("End build slab from tx");
+        trace!("Finish building slab from tx");
 
 
         // Check if it's valid before sending to gateway
         // Check if it's valid before sending to gateway
         let state = &*state.lock().await;
         let state = &*state.lock().await;
         state_transition(state, tx)?;
         state_transition(state, tx)?;
 
 
-        debug!("Sending slab to gateway");
+        trace!("Sending slab to gateway");
         self.gateway.put_slab(slab).await?;
         self.gateway.put_slab(slab).await?;
-        debug!("Sent successfully");
+        trace!("Slab sent to gateway successfully");
         Ok(coins)
         Ok(coins)
     }
     }
 
 
@@ -205,7 +205,7 @@ impl Client {
         state: Arc<Mutex<State>>,
         state: Arc<Mutex<State>>,
     ) -> ClientResult<()> {
     ) -> ClientResult<()> {
         // TODO: TOKEN debug
         // TODO: TOKEN debug
-        debug!("Start send {}", amount);
+        debug!("Sending {}", amount);
 
 
         if amount == 0 {
         if amount == 0 {
             return Err(ClientFailed::InvalidAmount(0))
             return Err(ClientFailed::InvalidAmount(0))
@@ -216,7 +216,7 @@ impl Client {
             self.wallet.confirm_spend_coin(coin).await?;
             self.wallet.confirm_spend_coin(coin).await?;
         }
         }
 
 
-        debug!("End send {}", amount);
+        debug!("Sent {}", amount);
         Ok(())
         Ok(())
     }
     }
 
 
@@ -236,7 +236,7 @@ impl Client {
             return Err(ClientFailed::NotEnoughValue(amount))
             return Err(ClientFailed::NotEnoughValue(amount))
         }
         }
 
 
-        debug!("End transfer {}", amount);
+        debug!("Finish transfer {}", amount);
         Ok(())
         Ok(())
     }
     }
 
 
@@ -247,31 +247,31 @@ impl Client {
         wallet: WalletPtr,
         wallet: WalletPtr,
         notify: Option<async_channel::Sender<(PublicKey, u64)>>,
         notify: Option<async_channel::Sender<(PublicKey, u64)>>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Build tx from slab and update the state");
+        trace!("Building tx from slab and updating the state");
         let payload = slab.get_payload();
         let payload = slab.get_payload();
         /*
         /*
         use std::io::Write;
         use std::io::Write;
         let mut file = std::fs::File::create("/tmp/payload.txt")?;
         let mut file = std::fs::File::create("/tmp/payload.txt")?;
         file.write_all(&payload)?;
         file.write_all(&payload)?;
         */
         */
-        debug!("Decoding payload");
+        trace!("Decoding payload");
         let tx = tx::Transaction::decode(&payload[..])?;
         let tx = tx::Transaction::decode(&payload[..])?;
 
 
         let update: StateUpdate;
         let update: StateUpdate;
 
 
         // This is separate because otherwise the mutex is never unlocked.
         // This is separate because otherwise the mutex is never unlocked.
         {
         {
-            debug!("Acquiring state lock");
+            trace!("Acquiring state lock");
             let state = &*state.lock().await;
             let state = &*state.lock().await;
             update = state_transition(state, tx)?;
             update = state_transition(state, tx)?;
-            debug!("Successfully passed state_transition");
+            trace!("Successfully passed state_transition");
         }
         }
 
 
-        debug!("Acquiring state lock");
+        trace!("Acquiring state lock");
         let mut state = state.lock().await;
         let mut state = state.lock().await;
-        debug!("Trying to apply the new state");
+        trace!("Trying to apply the new state");
         state.apply(update, secret_keys, notify, wallet).await?;
         state.apply(update, secret_keys, notify, wallet).await?;
-        debug!("Successfully passed state.apply");
+        trace!("Successfully passed state.apply");
 
 
         Ok(())
         Ok(())
     }
     }
@@ -283,7 +283,7 @@ impl Client {
         notify: async_channel::Sender<(PublicKey, u64)>,
         notify: async_channel::Sender<(PublicKey, u64)>,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Start subscriber for cashier");
+        trace!("Start subscriber for cashier");
         let gateway_slabs_sub = self.gateway.start_subscriber(executor.clone()).await?;
         let gateway_slabs_sub = self.gateway.start_subscriber(executor.clone()).await?;
 
 
         let secret_key = self.main_keypair.secret;
         let secret_key = self.main_keypair.secret;
@@ -292,7 +292,7 @@ impl Client {
         let task: smol::Task<Result<()>> = executor.spawn(async move {
         let task: smol::Task<Result<()>> = executor.spawn(async move {
             loop {
             loop {
                 let slab = gateway_slabs_sub.recv().await?;
                 let slab = gateway_slabs_sub.recv().await?;
-                debug!("Received new slab");
+                trace!("Received new slab");
 
 
                 let mut secret_keys = vec![secret_key];
                 let mut secret_keys = vec![secret_key];
                 let mut withdraw_keys = cashier_wallet.get_withdraw_private_keys().await?;
                 let mut withdraw_keys = cashier_wallet.get_withdraw_private_keys().await?;
@@ -323,7 +323,7 @@ impl Client {
         state: Arc<Mutex<State>>,
         state: Arc<Mutex<State>>,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Start subscriber for darkfid");
+        trace!("Start subscriber for darkfid");
         let gateway_slabs_sub = self.gateway.start_subscriber(executor.clone()).await?;
         let gateway_slabs_sub = self.gateway.start_subscriber(executor.clone()).await?;
 
 
         let secret_key = self.main_keypair.secret;
         let secret_key = self.main_keypair.secret;
@@ -332,7 +332,7 @@ impl Client {
         let task: smol::Task<Result<()>> = executor.spawn(async move {
         let task: smol::Task<Result<()>> = executor.spawn(async move {
             loop {
             loop {
                 let slab = gateway_slabs_sub.recv().await?;
                 let slab = gateway_slabs_sub.recv().await?;
-                debug!("Received new slab");
+                trace!("Received new slab");
 
 
                 let update_state = Self::update_state(
                 let update_state = Self::update_state(
                     vec![secret_key],
                     vec![secret_key],

+ 6 - 6
src/service/bridge.rs

@@ -4,7 +4,7 @@ use async_executor::Executor;
 use async_std::sync::{Arc, Mutex};
 use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use async_trait::async_trait;
 use futures::stream::{FuturesUnordered, StreamExt};
 use futures::stream::{FuturesUnordered, StreamExt};
-use log::{debug, error};
+use log::{trace, error};
 
 
 use crate::{
 use crate::{
     crypto::keypair::PublicKey, types::*, util::NetworkName, wallet::cashierdb::TokenKey, Error,
     crypto::keypair::PublicKey, types::*, util::NetworkName, wallet::cashierdb::TokenKey, Error,
@@ -76,7 +76,7 @@ impl Bridge {
         network: NetworkName,
         network: NetworkName,
         client: Arc<dyn NetworkClient + Send + Sync>,
         client: Arc<dyn NetworkClient + Send + Sync>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!(target: "BRIDGE", "Adding new client");
+        trace!(target: "BRIDGE", "Adding new client");
 
 
         let client2 = client.clone();
         let client2 = client.clone();
         let notifier = client2.get_notifier().await?;
         let notifier = client2.get_notifier().await?;
@@ -92,7 +92,7 @@ impl Bridge {
 
 
     pub async fn listen(self: Arc<Self>) -> Option<Result<TokenNotification>> {
     pub async fn listen(self: Arc<Self>) -> Option<Result<TokenNotification>> {
         if !self.notifiers.is_empty() {
         if !self.notifiers.is_empty() {
-            debug!(target: "BRIDGE", "Start listening for new notifications");
+            trace!(target: "BRIDGE", "Start listening for new notifications");
             let notification = self
             let notification = self
                 .notifiers
                 .notifiers
                 .iter()
                 .iter()
@@ -102,7 +102,7 @@ impl Bridge {
                 .await
                 .await
                 .map(|o| o.map_err(Error::from));
                 .map(|o| o.map_err(Error::from));
 
 
-            debug!(target: "BRIDGE", "Stop listening for new notifications");
+            trace!(target: "BRIDGE", "Stop listening for new notifications");
 
 
             notification
             notification
         } else {
         } else {
@@ -116,7 +116,7 @@ impl Bridge {
         mint: Option<String>,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
     ) -> BridgeSubscribtion {
     ) -> BridgeSubscribtion {
-        debug!(target: "BRIDGE", "Start new subscription");
+        trace!(target: "BRIDGE", "Start new subscription");
         let (sender, req) = async_channel::unbounded();
         let (sender, req) = async_channel::unbounded();
         let (rep, receiver) = async_channel::unbounded();
         let (rep, receiver) = async_channel::unbounded();
 
 
@@ -135,7 +135,7 @@ impl Bridge {
         mint: Option<String>,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!(target: "BRIDGE", "Listen for new subscriptions");
+        trace!(target: "BRIDGE", "Listen for new subscriptions");
         let req = req.recv().await?;
         let req = req.recv().await?;
 
 
         let network = req.network;
         let network = req.network;

+ 2 - 2
src/service/btc.rs

@@ -392,7 +392,7 @@ impl BtcClient {
         let index = &mut client.lock().await.subscriptions.iter().position(|p| p == &script);
         let index = &mut client.lock().await.subscriptions.iter().position(|p| p == &script);
 
 
         if let Some(ind) = index {
         if let Some(ind) = index {
-            debug!(target: "BTC BRIDGE", "Removing subscription from list");
+            trace!(target: "BTC BRIDGE", "Removing subscription from list");
             let _ = &mut client.lock().await.subscriptions.remove(*ind);
             let _ = &mut client.lock().await.subscriptions.remove(*ind);
         }
         }
 
 
@@ -515,7 +515,7 @@ impl NetworkClient for BtcClient {
         let public_key = btc_keys.address.to_string();
         let public_key = btc_keys.address.to_string();
 
 
         // start scheduler for checking balance
         // start scheduler for checking balance
-        debug!(target: "BRIDGE BITCOIN", "Subscribing for deposit");
+        trace!(target: "BRIDGE BITCOIN", "Subscribing for deposit");
 
 
         executor
         executor
             .spawn(async move {
             .spawn(async move {

+ 2 - 2
src/service/eth.rs

@@ -6,7 +6,7 @@ use async_trait::async_trait;
 use hash_db::Hasher;
 use hash_db::Hasher;
 use keccak_hasher::KeccakHasher;
 use keccak_hasher::KeccakHasher;
 use lazy_static::lazy_static;
 use lazy_static::lazy_static;
-use log::{debug, error, info};
+use log::{debug, trace, error, info};
 use num_bigint::{BigUint, RandBigInt};
 use num_bigint::{BigUint, RandBigInt};
 use serde::{Deserialize, Serialize};
 use serde::{Deserialize, Serialize};
 use serde_json::{json, Value};
 use serde_json::{json, Value};
@@ -297,7 +297,7 @@ impl EthClient {
         let mut subscriptions = self.subscriptions.lock().await;
         let mut subscriptions = self.subscriptions.lock().await;
         let index = subscriptions.iter().position(|p| p == pubkey);
         let index = subscriptions.iter().position(|p| p == pubkey);
         if let Some(ind) = index {
         if let Some(ind) = index {
-            debug!(target: "ETH BRIDGE", "Removing subscription from list");
+            trace!(target: "ETH BRIDGE", "Removing subscription from list");
             subscriptions.remove(ind);
             subscriptions.remove(ind);
         }
         }
     }
     }

+ 14 - 14
src/service/gateway.rs

@@ -5,7 +5,7 @@ use std::{
 };
 };
 
 
 use async_executor::Executor;
 use async_executor::Executor;
-use log::debug;
+use log::trace;
 use url::Url;
 use url::Url;
 
 
 use super::reqrep::{PeerId, Publisher, RepProtocol, Reply, ReqProtocol, Request, Subscriber};
 use super::reqrep::{PeerId, Publisher, RepProtocol, Reply, ReqProtocol, Request, Subscriber};
@@ -117,7 +117,7 @@ impl GatewayService {
         let peer = msg.0;
         let peer = msg.0;
         match request.get_command() {
         match request.get_command() {
             0 => {
             0 => {
-                debug!(target: "GATEWAY DAEMON" ,"Received putslab msg");
+                trace!(target: "GATEWAY DAEMON" ,"Received putslab msg");
                 // PUTSLAB
                 // PUTSLAB
                 let slab = request.get_payload();
                 let slab = request.get_payload();
 
 
@@ -137,7 +137,7 @@ impl GatewayService {
                 publish_queue.send(slab).await?;
                 publish_queue.send(slab).await?;
             }
             }
             1 => {
             1 => {
-                debug!(target: "GATEWAY DAEMON", "Received getslab msg");
+                trace!(target: "GATEWAY DAEMON", "Received getslab msg");
                 let index = request.get_payload();
                 let index = request.get_payload();
                 let slab = slabstore.get(index)?;
                 let slab = slabstore.get(index)?;
 
 
@@ -154,7 +154,7 @@ impl GatewayService {
                 // GETSLAB
                 // GETSLAB
             }
             }
             2 => {
             2 => {
-                debug!(target: "GATEWAY DAEMON","Received getlastindex msg");
+                trace!(target: "GATEWAY DAEMON","Received getlastindex msg");
                 let index = slabstore.get_last_index_as_bytes()?;
                 let index = slabstore.get_last_index_as_bytes()?;
 
 
                 let reply = Reply::from(&request, GatewayError::NoError as u32, index);
                 let reply = Reply::from(&request, GatewayError::NoError as u32, index);
@@ -213,7 +213,7 @@ impl GatewayClient {
     }
     }
 
 
     pub async fn sync(&mut self) -> Result<u64> {
     pub async fn sync(&mut self) -> Result<u64> {
-        debug!(target: "GATEWAY CLIENT", "Start Syncing");
+        trace!(target: "GATEWAY CLIENT", "Start Syncing");
 
 
         let local_last_index = self.slabstore.get_last_index()?;
         let local_last_index = self.slabstore.get_last_index()?;
 
 
@@ -235,12 +235,12 @@ impl GatewayClient {
             }
             }
         }
         }
 
 
-        debug!(target: "GATEWAY CLIENT","End Syncing");
+        trace!(target: "GATEWAY CLIENT","End Syncing");
         Ok(last_index)
         Ok(last_index)
     }
     }
 
 
     pub async fn get_slab(&mut self, index: u64) -> Result<Option<Slab>> {
     pub async fn get_slab(&mut self, index: u64) -> Result<Option<Slab>> {
-        debug!(target: "GATEWAY CLIENT","Get slab");
+        trace!(target: "GATEWAY CLIENT","Get slab");
 
 
         let handle_error = Arc::new(handle_error);
         let handle_error = Arc::new(handle_error);
         let rep = self
         let rep = self
@@ -259,7 +259,7 @@ impl GatewayClient {
     }
     }
 
 
     pub async fn put_slab(&mut self, mut slab: Slab) -> Result<()> {
     pub async fn put_slab(&mut self, mut slab: Slab) -> Result<()> {
-        debug!(target: "GATEWAY CLIENT","Put slab");
+        trace!(target: "GATEWAY CLIENT","Put slab");
 
 
         loop {
         loop {
             let last_index = self.sync().await?;
             let last_index = self.sync().await?;
@@ -281,7 +281,7 @@ impl GatewayClient {
     }
     }
 
 
     pub async fn get_last_index(&mut self) -> Result<u64> {
     pub async fn get_last_index(&mut self) -> Result<u64> {
-        debug!(target: "GATEWAY CLIENT","Get last index");
+        trace!(target: "GATEWAY CLIENT","Get last index");
 
 
         let handle_error = Arc::new(handle_error);
         let handle_error = Arc::new(handle_error);
 
 
@@ -301,7 +301,7 @@ impl GatewayClient {
         &self,
         &self,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
     ) -> Result<GatewaySlabsSubscriber> {
     ) -> Result<GatewaySlabsSubscriber> {
-        debug!(target: "GATEWAY CLIENT","Start subscriber");
+        trace!(target: "GATEWAY CLIENT","Start subscriber");
 
 
         let mut subscriber = Subscriber::new(self.sub_addr, String::from("GATEWAY CLIENT"));
         let mut subscriber = Subscriber::new(self.sub_addr, String::from("GATEWAY CLIENT"));
         subscriber.start().await?;
         subscriber.start().await?;
@@ -320,11 +320,11 @@ impl GatewayClient {
         slabstore: Arc<SlabStore>,
         slabstore: Arc<SlabStore>,
         gateway_slabs_sub_s: async_channel::Sender<Slab>,
         gateway_slabs_sub_s: async_channel::Sender<Slab>,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!(target: "GATEWAY CLIENT","Start subscribe loop");
+        trace!(target: "GATEWAY CLIENT","Start subscribe loop");
 
 
         loop {
         loop {
             let slab = subscriber.fetch::<Slab>().await?;
             let slab = subscriber.fetch::<Slab>().await?;
-            debug!(target: "GATEWAY CLIENT","Received new slab");
+            trace!(target: "GATEWAY CLIENT","Received new slab");
             gateway_slabs_sub_s.send(slab.clone()).await?;
             gateway_slabs_sub_s.send(slab.clone()).await?;
             slabstore.put(slab)?;
             slabstore.put(slab)?;
         }
         }
@@ -338,10 +338,10 @@ impl GatewayClient {
 fn handle_error(status_code: u32) {
 fn handle_error(status_code: u32) {
     match status_code {
     match status_code {
         1 => {
         1 => {
-            debug!(target: "GATEWAY SERVICE", "Reply has an Error: Index is not updated");
+            trace!(target: "GATEWAY SERVICE", "Reply has an Error: Index is not updated");
         }
         }
         2 => {
         2 => {
-            debug!(target: "GATEWAY SERVICE", "Reply has an Error: Index Not Exist");
+            trace!(target: "GATEWAY SERVICE", "Reply has an Error: Index Not Exist");
         }
         }
         _ => {}
         _ => {}
     }
     }

+ 3 - 3
src/service/sol.rs

@@ -5,7 +5,7 @@ use async_native_tls::TlsConnector;
 use async_std::sync::{Arc, Mutex};
 use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use async_trait::async_trait;
 use futures::{SinkExt, StreamExt};
 use futures::{SinkExt, StreamExt};
-use log::{debug, error, info, warn};
+use log::{debug, trace, error, info, warn};
 use serde::Serialize;
 use serde::Serialize;
 use serde_json::{json, Value};
 use serde_json::{json, Value};
 use solana_client::{blockhash_query::BlockhashQuery, rpc_client::RpcClient};
 use solana_client::{blockhash_query::BlockhashQuery, rpc_client::RpcClient};
@@ -88,7 +88,7 @@ impl SolClient {
         drk_pub_key: PublicKey,
         drk_pub_key: PublicKey,
         mint: Option<Pubkey>,
         mint: Option<Pubkey>,
     ) -> SolResult<()> {
     ) -> SolResult<()> {
-        debug!(target: "SOL BRIDGE", "handle_subscribe_request()");
+        trace!(target: "SOL BRIDGE", "handle_subscribe_request()");
 
 
         // Derive token pubkey if mint was provided.
         // Derive token pubkey if mint was provided.
         let pubkey = if mint.is_some() {
         let pubkey = if mint.is_some() {
@@ -272,7 +272,7 @@ impl SolClient {
             let mut subscriptions = self.subscriptions.lock().await;
             let mut subscriptions = self.subscriptions.lock().await;
             let index = subscriptions.iter().position(|p| p == pubkey);
             let index = subscriptions.iter().position(|p| p == pubkey);
             if let Some(ind) = index {
             if let Some(ind) = index {
-                debug!(target: "SOL BRIDGE", "Removing subscription from list");
+                trace!(target: "SOL BRIDGE", "Removing subscription from list");
                 subscriptions.remove(ind);
                 subscriptions.remove(ind);
             }
             }
         }
         }

+ 12 - 12
src/state.rs

@@ -1,5 +1,5 @@
 use incrementalmerkletree::{bridgetree::BridgeTree, Frontier, Tree};
 use incrementalmerkletree::{bridgetree::BridgeTree, Frontier, Tree};
-use log::debug;
+use log::{debug, trace};
 
 
 use crate::{
 use crate::{
     blockchain::{rocks::columns, RocksColumn},
     blockchain::{rocks::columns, RocksColumn},
@@ -57,7 +57,7 @@ pub enum VerifyFailed {
 
 
 pub fn state_transition<S: ProgramState>(state: &S, tx: Transaction) -> VerifyResult<StateUpdate> {
 pub fn state_transition<S: ProgramState>(state: &S, tx: Transaction) -> VerifyResult<StateUpdate> {
     // Check deposits are legit
     // Check deposits are legit
-    debug!(target: "STATE TRANSITION", "iterate clear_inputs");
+    trace!(target: "STATE TRANSITION", "iterate clear_inputs");
 
 
     for (i, input) in tx.clear_inputs.iter().enumerate() {
     for (i, input) in tx.clear_inputs.iter().enumerate() {
         // Check the public key in the clear inputs
         // Check the public key in the clear inputs
@@ -68,7 +68,7 @@ pub fn state_transition<S: ProgramState>(state: &S, tx: Transaction) -> VerifyRe
         }
         }
     }
     }
 
 
-    debug!(target: "STATE TRANSITION", "iterate inputs");
+    trace!(target: "STATE TRANSITION", "iterate inputs");
 
 
     for (i, input) in tx.inputs.iter().enumerate() {
     for (i, input) in tx.inputs.iter().enumerate() {
         let merkle = &input.revealed.merkle_root;
         let merkle = &input.revealed.merkle_root;
@@ -88,9 +88,9 @@ pub fn state_transition<S: ProgramState>(state: &S, tx: Transaction) -> VerifyRe
         }
         }
     }
     }
 
 
-    debug!(target: "STATE TRANSITION", "Check the tx verifies correctly");
+    trace!(target: "STATE TRANSITION", "Check the tx verifies correctly");
     tx.verify(state.mint_vk(), state.spend_vk())?;
     tx.verify(state.mint_vk(), state.spend_vk())?;
-    debug!(target: "STATE TRANSITION", "Verified successfully");
+    trace!(target: "STATE TRANSITION", "Verified successfully");
 
 
     let mut nullifiers = vec![];
     let mut nullifiers = vec![];
     for input in tx.inputs {
     for input in tx.inputs {
@@ -134,12 +134,12 @@ impl State {
         wallet: WalletPtr,
         wallet: WalletPtr,
     ) -> Result<()> {
     ) -> Result<()> {
         // Extend our list of nullifiers with the ones from the update.
         // Extend our list of nullifiers with the ones from the update.
-        debug!("Extend nullifiers");
+        trace!("Extend nullifiers");
         for nullifier in update.nullifiers {
         for nullifier in update.nullifiers {
             self.nullifiers.put(nullifier, vec![] as Vec<u8>)?;
             self.nullifiers.put(nullifier, vec![] as Vec<u8>)?;
         }
         }
 
 
-        debug!("Update Merkle tree and witness");
+        trace!("Update Merkle tree and witness");
         for (coin, enc_note) in update.coins.into_iter().zip(update.enc_notes.iter()) {
         for (coin, enc_note) in update.coins.into_iter().zip(update.enc_notes.iter()) {
             // Add the new coins to the Merkle tree
             // Add the new coins to the Merkle tree
             let node = MerkleNode(coin.0);
             let node = MerkleNode(coin.0);
@@ -167,7 +167,7 @@ impl State {
                     let pubkey = PublicKey::from_secret(*secret);
                     let pubkey = PublicKey::from_secret(*secret);
 
 
                     debug!("Received a coin: amount {}", note.value);
                     debug!("Received a coin: amount {}", note.value);
-                    debug!("Send a notification");
+                    trace!("Send a notification");
                     if let Some(ch) = notify.clone() {
                     if let Some(ch) = notify.clone() {
                         ch.send((pubkey, note.value)).await?;
                         ch.send((pubkey, note.value)).await?;
                     }
                     }
@@ -175,7 +175,7 @@ impl State {
             }
             }
         }
         }
 
 
-        debug!("apply() exiting successfully");
+        trace!("apply() exiting successfully");
         Ok(())
         Ok(())
     }
     }
 
 
@@ -189,12 +189,12 @@ impl State {
 
 
 impl ProgramState for State {
 impl ProgramState for State {
     fn is_valid_cashier_public_key(&self, public: &PublicKey) -> bool {
     fn is_valid_cashier_public_key(&self, public: &PublicKey) -> bool {
-        debug!("Check if it is a valid cashier public key");
+        trace!("Check if it is a valid cashier public key");
         self.public_keys.contains(public)
         self.public_keys.contains(public)
     }
     }
 
 
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
-        debug!("Check if it is valid merkle");
+        trace!("Check if it is valid merkle");
         if let Ok(mr) = self.merkle_roots.key_exist(merkle_root.clone()) {
         if let Ok(mr) = self.merkle_roots.key_exist(merkle_root.clone()) {
             return mr
             return mr
         }
         }
@@ -202,7 +202,7 @@ impl ProgramState for State {
     }
     }
 
 
     fn nullifier_exists(&self, nullifier: &Nullifier) -> bool {
     fn nullifier_exists(&self, nullifier: &Nullifier) -> bool {
-        debug!("Check if nullifier exists");
+        trace!("Check if nullifier exists");
         if let Ok(nl) = self.nullifiers.key_exist(nullifier.to_bytes()) {
         if let Ok(nl) = self.nullifiers.key_exist(nullifier.to_bytes()) {
             return nl
             return nl
         }
         }

+ 17 - 17
src/wallet/cashierdb.rs

@@ -1,7 +1,7 @@
 use std::{fs::create_dir_all, path::Path, str::FromStr};
 use std::{fs::create_dir_all, path::Path, str::FromStr};
 
 
 use async_std::sync::Arc;
 use async_std::sync::Arc;
-use log::{debug, error, info};
+use log::{trace, error, info};
 use sqlx::{
 use sqlx::{
     sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions},
     sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions},
     Row, SqlitePool,
     Row, SqlitePool,
@@ -46,7 +46,7 @@ impl WalletApi for CashierDb {}
 
 
 impl CashierDb {
 impl CashierDb {
     pub async fn new(path: &str, password: String) -> Result<CashierDbPtr> {
     pub async fn new(path: &str, password: String) -> Result<CashierDbPtr> {
-        debug!("new() Constructor called");
+        trace!("new() Constructor called");
         if password.trim().is_empty() {
         if password.trim().is_empty() {
             error!("Password is empty. You must set a password to use the wallet.");
             error!("Password is empty. You must set a password to use the wallet.");
             return Err(Error::from(ClientFailed::EmptyPassword))
             return Err(Error::from(ClientFailed::EmptyPassword))
@@ -78,19 +78,19 @@ impl CashierDb {
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
 
 
-        debug!("Initializing main keypairs table");
+        trace!("Initializing main keypairs table");
         sqlx::query(main_kps).execute(&mut conn).await?;
         sqlx::query(main_kps).execute(&mut conn).await?;
 
 
-        debug!("Initializing deposit keypairs table");
+        trace!("Initializing deposit keypairs table");
         sqlx::query(deposit_kps).execute(&mut conn).await?;
         sqlx::query(deposit_kps).execute(&mut conn).await?;
 
 
-        debug!("Initializing withdraw keypairs table");
+        trace!("Initializing withdraw keypairs table");
         sqlx::query(withdraw_kps).execute(&mut conn).await?;
         sqlx::query(withdraw_kps).execute(&mut conn).await?;
         Ok(())
         Ok(())
     }
     }
 
 
     pub async fn put_main_keys(&self, token_key: &TokenKey, network: &NetworkName) -> Result<()> {
     pub async fn put_main_keys(&self, token_key: &TokenKey, network: &NetworkName) -> Result<()> {
-        debug!("Writing main keys into the database");
+        trace!("Writing main keys into the database");
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -110,7 +110,7 @@ impl CashierDb {
     }
     }
 
 
     pub async fn get_main_keys(&self, network: &NetworkName) -> Result<Vec<TokenKey>> {
     pub async fn get_main_keys(&self, network: &NetworkName) -> Result<Vec<TokenKey>> {
-        debug!("Returning main keypairs");
+        trace!("Returning main keypairs");
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -134,7 +134,7 @@ impl CashierDb {
     }
     }
 
 
     pub async fn remove_withdraw_and_deposit_keys(&self) -> Result<()> {
     pub async fn remove_withdraw_and_deposit_keys(&self) -> Result<()> {
-        debug!("Removing withdraw and deposit keys");
+        trace!("Removing withdraw and deposit keys");
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
         sqlx::query("DROP TABLE deposit_keypairs;").execute(&mut conn).await?;
         sqlx::query("DROP TABLE deposit_keypairs;").execute(&mut conn).await?;
         sqlx::query("DROP TABLE withdraw_keypairs;").execute(&mut conn).await?;
         sqlx::query("DROP TABLE withdraw_keypairs;").execute(&mut conn).await?;
@@ -151,7 +151,7 @@ impl CashierDb {
         token_id: &DrkTokenId,
         token_id: &DrkTokenId,
         mint_address: String,
         mint_address: String,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Writing withdraw keys to database");
+        trace!("Writing withdraw keys to database");
         let public = self.get_value_serialized(d_key_public)?;
         let public = self.get_value_serialized(d_key_public)?;
         let secret = self.get_value_serialized(d_key_secret)?;
         let secret = self.get_value_serialized(d_key_secret)?;
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
@@ -189,7 +189,7 @@ impl CashierDb {
         token_id: &DrkTokenId,
         token_id: &DrkTokenId,
         mint_address: String,
         mint_address: String,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Writing deposit keys to database");
+        trace!("Writing deposit keys to database");
         let d_key_public = self.get_value_serialized(d_key_public)?;
         let d_key_public = self.get_value_serialized(d_key_public)?;
         let token_id = self.get_value_serialized(token_id)?;
         let token_id = self.get_value_serialized(token_id)?;
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
@@ -218,7 +218,7 @@ impl CashierDb {
     }
     }
 
 
     pub async fn get_withdraw_private_keys(&self) -> Result<Vec<SecretKey>> {
     pub async fn get_withdraw_private_keys(&self) -> Result<Vec<SecretKey>> {
-        debug!("Getting withdraw private keys");
+        trace!("Getting withdraw private keys");
         let confirm = self.get_value_serialized(&false)?;
         let confirm = self.get_value_serialized(&false)?;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -243,7 +243,7 @@ impl CashierDb {
         &self,
         &self,
         pubkey: &PublicKey,
         pubkey: &PublicKey,
     ) -> Result<Option<WithdrawToken>> {
     ) -> Result<Option<WithdrawToken>> {
-        debug!("Get token address by pubkey");
+        trace!("Get token address by pubkey");
         let d_key_public = self.get_value_serialized(pubkey)?;
         let d_key_public = self.get_value_serialized(pubkey)?;
         let confirm = self.get_value_serialized(&false)?;
         let confirm = self.get_value_serialized(&false)?;
 
 
@@ -277,7 +277,7 @@ impl CashierDb {
         d_key_public: &PublicKey,
         d_key_public: &PublicKey,
         network: &NetworkName,
         network: &NetworkName,
     ) -> Result<Vec<TokenKey>> {
     ) -> Result<Vec<TokenKey>> {
-        debug!("Checking for existing dkey");
+        trace!("Checking for existing dkey");
         let d_key_public = self.get_value_serialized(d_key_public)?;
         let d_key_public = self.get_value_serialized(d_key_public)?;
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
         let confirm = self.get_value_serialized(&false)?;
         let confirm = self.get_value_serialized(&false)?;
@@ -311,7 +311,7 @@ impl CashierDb {
         token_key_public: &[u8],
         token_key_public: &[u8],
         network: &NetworkName,
         network: &NetworkName,
     ) -> Result<Option<Keypair>> {
     ) -> Result<Option<Keypair>> {
-        debug!("Checking for existing token address");
+        trace!("Checking for existing token address");
         let confirm = self.get_value_serialized(&false)?;
         let confirm = self.get_value_serialized(&false)?;
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
 
 
@@ -343,7 +343,7 @@ impl CashierDb {
         token_address: &[u8],
         token_address: &[u8],
         network: &NetworkName,
         network: &NetworkName,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Confirm withdraw keys");
+        trace!("Confirm withdraw keys");
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
         let confirm = self.get_value_serialized(&true)?;
         let confirm = self.get_value_serialized(&true)?;
 
 
@@ -368,7 +368,7 @@ impl CashierDb {
         d_key_public: &PublicKey,
         d_key_public: &PublicKey,
         network: &NetworkName,
         network: &NetworkName,
     ) -> Result<()> {
     ) -> Result<()> {
-        debug!("Confirm deposit keys");
+        trace!("Confirm deposit keys");
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
         let confirm = self.get_value_serialized(&true)?;
         let confirm = self.get_value_serialized(&true)?;
         let d_key_public = self.get_value_serialized(d_key_public)?;
         let d_key_public = self.get_value_serialized(d_key_public)?;
@@ -393,7 +393,7 @@ impl CashierDb {
         &self,
         &self,
         network: &NetworkName,
         network: &NetworkName,
     ) -> Result<Vec<DepositToken>> {
     ) -> Result<Vec<DepositToken>> {
-        debug!("Checking for existing dkey");
+        trace!("Checking for existing dkey");
         let network = self.get_value_serialized(network)?;
         let network = self.get_value_serialized(network)?;
         let confirm = self.get_value_serialized(&false)?;
         let confirm = self.get_value_serialized(&false)?;
 
 

+ 17 - 16
src/wallet/walletdb.rs

@@ -1,7 +1,7 @@
 use std::{fs::create_dir_all, path::Path, str::FromStr};
 use std::{fs::create_dir_all, path::Path, str::FromStr};
 
 
 use async_std::sync::Arc;
 use async_std::sync::Arc;
-use log::{debug, error, info};
+use log::{trace, error, info};
 use rand::rngs::OsRng;
 use rand::rngs::OsRng;
 use sqlx::{
 use sqlx::{
     sqlite::{SqliteConnectOptions, SqliteJournalMode},
     sqlite::{SqliteConnectOptions, SqliteJournalMode},
@@ -45,7 +45,6 @@ impl WalletApi for WalletDb {}
 
 
 impl WalletDb {
 impl WalletDb {
     pub async fn new(path: &str, password: String) -> Result<WalletPtr> {
     pub async fn new(path: &str, password: String) -> Result<WalletPtr> {
-        debug!("new() Constructor called");
         if password.trim().is_empty() {
         if password.trim().is_empty() {
             error!("Password is empty. You must set a password to use the wallet.");
             error!("Password is empty. You must set a password to use the wallet.");
             return Err(Error::from(ClientFailed::EmptyPassword))
             return Err(Error::from(ClientFailed::EmptyPassword))
@@ -77,16 +76,16 @@ impl WalletDb {
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
 
 
-        debug!("Initializing keys table");
+        trace!("Initializing keys table");
         sqlx::query(keys).execute(&mut conn).await?;
         sqlx::query(keys).execute(&mut conn).await?;
 
 
-        debug!("Initializing coins table");
+        trace!("Initializing coins table");
         sqlx::query(coins).execute(&mut conn).await?;
         sqlx::query(coins).execute(&mut conn).await?;
         Ok(())
         Ok(())
     }
     }
 
 
     pub async fn key_gen(&self) -> Result<()> {
     pub async fn key_gen(&self) -> Result<()> {
-        debug!("Attempting to generate keypairs");
+        trace!("Attempting to generate keypairs");
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
 
 
         // TODO: Think about multiple keys
         // TODO: Think about multiple keys
@@ -104,7 +103,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn put_keypair(&self, public: &PublicKey, secret: &SecretKey) -> Result<()> {
     pub async fn put_keypair(&self, public: &PublicKey, secret: &SecretKey) -> Result<()> {
-        debug!("Writing keypair into the wallet database");
+        trace!("Writing keypair into the wallet database");
         let pubkey = serialize(&public.0);
         let pubkey = serialize(&public.0);
         let secret = serialize(&secret.0);
         let secret = serialize(&secret.0);
 
 
@@ -119,7 +118,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn get_keypairs(&self) -> Result<Vec<Keypair>> {
     pub async fn get_keypairs(&self) -> Result<Vec<Keypair>> {
-        debug!("Returning keypairs");
+        trace!("Returning keypairs");
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
 
 
         // TODO: Think about multiple keys
         // TODO: Think about multiple keys
@@ -131,7 +130,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn get_own_coins(&self) -> Result<OwnCoins> {
     pub async fn get_own_coins(&self) -> Result<OwnCoins> {
-        debug!("Finding own coins");
+        trace!("Finding own coins");
         let is_spent = 0;
         let is_spent = 0;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -175,7 +174,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn put_own_coins(&self, own_coin: OwnCoin) -> Result<()> {
     pub async fn put_own_coins(&self, own_coin: OwnCoin) -> Result<()> {
-        debug!("Putting own coin into wallet database");
+        trace!("Putting own coin into wallet database");
         let coin = self.get_value_serialized(&own_coin.coin.to_bytes())?;
         let coin = self.get_value_serialized(&own_coin.coin.to_bytes())?;
         let serial = self.get_value_serialized(&own_coin.note.serial)?;
         let serial = self.get_value_serialized(&own_coin.note.serial)?;
         let coin_blind = self.get_value_serialized(&own_coin.note.coin_blind)?;
         let coin_blind = self.get_value_serialized(&own_coin.note.coin_blind)?;
@@ -211,14 +210,14 @@ impl WalletDb {
     }
     }
 
 
     pub async fn remove_own_coins(&self) -> Result<()> {
     pub async fn remove_own_coins(&self) -> Result<()> {
-        debug!("Removing own coins from wallet database");
+        trace!("Removing own coins from wallet database");
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
         sqlx::query("DROP TABLE coins;").execute(&mut conn).await?;
         sqlx::query("DROP TABLE coins;").execute(&mut conn).await?;
         Ok(())
         Ok(())
     }
     }
 
 
     pub async fn confirm_spend_coin(&self, coin: &Coin) -> Result<()> {
     pub async fn confirm_spend_coin(&self, coin: &Coin) -> Result<()> {
-        debug!("Confirm spend coin");
+        trace!("Confirm spend coin");
         let is_spent = 1;
         let is_spent = 1;
         let coin = self.get_value_serialized(coin)?;
         let coin = self.get_value_serialized(coin)?;
 
 
@@ -233,7 +232,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn get_balances(&self) -> Result<Balances> {
     pub async fn get_balances(&self) -> Result<Balances> {
-        debug!("Getting tokens and balances");
+        trace!("Getting tokens and balances");
         let is_spent = 0;
         let is_spent = 0;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -253,14 +252,15 @@ impl WalletDb {
         }
         }
 
 
         if list.is_empty() {
         if list.is_empty() {
-            debug!("Did not find any unspent coins");
+            trace!("Did not find any unspent coins");
+
         }
         }
 
 
         Ok(Balances { list })
         Ok(Balances { list })
     }
     }
 
 
     pub async fn get_token_id(&self) -> Result<Vec<DrkTokenId>> {
     pub async fn get_token_id(&self) -> Result<Vec<DrkTokenId>> {
-        debug!("Getting token ID");
+        trace!("Getting token ID");
         let is_spent = 0;
         let is_spent = 0;
 
 
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
@@ -279,7 +279,8 @@ impl WalletDb {
     }
     }
 
 
     pub async fn token_id_exists(&self, token_id: DrkTokenId) -> Result<bool> {
     pub async fn token_id_exists(&self, token_id: DrkTokenId) -> Result<bool> {
-        debug!("Checking if token ID exists");
+        trace!("Checking if token ID exists");
+    
         let is_spent = 0;
         let is_spent = 0;
         let id = self.get_value_serialized(&token_id)?;
         let id = self.get_value_serialized(&token_id)?;
 
 
@@ -295,7 +296,7 @@ impl WalletDb {
     }
     }
 
 
     pub async fn test_wallet(&self) -> Result<()> {
     pub async fn test_wallet(&self) -> Result<()> {
-        debug!("Testing wallet");
+        trace!("Testing wallet");
         let mut conn = self.conn.acquire().await?;
         let mut conn = self.conn.acquire().await?;
         let _row = sqlx::query("SELECT * FROM keys").fetch_one(&mut conn).await?;
         let _row = sqlx::query("SELECT * FROM keys").fetch_one(&mut conn).await?;
         Ok(())
         Ok(())