@@ -38,13 +38,14 @@ const MAX_INITIAL_NODE_ID_VECTOR_CAPACITY: u32 = 50_000;
38
38
const STALE_RGS_UPDATE_AGE_LIMIT_SECS : u64 = 60 * 60 * 24 * 14 ;
39
39
40
40
impl < NG : Deref < Target =NetworkGraph < L > > , L : Deref > RapidGossipSync < NG , L > where L :: Target : Logger {
41
+ #[ cfg( feature = "std" ) ]
41
42
pub ( crate ) fn update_network_graph_from_byte_stream < R : io:: Read > (
42
43
& self ,
43
44
read_cursor : & mut R ,
44
45
) -> Result < u32 , GraphSyncError > {
45
46
#[ allow( unused_mut, unused_assignments) ]
46
47
let mut current_time_unix = None ;
47
- #[ cfg( all ( feature = "std" , not( test) ) ) ]
48
+ #[ cfg( not( test) ) ]
48
49
{
49
50
// Note that many tests rely on being able to set arbitrarily old timestamps, thus we
50
51
// disable this check during tests!
@@ -252,7 +253,9 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
252
253
mod tests {
253
254
use bitcoin:: Network ;
254
255
256
+ #[ cfg( feature = "std" ) ]
255
257
use lightning:: ln:: msgs:: DecodeError ;
258
+
256
259
use lightning:: routing:: gossip:: NetworkGraph ;
257
260
use lightning:: util:: test_utils:: TestLogger ;
258
261
@@ -280,6 +283,7 @@ mod tests {
280
283
const VALID_BINARY_TIMESTAMP : u64 = 1642291930 ;
281
284
282
285
#[ test]
286
+ #[ cfg( feature = "std" ) ]
283
287
fn network_graph_fails_to_update_from_clipped_input ( ) {
284
288
let logger = TestLogger :: new ( ) ;
285
289
let network_graph = NetworkGraph :: new ( Network :: Bitcoin , & logger) ;
@@ -311,6 +315,7 @@ mod tests {
311
315
}
312
316
313
317
#[ test]
318
+ #[ cfg( feature = "std" ) ]
314
319
fn incremental_only_update_ignores_missing_channel ( ) {
315
320
let incremental_update_input = vec ! [
316
321
76 , 68 , 75 , 1 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
@@ -331,6 +336,7 @@ mod tests {
331
336
}
332
337
333
338
#[ test]
339
+ #[ cfg( feature = "std" ) ]
334
340
fn incremental_only_update_fails_without_prior_updates ( ) {
335
341
let announced_update_input = vec ! [
336
342
76 , 68 , 75 , 1 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
@@ -358,6 +364,7 @@ mod tests {
358
364
}
359
365
360
366
#[ test]
367
+ #[ cfg( feature = "std" ) ]
361
368
fn incremental_only_update_fails_without_prior_same_direction_updates ( ) {
362
369
let initialization_input = vec ! [
363
370
76 , 68 , 75 , 1 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
@@ -413,6 +420,7 @@ mod tests {
413
420
}
414
421
415
422
#[ test]
423
+ #[ cfg( feature = "std" ) ]
416
424
fn incremental_update_succeeds_with_prior_announcements_and_full_updates ( ) {
417
425
let initialization_input = vec ! [
418
426
76 , 68 , 75 , 1 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
@@ -472,6 +480,7 @@ mod tests {
472
480
}
473
481
474
482
#[ test]
483
+ #[ cfg( feature = "std" ) ]
475
484
fn update_succeeds_when_duplicate_gossip_is_applied ( ) {
476
485
let initialization_input = vec ! [
477
486
76 , 68 , 75 , 1 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
@@ -515,6 +524,7 @@ mod tests {
515
524
}
516
525
517
526
#[ test]
527
+ #[ cfg( feature = "std" ) ]
518
528
fn full_update_succeeds ( ) {
519
529
let logger = TestLogger :: new ( ) ;
520
530
let network_graph = NetworkGraph :: new ( Network :: Bitcoin , & logger) ;
@@ -624,6 +634,7 @@ mod tests {
624
634
}
625
635
626
636
#[ test]
637
+ #[ cfg( feature = "std" ) ]
627
638
pub fn update_fails_with_unknown_version ( ) {
628
639
let unknown_version_input = vec ! [
629
640
76 , 68 , 75 , 2 , 111 , 226 , 140 , 10 , 182 , 241 , 179 , 114 , 193 , 166 , 162 , 70 , 174 , 99 , 247 ,
0 commit comments