@@ -30,6 +30,15 @@ impl TestCase for BasicSyncTest {
30
30
} ;
31
31
let initial_height = f. initial_da_height ;
32
32
33
+ f. bitcoin_nodes . wait_for_sync ( None ) . await ?;
34
+ let height0 = da0. get_block_count ( ) . await ?;
35
+ let height1 = da1. get_block_count ( ) . await ?;
36
+
37
+ // Assert that nodes are in sync before disconnection
38
+ assert_eq ! ( height0, height1, "Block heights don't match" ) ;
39
+
40
+ f. bitcoin_nodes . disconnect_nodes ( ) . await ?;
41
+
33
42
// Generate some blocks on node0
34
43
da0. generate ( 5 , None ) . await ?;
35
44
@@ -38,17 +47,16 @@ impl TestCase for BasicSyncTest {
38
47
39
48
// Nodes are now out of sync
40
49
assert_eq ! ( height0, initial_height + 5 ) ;
41
- assert_eq ! ( height1, 0 ) ;
50
+ assert_eq ! ( height1, initial_height ) ;
42
51
43
- // Sync both nodes
44
- f. bitcoin_nodes
45
- . wait_for_sync ( Some ( Duration :: from_secs ( 30 ) ) )
46
- . await ?;
52
+ // Reconnect nodes and sync
53
+ f. bitcoin_nodes . connect_nodes ( ) . await ?;
54
+ f. bitcoin_nodes . wait_for_sync ( None ) . await ?;
47
55
48
56
let height0 = da0. get_block_count ( ) . await ?;
49
57
let height1 = da1. get_block_count ( ) . await ?;
50
58
51
- // Assert that nodes are in sync
59
+ // Assert that nodes are back in sync
52
60
assert_eq ! ( height0, height1, "Block heights don't match" ) ;
53
61
54
62
Ok ( ( ) )
0 commit comments