@@ -90,9 +90,30 @@ pub use wasm::*;
90
90
#[ cfg( not( target_arch = "wasm32" ) ) ]
91
91
mod not_wasm {
92
92
use super :: * ;
93
+ use xmtp_proto:: api_client:: ApiBuilder ;
93
94
use xmtp_proto:: xmtp:: mls:: api:: v1:: WelcomeMessage ;
94
95
#[ derive( Clone ) ]
95
96
pub struct ApiClient ;
97
+ pub struct MockApiBuilder ;
98
+
99
+ impl ApiBuilder for MockApiBuilder {
100
+ type Output = ApiClient ;
101
+ type Error = MockError ;
102
+
103
+ fn set_libxmtp_version ( & mut self , version : String ) -> Result < ( ) , Self :: Error > {
104
+ Ok ( ( ) )
105
+ }
106
+ fn set_app_version ( & mut self , version : String ) -> Result < ( ) , Self :: Error > {
107
+ Ok ( ( ) )
108
+ }
109
+ fn set_host ( & mut self , host : String ) {
110
+ }
111
+ fn set_payer ( & mut self , _host : String ) { }
112
+ fn set_tls ( & mut self , tls : bool ) { }
113
+ async fn build ( self ) -> Result < Self :: Output , Self :: Error > {
114
+ Ok ( ApiClient )
115
+ }
116
+ }
96
117
97
118
mock ! {
98
119
pub ApiClient { }
@@ -142,11 +163,10 @@ mod not_wasm {
142
163
-> Result <VerifySmartContractWalletSignaturesResponse , MockError >;
143
164
}
144
165
145
- #[ async_trait:: async_trait]
146
166
impl XmtpTestClient for ApiClient {
147
- type Builder = ApiClient ;
148
- async fn create_local( ) -> Self { ApiClient }
149
- async fn create_dev( ) -> Self { ApiClient }
167
+ type Builder = MockApiBuilder ;
168
+ fn create_local( ) -> MockApiBuilder { MockApiBuilder }
169
+ fn create_dev( ) -> MockApiBuilder { MockApiBuilder }
150
170
}
151
171
}
152
172
}
@@ -208,9 +228,9 @@ mod wasm {
208
228
209
229
#[ async_trait:: async_trait( ?Send ) ]
210
230
impl XmtpTestClient for ApiClient {
211
- type Builder = ApiClient ;
212
- async fn create_local( ) -> Self { ApiClient }
213
- async fn create_dev( ) -> Self { ApiClient }
231
+ type Builder = ( ) ;
232
+ fn create_local( ) -> ( ) { ( ) }
233
+ fn create_dev( ) -> ( ) { ( ) }
214
234
}
215
235
}
216
236
}
0 commit comments