1
- #[ cfg( feature = "online -testing" ) ]
1
+ #[ cfg( not ( feature = "offline -testing" ) ) ]
2
2
mod tests {
3
- use dapi_grpc:: {
4
- platform:: v0:: {
5
- self as platform_proto, get_identity_response, GetIdentityResponse , ResponseMetadata ,
6
- } ,
7
- tonic:: transport:: Uri ,
3
+ use dapi_grpc:: platform:: v0:: {
4
+ self as platform_proto, get_identity_response, GetIdentityResponse , ResponseMetadata ,
8
5
} ;
9
6
use rs_dapi_client:: { AddressList , DapiClient , DapiRequest , RequestSettings } ;
7
+ use std:: str:: FromStr ;
10
8
11
9
pub const OWNER_ID_BYTES : [ u8 ; 32 ] = [
12
10
65 , 63 , 57 , 243 , 204 , 9 , 106 , 71 , 187 , 2 , 94 , 221 , 190 , 127 , 141 , 114 , 137 , 209 , 243 , 50 ,
@@ -15,10 +13,10 @@ mod tests {
15
13
16
14
#[ tokio:: test]
17
15
async fn get_identity ( ) {
18
- let mut address_list = AddressList :: new ( ) ;
19
- address_list . add_uri ( Uri :: from_static ( "http://127.0.0.1:2443" ) ) ;
16
+ let address_list =
17
+ AddressList :: from_str ( "http://127.0.0.1:2443" ) . expect ( "unable to parse address list" ) ;
20
18
21
- let mut client = DapiClient :: new ( address_list, RequestSettings :: default ( ) ) ;
19
+ let client = DapiClient :: new ( address_list, RequestSettings :: default ( ) ) ;
22
20
let request = platform_proto:: GetIdentityRequest {
23
21
version : Some ( platform_proto:: get_identity_request:: Version :: V0 (
24
22
platform_proto:: get_identity_request:: GetIdentityRequestV0 {
@@ -39,9 +37,10 @@ mod tests {
39
37
} ) ,
40
38
} ) ) ,
41
39
} = request
42
- . execute ( & mut client, RequestSettings :: default ( ) )
40
+ . execute ( & client, RequestSettings :: default ( ) )
43
41
. await
44
42
. expect ( "unable to perform dapi request" )
43
+ . inner
45
44
{
46
45
assert ! ( !bytes. is_empty( ) ) ;
47
46
assert_eq ! ( protocol_version, 1 ) ;
0 commit comments