Просмотр исходного кода

create walletdb field for state and avoid using walletdb in other places

ghassmo 4 лет назад
Родитель
Сommit
491762dfa8
5 измененных файлов с 68 добавлено и 76 удалено
  1. 7 7
      src/bin/cashierd.rs
  2. 1 2
      src/bin/darkfid.rs
  3. 21 26
      src/client/client.rs
  4. 36 33
      src/rpc/adapters/client_adapter.rs
  5. 3 8
      src/service/cashier.rs

+ 7 - 7
src/bin/cashierd.rs

@@ -28,6 +28,11 @@ async fn start(executor: Arc<Executor<'_>>, config: Arc<CashierdConfig>) -> Resu
         config.password.clone(),
         config.password.clone(),
     )?);
     )?);
 
 
+    let client_wallet = Arc::new(WalletDb::new(
+        &PathBuf::from(&config.client_walletdb_path),
+        config.client_password.clone(),
+    )?);
+
     let mint_params_path = join_config_path(&PathBuf::from("cashier_mint.params"))?;
     let mint_params_path = join_config_path(&PathBuf::from("cashier_mint.params"))?;
     let spend_params_path = join_config_path(&PathBuf::from("cashier_spend.params"))?;
     let spend_params_path = join_config_path(&PathBuf::from("cashier_spend.params"))?;
 
 
@@ -35,19 +40,14 @@ async fn start(executor: Arc<Executor<'_>>, config: Arc<CashierdConfig>) -> Resu
         accept_addr,
         accept_addr,
         btc_endpoint,
         btc_endpoint,
         wallet.clone(),
         wallet.clone(),
+        client_wallet.clone(),
         database_path,
         database_path,
         (gateway_addr, "127.0.0.1:4444".parse()?),
         (gateway_addr, "127.0.0.1:4444".parse()?),
         (mint_params_path, spend_params_path),
         (mint_params_path, spend_params_path),
-        PathBuf::from(&config.client_walletdb_path),
     )
     )
     .await?;
     .await?;
 
 
-    let client_wallet = Arc::new(WalletDb::new(
-        &PathBuf::from(&config.client_walletdb_path),
-        config.client_password.clone(),
-    )?);
-
-    cashier.start(ex.clone(), client_wallet.clone()).await?;
+    cashier.start(ex.clone()).await?;
 
 
     //let rpc_url: std::net::SocketAddr = config.rpc_url.parse()?;
     //let rpc_url: std::net::SocketAddr = config.rpc_url.parse()?;
     //let adapter = Arc::new(CashierAdapter::new(wallet.clone())?);
     //let adapter = Arc::new(CashierAdapter::new(wallet.clone())?);

+ 1 - 2
src/bin/darkfid.rs

@@ -47,7 +47,7 @@ async fn start(executor: Arc<Executor<'_>>, config: Arc<DarkfidConfig>) -> Resul
         rocks,
         rocks,
         (connect_addr, sub_addr),
         (connect_addr, sub_addr),
         (mint_params_path, spend_params_path),
         (mint_params_path, spend_params_path),
-        walletdb_path,
+        wallet.clone(),
     )?;
     )?;
 
 
     client.start().await?;
     client.start().await?;
