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):
6363 self .log .info ("Check the addresses in anchors.dat" )
6464
6565 with open (node_anchors_path , "rb" ) as file_handler :
66- anchors = file_handler .read (). hex ()
66+ anchors = file_handler .read ()
6767
68+ anchors_hex = anchors .hex ()
6869 for port in block_relay_nodes_port :
6970 ip_port = ip + port
70- assert ip_port in anchors
71+ assert ip_port in anchors_hex
7172 for port in inbound_nodes_port :
7273 ip_port = ip + port
73- assert ip_port not in anchors
74+ assert ip_port not in anchors_hex
7475
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 )
7785
7886 self .log .info ("When node starts, check if anchors.dat doesn't exist anymore" )
7987 assert not os .path .exists (node_anchors_path )
You can’t perform that action at this time.
0 commit comments