@@ -48,29 +48,30 @@ where
48
48
}
49
49
}
50
50
51
- #[ cfg( feature = "test-utils" ) ]
51
+ #[ cfg( any ( test , feature = "test-utils" ) ) ]
52
52
#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait:: async_trait) ]
53
53
#[ cfg_attr( target_arch = "wasm32" , async_trait:: async_trait( ?Send ) ) ]
54
54
#[ allow( clippy:: unwrap_used) ]
55
55
impl xmtp_proto:: api_client:: XmtpTestClient for crate :: XmtpHttpApiClient {
56
- async fn create_local ( ) -> Self {
56
+ type Builder = crate :: XmtpHttpApiClientBuilder ;
57
+ async fn create_local ( ) -> Self :: Builder {
57
58
use xmtp_proto:: api_client:: ApiBuilder ;
58
59
let mut api = crate :: XmtpHttpApiClient :: builder ( ) ;
59
60
api. set_host ( crate :: constants:: ApiUrls :: LOCAL_ADDRESS . into ( ) ) ;
60
61
api. set_libxmtp_version ( env ! ( "CARGO_PKG_VERSION" ) . into ( ) )
61
62
. unwrap ( ) ;
62
63
api. set_app_version ( "0.0.0" . into ( ) ) . unwrap ( ) ;
63
- api. build ( ) . await . unwrap ( )
64
+ api
64
65
}
65
66
66
- async fn create_dev ( ) -> Self {
67
+ async fn create_dev ( ) -> Self :: Builder {
67
68
use xmtp_proto:: api_client:: ApiBuilder ;
68
69
let mut api = crate :: XmtpHttpApiClient :: builder ( ) ;
69
70
api. set_host ( crate :: constants:: ApiUrls :: DEV_ADDRESS . into ( ) ) ;
70
71
api. set_libxmtp_version ( env ! ( "CARGO_PKG_VERSION" ) . into ( ) )
71
72
. unwrap ( ) ;
72
73
api. set_app_version ( "0.0.0" . into ( ) ) . unwrap ( ) ;
73
- api. build ( ) . await . unwrap ( )
74
+ api
74
75
}
75
76
}
76
77
0 commit comments