@@ -18,6 +18,7 @@ use mullvad_relay_selector::{
18
18
use mullvad_types:: {
19
19
constraints:: Constraint ,
20
20
endpoint:: MullvadEndpoint ,
21
+ location:: Location ,
21
22
relay_constraints:: {
22
23
BridgeConstraints , BridgeState , GeographicLocationConstraint , Ownership , Providers ,
23
24
TransportPort ,
@@ -29,6 +30,15 @@ use mullvad_types::{
29
30
} ,
30
31
} ;
31
32
33
+ static DUMMY_LOCATION : Lazy < Location > = Lazy :: new ( || Location {
34
+ country : "Sweden" . to_string ( ) ,
35
+ country_code : "se" . to_string ( ) ,
36
+ city : "Gothenburg" . to_string ( ) ,
37
+ city_code : "got" . to_string ( ) ,
38
+ latitude : 57.71 ,
39
+ longitude : 11.97 ,
40
+ } ) ;
41
+
32
42
static RELAYS : Lazy < RelayList > = Lazy :: new ( || RelayList {
33
43
etag : None ,
34
44
countries : vec ! [ RelayListCountry {
@@ -56,7 +66,7 @@ static RELAYS: Lazy<RelayList> = Lazy::new(|| RelayList {
56
66
. unwrap( ) ,
57
67
daita: false ,
58
68
} ) ,
59
- location: None ,
69
+ location: DUMMY_LOCATION . clone ( ) ,
60
70
} ,
61
71
Relay {
62
72
hostname: "se10-wireguard" . to_string( ) ,
@@ -74,7 +84,7 @@ static RELAYS: Lazy<RelayList> = Lazy::new(|| RelayList {
74
84
. unwrap( ) ,
75
85
daita: false ,
76
86
} ) ,
77
- location: None ,
87
+ location: DUMMY_LOCATION . clone ( ) ,
78
88
} ,
79
89
Relay {
80
90
hostname: "se-got-001" . to_string( ) ,
@@ -86,7 +96,7 @@ static RELAYS: Lazy<RelayList> = Lazy::new(|| RelayList {
86
96
provider: "provider2" . to_string( ) ,
87
97
weight: 1 ,
88
98
endpoint_data: RelayEndpointData :: Openvpn ,
89
- location: None ,
99
+ location: DUMMY_LOCATION . clone ( ) ,
90
100
} ,
91
101
Relay {
92
102
hostname: "se-got-002" . to_string( ) ,
@@ -98,7 +108,7 @@ static RELAYS: Lazy<RelayList> = Lazy::new(|| RelayList {
98
108
provider: "provider0" . to_string( ) ,
99
109
weight: 1 ,
100
110
endpoint_data: RelayEndpointData :: Openvpn ,
101
- location: None ,
111
+ location: DUMMY_LOCATION . clone ( ) ,
102
112
} ,
103
113
Relay {
104
114
hostname: "se-got-br-001" . to_string( ) ,
@@ -110,7 +120,7 @@ static RELAYS: Lazy<RelayList> = Lazy::new(|| RelayList {
110
120
provider: "provider3" . to_string( ) ,
111
121
weight: 1 ,
112
122
endpoint_data: RelayEndpointData :: Bridge ,
113
- location: None ,
123
+ location: DUMMY_LOCATION . clone ( ) ,
114
124
} ,
115
125
] ,
116
126
} ] ,
@@ -438,7 +448,7 @@ fn test_wireguard_entry() {
438
448
. unwrap( ) ,
439
449
daita: false ,
440
450
} ) ,
441
- location: None ,
451
+ location: DUMMY_LOCATION . clone ( ) ,
442
452
} ,
443
453
Relay {
444
454
hostname: "se10-wireguard" . to_string( ) ,
@@ -456,7 +466,7 @@ fn test_wireguard_entry() {
456
466
. unwrap( ) ,
457
467
daita: false ,
458
468
} ) ,
459
- location: None ,
469
+ location: DUMMY_LOCATION . clone ( ) ,
460
470
} ,
461
471
] ,
462
472
} ] ,
@@ -956,7 +966,7 @@ fn test_include_in_country() {
956
966
. unwrap( ) ,
957
967
daita: false ,
958
968
} ) ,
959
- location: None ,
969
+ location: DUMMY_LOCATION . clone ( ) ,
960
970
} ,
961
971
Relay {
962
972
hostname: "se10-wireguard" . to_string( ) ,
@@ -974,7 +984,7 @@ fn test_include_in_country() {
974
984
. unwrap( ) ,
975
985
daita: false ,
976
986
} ) ,
977
- location: None ,
987
+ location: DUMMY_LOCATION . clone ( ) ,
978
988
} ,
979
989
] ,
980
990
} ] ,
@@ -1174,7 +1184,7 @@ fn test_daita() {
1174
1184
. unwrap( ) ,
1175
1185
daita: false ,
1176
1186
} ) ,
1177
- location: None ,
1187
+ location: DUMMY_LOCATION . clone ( ) ,
1178
1188
} ,
1179
1189
Relay {
1180
1190
hostname: "se10-wireguard" . to_string( ) ,
@@ -1192,7 +1202,7 @@ fn test_daita() {
1192
1202
. unwrap( ) ,
1193
1203
daita: true ,
1194
1204
} ) ,
1195
- location: None ,
1205
+ location: DUMMY_LOCATION . clone ( ) ,
1196
1206
} ,
1197
1207
] ,
1198
1208
} ] ,
0 commit comments