File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,25 @@ def run_test(self):
63
63
self .log .info ("Check the addresses in anchors.dat" )
64
64
65
65
with open (node_anchors_path , "rb" ) as file_handler :
66
- anchors = file_handler .read (). hex ()
66
+ anchors = file_handler .read ()
67
67
68
+ anchors_hex = anchors .hex ()
68
69
for port in block_relay_nodes_port :
69
70
ip_port = ip + port
70
- assert ip_port in anchors
71
+ assert ip_port in anchors_hex
71
72
for port in inbound_nodes_port :
72
73
ip_port = ip + port
73
- assert ip_port not in anchors
74
+ assert ip_port not in anchors_hex
74
75
75
- self .log .info ("Start node" )
76
- self .start_node (0 )
76
+ self .log .info ("Perturb anchors.dat to test it doesn't throw an error during initialization" )
77
+ with self .nodes [0 ].assert_debug_log (["0 block-relay-only anchors will be tried for connections." ]):
78
+ with open (node_anchors_path , "wb" ) as out_file_handler :
79
+ tweaked_contents = bytearray (anchors )
80
+ tweaked_contents [20 :20 ] = b'1'
81
+ out_file_handler .write (bytes (tweaked_contents ))
82
+
83
+ self .log .info ("Start node" )
84
+ self .start_node (0 )
77
85
78
86
self .log .info ("When node starts, check if anchors.dat doesn't exist anymore" )
79
87
assert not os .path .exists (node_anchors_path )
You can’t perform that action at this time.
0 commit comments