@@ -8598,16 +8598,16 @@ fn mock_mining() {
8598
8598
let send_amt = 100 ;
8599
8599
let send_fee = 180 ;
8600
8600
8601
- let node_1_rpc = 51024 ;
8602
- let node_1_p2p = 51023 ;
8603
- let node_2_rpc = 51026 ;
8604
- let node_2_p2p = 51025 ;
8601
+ let node_1_rpc = gen_random_port ( ) ;
8602
+ let node_1_p2p = gen_random_port ( ) ;
8603
+ let node_2_rpc = gen_random_port ( ) ;
8604
+ let node_2_p2p = gen_random_port ( ) ;
8605
8605
8606
8606
let localhost = "127.0.0.1" ;
8607
- naka_conf. node . rpc_bind = format ! ( "{}:{}" , localhost , node_1_rpc ) ;
8608
- naka_conf. node . p2p_bind = format ! ( "{}:{}" , localhost , node_1_p2p ) ;
8609
- naka_conf. node . data_url = format ! ( "http://{}:{}" , localhost , node_1_rpc ) ;
8610
- naka_conf. node . p2p_address = format ! ( "{}:{}" , localhost , node_1_p2p ) ;
8607
+ naka_conf. node . rpc_bind = format ! ( "{localhost }:{node_1_rpc}" ) ;
8608
+ naka_conf. node . p2p_bind = format ! ( "{localhost }:{node_1_p2p}" ) ;
8609
+ naka_conf. node . data_url = format ! ( "http://{localhost }:{node_1_rpc}" ) ;
8610
+ naka_conf. node . p2p_address = format ! ( "{localhost }:{node_1_p2p}" ) ;
8611
8611
let http_origin = format ! ( "http://{}" , & naka_conf. node. rpc_bind) ;
8612
8612
8613
8613
naka_conf. add_initial_balance (
@@ -8687,10 +8687,10 @@ fn mock_mining() {
8687
8687
follower_conf. node . seed = vec ! [ 0x01 ; 32 ] ;
8688
8688
follower_conf. node . local_peer_seed = vec ! [ 0x02 ; 32 ] ;
8689
8689
8690
- follower_conf. node . rpc_bind = format ! ( "{}:{}" , localhost , node_2_rpc ) ;
8691
- follower_conf. node . p2p_bind = format ! ( "{}:{}" , localhost , node_2_p2p ) ;
8692
- follower_conf. node . data_url = format ! ( "http://{}:{}" , localhost , node_2_rpc ) ;
8693
- follower_conf. node . p2p_address = format ! ( "{}:{}" , localhost , node_2_p2p ) ;
8690
+ follower_conf. node . rpc_bind = format ! ( "{localhost }:{node_2_rpc}" ) ;
8691
+ follower_conf. node . p2p_bind = format ! ( "{localhost }:{node_2_p2p}" ) ;
8692
+ follower_conf. node . data_url = format ! ( "http://{localhost }:{node_2_rpc}" ) ;
8693
+ follower_conf. node . p2p_address = format ! ( "{localhost }:{node_2_p2p}" ) ;
8694
8694
8695
8695
let node_info = get_chain_info ( & naka_conf) ;
8696
8696
follower_conf. node . add_bootstrap_node (
0 commit comments