@@ -55,7 +55,6 @@ async fn start(executor: Arc<Executor<'_>>, config: Arc<DarkfidConfig>) -> Resul
     Client::connect_to_cashier(
     Client::connect_to_cashier(
         client,
         client,
         executor.clone(),
         executor.clone(),
-        wallet.clone(),
         cashier_addr.clone(),
         cashier_addr.clone(),
         rpc_url.clone(),
         rpc_url.clone(),
     )
     )

+ 21 - 26
src/client/client.rs

@@ -22,7 +22,6 @@ use async_executor::Executor;
 use bellman::groth16;
 use bellman::groth16;
 use bls12_381::Bls12;
 use bls12_381::Bls12;
 use log::*;
 use log::*;
-use rusqlite::Connection;
 
 
 use jsonrpc_core::IoHandler;
 use jsonrpc_core::IoHandler;
 
 
@@ -31,7 +30,7 @@ use std::net::SocketAddr;
 use std::path::PathBuf;
 use std::path::PathBuf;
 
 
 pub struct Client {
 pub struct Client {
-    state: State,
+    pub state: State,
     secret: jubjub::Fr,
     secret: jubjub::Fr,
     mint_params: bellman::groth16::Parameters<Bls12>,
     mint_params: bellman::groth16::Parameters<Bls12>,
     spend_params: bellman::groth16::Parameters<Bls12>,
     spend_params: bellman::groth16::Parameters<Bls12>,
@@ -44,7 +43,7 @@ impl Client {
         rocks: Arc<Rocks>,
         rocks: Arc<Rocks>,
         gateway_addrs: (SocketAddr, SocketAddr),
         gateway_addrs: (SocketAddr, SocketAddr),
         params_paths: (PathBuf, PathBuf),
         params_paths: (PathBuf, PathBuf),
-        wallet_path: PathBuf,
+        wallet: WalletPtr,
     ) -> Result<Self> {
     ) -> Result<Self> {
         let slabstore = RocksColumn::<columns::Slabs>::new(rocks.clone());
         let slabstore = RocksColumn::<columns::Slabs>::new(rocks.clone());
         let merkle_roots = RocksColumn::<columns::MerkleRoots>::new(rocks.clone());
         let merkle_roots = RocksColumn::<columns::MerkleRoots>::new(rocks.clone());
@@ -73,7 +72,7 @@ impl Client {
             nullifiers,
             nullifiers,
             mint_pvk,
             mint_pvk,
             spend_pvk,
             spend_pvk,
-            wallet_path,
+            wallet
         };
         };
 
 
         // create gateway client
         // create gateway client
@@ -97,7 +96,6 @@ impl Client {
     pub async fn connect_to_cashier(
     pub async fn connect_to_cashier(
         client: Client,
         client: Client,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
-        wallet: WalletPtr,
         cashier_addr: SocketAddr,
         cashier_addr: SocketAddr,
         rpc_url: SocketAddr,
         rpc_url: SocketAddr,
     ) -> Result<()> {
     ) -> Result<()> {
@@ -114,7 +112,7 @@ impl Client {
         let mut io = IoHandler::new();
         let mut io = IoHandler::new();
 
 
         let rpc_client_adapter =
         let rpc_client_adapter =
-            RpcClientAdapter::new(wallet.clone(), client_mutex.clone(), cashier_mutex.clone());
+            RpcClientAdapter::new(client_mutex.clone(), cashier_mutex.clone());
 
 
         io.extend_with(rpc_client_adapter.to_delegate());
         io.extend_with(rpc_client_adapter.to_delegate());
 
 
@@ -125,7 +123,7 @@ impl Client {
         let _ = jsonserver::start(executor.clone(), rpc_url, io).await?;
         let _ = jsonserver::start(executor.clone(), rpc_url, io).await?;
 
 
         // start subscriber
         // start subscriber
-        Client::connect_to_subscriber(client_mutex.clone(), executor.clone(), wallet.clone())
+        Client::connect_to_subscriber(client_mutex.clone(), executor.clone())
             .await?;
             .await?;
 
 
         Ok(())
         Ok(())
@@ -135,7 +133,6 @@ impl Client {
         self: &mut Client,
         self: &mut Client,
         pub_key: String,
         pub_key: String,
         amount: f64,
         amount: f64,
-        wallet: WalletPtr,
     ) -> Result<()> {
     ) -> Result<()> {
         let address = bs58::decode(pub_key.clone())
         let address = bs58::decode(pub_key.clone())
             .into_vec()
             .into_vec()
@@ -149,7 +146,7 @@ impl Client {
         }
         }
 
 
         // check if there are coins
         // check if there are coins
-        let own_coins = wallet.get_own_coins()?;
+        let own_coins = self.state.wallet.get_own_coins()?;
 
 
         if own_coins.is_empty() {
         if own_coins.is_empty() {
             return Err(ClientFailed::NotEnoughValue(0).into());
             return Err(ClientFailed::NotEnoughValue(0).into());
@@ -192,7 +189,6 @@ impl Client {
     pub async fn connect_to_subscriber(
     pub async fn connect_to_subscriber(
         client: Arc<Mutex<Client>>,
         client: Arc<Mutex<Client>>,
         executor: Arc<Executor<'_>>,
         executor: Arc<Executor<'_>>,
-        wallet: WalletPtr,
     ) -> Result<()> {
     ) -> Result<()> {
         // start subscribing
         // start subscribing
         debug!(target: "CLIENT", "Start subscriber");
         debug!(target: "CLIENT", "Start subscriber");
@@ -208,7 +204,7 @@ impl Client {
             let tx = tx::Transaction::decode(&slab.get_payload()[..])?;
             let tx = tx::Transaction::decode(&slab.get_payload()[..])?;
             let mut client = client.lock().await;
             let mut client = client.lock().await;
             let update = state_transition(&client.state, tx)?;
             let update = state_transition(&client.state, tx)?;
-            client.state.apply(update, wallet.clone()).await?;
+            client.state.apply(update).await?;
         }
         }
     }
     }
 }
 }
@@ -225,19 +221,19 @@ pub struct State {
     pub mint_pvk: groth16::PreparedVerifyingKey<Bls12>,
     pub mint_pvk: groth16::PreparedVerifyingKey<Bls12>,
     // Spend verifying key used by ZK
     // Spend verifying key used by ZK
     pub spend_pvk: groth16::PreparedVerifyingKey<Bls12>,
     pub spend_pvk: groth16::PreparedVerifyingKey<Bls12>,
-    // TODO: remove this
-    wallet_path: PathBuf,
+    pub wallet: WalletPtr,
 }
 }
 
 
 impl ProgramState for State {
 impl ProgramState for State {
     fn is_valid_cashier_public_key(&self, _public: &jubjub::SubgroupPoint) -> bool {
     fn is_valid_cashier_public_key(&self, _public: &jubjub::SubgroupPoint) -> bool {
-        // TODO: use walletdb instead of connecting with sqlite directly
-        let conn = Connection::open(self.wallet_path.clone()).expect("Connect to database");
-        let mut stmt = conn
-            .prepare("SELECT key_public FROM cashier WHERE key_public IN (SELECT key_public)")
-            .expect("Generate statement");
-        stmt.exists([1i32]).expect("Read database")
+        // TODO create a function in walletdb to check if it's a valid cashier public key
+        //let conn = Connection::open(self.wallet_path.clone()).expect("Connect to database");
+        //let mut stmt = conn
+        //    .prepare("SELECT key_public FROM cashier WHERE key_public IN (SELECT key_public)")
+        //    .expect("Generate statement");
+        //stmt.exists([1i32]).expect("Read database")
         // do actual validity check
         // do actual validity check
+        true
     }
     }
 
 
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
@@ -263,7 +259,7 @@ impl ProgramState for State {
 }
 }
 
 
 impl State {
 impl State {
-    pub async fn apply(&mut self, update: StateUpdate, wallet: WalletPtr) -> Result<()> {
+    pub async fn apply(&mut self, update: StateUpdate) -> Result<()> {
         // Extend our list of nullifiers with the ones from the update
         // Extend our list of nullifiers with the ones from the update
         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>)?;
@@ -279,12 +275,12 @@ impl State {
             self.merkle_roots.put(self.tree.root(), vec![] as Vec<u8>)?;
             self.merkle_roots.put(self.tree.root(), vec![] as Vec<u8>)?;
 
 
             // Also update all the coin witnesses
             // Also update all the coin witnesses
-            for (coin_id, witness) in wallet.get_witnesses()?.iter_mut() {
+            for (coin_id, witness) in self.wallet.get_witnesses()?.iter_mut() {
                 witness.append(node).expect("Append to witness");
                 witness.append(node).expect("Append to witness");
-                wallet.update_witness(coin_id.clone(), witness.clone())?;
+                self.wallet.update_witness(coin_id.clone(), witness.clone())?;
             }
             }
 
 
-            if let Some((note, secret)) = self.try_decrypt_note(wallet.clone(), enc_note).await {
+            if let Some((note, secret)) = self.try_decrypt_note(enc_note).await {
                 // We need to keep track of the witness for this coin.
                 // We need to keep track of the witness for this coin.
                 // This allows us to prove inclusion of the coin in the merkle tree with ZK.
                 // This allows us to prove inclusion of the coin in the merkle tree with ZK.
                 // Just as we update the merkle tree with every new coin, so we do the same with
                 // Just as we update the merkle tree with every new coin, so we do the same with
@@ -297,7 +293,7 @@ impl State {
                 // Make a new witness for this coin
                 // Make a new witness for this coin
                 let witness = IncrementalWitness::from_tree(&self.tree);
                 let witness = IncrementalWitness::from_tree(&self.tree);
 
 
-                wallet.put_own_coins(coin.clone(), note.clone(),  secret, witness.clone())?;
+                self.wallet.put_own_coins(coin.clone(), note.clone(),  secret, witness.clone())?;
             }
             }
         }
         }
         Ok(())
         Ok(())
@@ -305,10 +301,9 @@ impl State {
 
 
     async fn try_decrypt_note(
     async fn try_decrypt_note(
         &self,
         &self,
-        wallet: WalletPtr,
         ciphertext: EncryptedNote,
         ciphertext: EncryptedNote,
     ) -> Option<(Note, jubjub::Fr)> {
     ) -> Option<(Note, jubjub::Fr)> {
-        let secret = wallet.get_private().ok()?;
+        let secret = self.wallet.get_private().ok()?;
         match ciphertext.decrypt(&secret) {
         match ciphertext.decrypt(&secret) {
             Ok(note) => {
             Ok(note) => {
                 // ... and return the decrypted note for this coin.
                 // ... and return the decrypted note for this coin.

+ 36 - 33
src/rpc/adapters/client_adapter.rs

@@ -1,7 +1,6 @@
 use crate::client::{Client, ClientFailed};
 use crate::client::{Client, ClientFailed};
 use crate::serial::serialize;
 use crate::serial::serialize;
 use crate::service::CashierClient;
 use crate::service::CashierClient;
-use crate::wallet::WalletPtr;
 use crate::{Error, Result};
 use crate::{Error, Result};
 
 
 use jsonrpc_core::BoxFuture;
 use jsonrpc_core::BoxFuture;
@@ -20,15 +19,15 @@ pub trait RpcClient {
 
 
     /// get key
     /// get key
     #[rpc(name = "get_key")]
     #[rpc(name = "get_key")]
-    fn get_key(&self) -> Result<String>;
+    fn get_key(&self) -> BoxFuture<Result<String>>;
 
 
     /// create wallet
     /// create wallet
     #[rpc(name = "create_wallet")]
     #[rpc(name = "create_wallet")]
-    fn create_wallet(&self) -> Result<String>;
+    fn create_wallet(&self) -> BoxFuture<Result<String>>;
 
 
     /// key gen
     /// key gen
     #[rpc(name = "key_gen")]
     #[rpc(name = "key_gen")]
-    fn key_gen(&self) -> Result<String>;
+    fn key_gen(&self) -> BoxFuture<Result<String>>;
 
 
     /// transfer
     /// transfer
     #[rpc(name = "transfer")]
     #[rpc(name = "transfer")]
@@ -44,34 +43,47 @@ pub trait RpcClient {
 }
 }
 
 
 pub struct RpcClientAdapter {
 pub struct RpcClientAdapter {
-    wallet: WalletPtr,
     client: Arc<Mutex<Client>>,
     client: Arc<Mutex<Client>>,
     cashier_client: Arc<Mutex<CashierClient>>,
     cashier_client: Arc<Mutex<CashierClient>>,
 }
 }
 
 
 impl RpcClientAdapter {
 impl RpcClientAdapter {
-    pub fn new(
-        wallet: WalletPtr,
-        client: Arc<Mutex<Client>>,
-        cashier_client: Arc<Mutex<CashierClient>>,
-    ) -> Self {
+    pub fn new(client: Arc<Mutex<Client>>, cashier_client: Arc<Mutex<CashierClient>>) -> Self {
         Self {
         Self {
-            wallet,
             client,
             client,
             cashier_client,
             cashier_client,
         }
         }
     }
     }
 
 
+    async fn get_key_process(client: Arc<Mutex<Client>>) -> Result<String> {
+        let key_public = client.lock().await.state.wallet.get_public()?;
+        let bs58_address = bs58::encode(serialize(&key_public)).into_string();
+        Ok(bs58_address)
+    }
+
+    async fn create_wallet_process(client: Arc<Mutex<Client>>) -> Result<String> {
+        client.lock().await.state.wallet.init_db()?;
+        Ok("wallet creation successful".into())
+    }
+
+    async fn key_gen_process(client: Arc<Mutex<Client>>) -> Result<String> {
+        let client =  client.lock().await;
+        let (public, private) = client.state.wallet.key_gen();
+        debug!(target: "RPC USER ADAPTER", "Created keypair...");
+        debug!(target: "RPC USER ADAPTER", "Attempting to write to database...");
+        client.state.wallet.put_keypair(public, private)?;
+        Ok("key generation successful".into())
+    }
+
     async fn transfer_process(
     async fn transfer_process(
         client: Arc<Mutex<Client>>,
         client: Arc<Mutex<Client>>,
-        wallet: WalletPtr,
         address: String,
         address: String,
         amount: f64,
         amount: f64,
     ) -> Result<String> {
     ) -> Result<String> {
         client
         client
             .lock()
             .lock()
             .await
             .await
-            .transfer(address.clone(), amount, wallet.clone())
+            .transfer(address.clone(), amount)
             .await?;
             .await?;
 
 
         Ok(format!("transfered {} DRK to {}", amount, address))
         Ok(format!("transfered {} DRK to {}", amount, address))
@@ -80,7 +92,6 @@ impl RpcClientAdapter {
     async fn withdraw_process(
     async fn withdraw_process(
         client: Arc<Mutex<Client>>,
         client: Arc<Mutex<Client>>,
         cashier_client: Arc<Mutex<CashierClient>>,
         cashier_client: Arc<Mutex<CashierClient>>,
-        wallet: WalletPtr,
         address: String,
         address: String,
         amount: f64,
         amount: f64,
     ) -> Result<String> {
     ) -> Result<String> {
@@ -97,7 +108,7 @@ impl RpcClientAdapter {
             client
             client
                 .lock()
                 .lock()
                 .await
                 .await
-                .transfer(drk_addr.clone(), amount, wallet.clone())
+                .transfer(drk_addr.clone(), amount)
                 .await?;
                 .await?;
 
 
             return Ok(format!(
             return Ok(format!(
@@ -110,10 +121,10 @@ impl RpcClientAdapter {
     }
     }
 
 
     async fn deposit_process(
     async fn deposit_process(
+        client: Arc<Mutex<Client>>,
         cashier_client: Arc<Mutex<CashierClient>>,
         cashier_client: Arc<Mutex<CashierClient>>,
-        wallet: WalletPtr,
     ) -> Result<String> {
     ) -> Result<String> {
-        let deposit_addr = wallet.get_public()?;
+        let deposit_addr = client.lock().await.state.wallet.get_public()?;
         let btc_public = cashier_client
         let btc_public = cashier_client
             .lock()
             .lock()
             .await
             .await
@@ -135,31 +146,24 @@ impl RpcClient for RpcClientAdapter {
         Ok(String::from("hello world"))
         Ok(String::from("hello world"))
     }
     }
 
 
-    fn get_key(&self) -> Result<String> {
+    fn get_key(&self) -> BoxFuture<Result<String>> {
         debug!(target: "RPC USER ADAPTER", "get_key() [START]");
         debug!(target: "RPC USER ADAPTER", "get_key() [START]");
-        let key_public = self.wallet.get_public()?;
-        let bs58_address = bs58::encode(serialize(&key_public)).into_string();
-        Ok(bs58_address)
+        Self::get_key_process(self.client.clone()).boxed()
     }
     }
 
 
-    fn create_wallet(&self) -> Result<String> {
+    fn create_wallet(&self) -> BoxFuture<Result<String>> {
         debug!(target: "RPC USER ADAPTER", "create_wallet() [START]");
         debug!(target: "RPC USER ADAPTER", "create_wallet() [START]");
-        self.wallet.init_db()?;
-        Ok("wallet creation successful".into())
+        Self::create_wallet_process(self.client.clone()).boxed()
     }
     }
 
 
-    fn key_gen(&self) -> Result<String> {
+    fn key_gen(&self) -> BoxFuture<Result<String>> {
         debug!(target: "RPC USER ADAPTER", "key_gen() [START]");
         debug!(target: "RPC USER ADAPTER", "key_gen() [START]");
-        let (public, private) = self.wallet.key_gen();
-        debug!(target: "RPC USER ADAPTER", "Created keypair...");
-        debug!(target: "RPC USER ADAPTER", "Attempting to write to database...");
-        self.wallet.put_keypair(public, private)?;
-        Ok("key generation successful".into())
+        Self::key_gen_process(self.client.clone()).boxed()
     }
     }
 
 
     fn transfer(&self, pub_key: String, amount: f64) -> BoxFuture<Result<String>> {
     fn transfer(&self, pub_key: String, amount: f64) -> BoxFuture<Result<String>> {
         debug!(target: "RPC USER ADAPTER", "transfer() [START]");
         debug!(target: "RPC USER ADAPTER", "transfer() [START]");
-        Self::transfer_process(self.client.clone(), self.wallet.clone(), pub_key, amount).boxed()
+        Self::transfer_process(self.client.clone(), pub_key, amount).boxed()
     }
     }
 
 
     fn withdraw(&self, pub_key: String, amount: f64) -> BoxFuture<Result<String>> {
     fn withdraw(&self, pub_key: String, amount: f64) -> BoxFuture<Result<String>> {
@@ -167,7 +171,6 @@ impl RpcClient for RpcClientAdapter {
         Self::withdraw_process(
         Self::withdraw_process(
             self.client.clone(),
             self.client.clone(),
             self.cashier_client.clone(),
             self.cashier_client.clone(),
-            self.wallet.clone(),
             pub_key,
             pub_key,
             amount,
             amount,
         )
         )
@@ -176,6 +179,6 @@ impl RpcClient for RpcClientAdapter {
 
 
     fn deposit(&self) -> BoxFuture<Result<String>> {
     fn deposit(&self) -> BoxFuture<Result<String>> {
         debug!(target: "RPC USER ADAPTER", "deposit() [START]");
         debug!(target: "RPC USER ADAPTER", "deposit() [START]");
-        Self::deposit_process(self.cashier_client.clone(), self.wallet.clone()).boxed()
+        Self::deposit_process(self.client.clone(), self.cashier_client.clone()).boxed()
     }
     }
 }
 }

+ 3 - 8
src/service/cashier.rs

@@ -40,10 +40,10 @@ impl CashierService {
         addr: SocketAddr,
         addr: SocketAddr,
         btc_endpoint: String,
         btc_endpoint: String,
         wallet: CashierDbPtr,
         wallet: CashierDbPtr,
+        client_wallet: WalletPtr,
         cashier_database_path: PathBuf,
         cashier_database_path: PathBuf,
         gateway_addrs: (SocketAddr, SocketAddr),
         gateway_addrs: (SocketAddr, SocketAddr),
         params_paths: (PathBuf, PathBuf),
         params_paths: (PathBuf, PathBuf),
-        client_wallet_path: PathBuf,
     ) -> Result<CashierService> {
     ) -> Result<CashierService> {
         // Pull address from config later
         // Pull address from config later
         let client_address = btc_endpoint;
         let client_address = btc_endpoint;
@@ -69,7 +69,7 @@ impl CashierService {
             rocks,
             rocks,
             gateway_addrs,
             gateway_addrs,
             params_paths,
             params_paths,
-            client_wallet_path.clone(),
+            client_wallet.clone(),
         )?;
         )?;
 
 
         let client = Arc::new(Mutex::new(client));
         let client = Arc::new(Mutex::new(client));
@@ -81,11 +81,7 @@ impl CashierService {
             client,
             client,
         })
         })
     }
     }
-    pub async fn start(
-        &mut self,
-        executor: Arc<Executor<'_>>,
-        client_wallet: WalletPtr,
-    ) -> Result<()> {
+    pub async fn start(&mut self, executor: Arc<Executor<'_>>) -> Result<()> {
         debug!(target: "CASHIER DAEMON", "Start Cashier");
         debug!(target: "CASHIER DAEMON", "Start Cashier");
         let service_name = String::from("CASHIER DAEMON");
         let service_name = String::from("CASHIER DAEMON");
 
 
@@ -109,7 +105,6 @@ impl CashierService {
         let cashier_client_subscriber_task = executor.spawn(Client::connect_to_subscriber(
         let cashier_client_subscriber_task = executor.spawn(Client::connect_to_subscriber(
             self.client.clone(),
             self.client.clone(),
             executor.clone(),
             executor.clone(),
-            client_wallet,
         ));
         ));
 
 
         protocol.run(executor.clone()).await?;
         protocol.run(executor.clone()).await?;