@@ -68,12 +68,10 @@ fn reqwest_client() -> reqwest::Client {
6868pub struct ClientWrapper {
6969 binary_path : sync:: Mutex < Option < PathBuf > > ,
7070 testing_prng_seed : Option < u64 > ,
71- storage : String ,
72- wallet : String ,
73- keystore : String ,
7471 max_pending_message_bundles : usize ,
7572 network : Network ,
7673 pub path_provider : PathProvider ,
74+ wallet_id : usize ,
7775 on_drop : OnClientDrop ,
7876 extra_args : Vec < String > ,
7977}
@@ -92,14 +90,14 @@ impl ClientWrapper {
9290 path_provider : PathProvider ,
9391 network : Network ,
9492 testing_prng_seed : Option < u64 > ,
95- id : usize ,
93+ wallet_id : usize ,
9694 on_drop : OnClientDrop ,
9795 ) -> Self {
9896 Self :: new_with_extra_args (
9997 path_provider,
10098 network,
10199 testing_prng_seed,
102- id ,
100+ wallet_id ,
103101 on_drop,
104102 vec ! [ "--wait-for-outgoing-messages" . to_string( ) ] ,
105103 )
@@ -109,26 +107,17 @@ impl ClientWrapper {
109107 path_provider : PathProvider ,
110108 network : Network ,
111109 testing_prng_seed : Option < u64 > ,
112- id : usize ,
110+ wallet_id : usize ,
113111 on_drop : OnClientDrop ,
114112 extra_args : Vec < String > ,
115113 ) -> Self {
116- let storage = format ! (
117- "rocksdb:{}/client_{}.db" ,
118- path_provider. path( ) . display( ) ,
119- id
120- ) ;
121- let wallet = format ! ( "wallet_{}.json" , id) ;
122- let keystore = format ! ( "keystore_{}.json" , id) ;
123114 Self {
124115 binary_path : sync:: Mutex :: new ( None ) ,
125116 testing_prng_seed,
126- storage,
127- wallet,
128- keystore,
129117 max_pending_message_bundles : 10_000 ,
130118 network,
131119 path_provider,
120+ wallet_id,
132121 on_drop,
133122 extra_args,
134123 }
@@ -234,12 +223,10 @@ impl ClientWrapper {
234223
235224 fn required_command_arguments ( & self ) -> impl Iterator < Item = Cow < ' _ , str > > + ' _ {
236225 [
237- "--wallet" . into ( ) ,
238- self . wallet . as_str ( ) . into ( ) ,
239- "--keystore" . into ( ) ,
240- self . keystore . as_str ( ) . into ( ) ,
241- "--storage" . into ( ) ,
242- self . storage . as_str ( ) . into ( ) ,
226+ "--home-directory" . into ( ) ,
227+ self . path_provider . path ( ) . display ( ) . to_string ( ) . into ( ) ,
228+ "--with-wallet" . into ( ) ,
229+ self . wallet_id . to_string ( ) . into ( ) ,
243230 "--send-timeout-ms" . into ( ) ,
244231 "500000" . into ( ) ,
245232 "--recv-timeout-ms" . into ( ) ,
@@ -982,15 +969,17 @@ impl ClientWrapper {
982969 }
983970
984971 pub fn wallet_path ( & self ) -> PathBuf {
985- self . path_provider . path ( ) . join ( & self . wallet )
972+ self . path_provider
973+ . path ( )
974+ . join ( self . wallet_id . to_string ( ) )
975+ . join ( "wallet.json" )
986976 }
987977
988978 pub fn keystore_path ( & self ) -> PathBuf {
989- self . path_provider . path ( ) . join ( & self . keystore )
990- }
991-
992- pub fn storage_path ( & self ) -> & str {
993- & self . storage
979+ self . path_provider
980+ . path ( )
981+ . join ( self . wallet_id . to_string ( ) )
982+ . join ( "keystore.json" )
994983 }
995984
996985 pub fn get_owner ( & self ) -> Option < AccountOwner > {
0 commit comments