@@ -7127,19 +7127,31 @@ fn mock_mining() {
7127
7127
}
7128
7128
7129
7129
let ( mut naka_conf, _miner_account) = naka_neon_integration_conf ( None ) ;
7130
- let http_origin = format ! ( "http://{}" , & naka_conf. node. rpc_bind) ;
7131
7130
naka_conf. miner . wait_on_interim_blocks = Duration :: from_secs ( 1 ) ;
7132
7131
let sender_sk = Secp256k1PrivateKey :: new ( ) ;
7133
7132
let sender_signer_sk = Secp256k1PrivateKey :: new ( ) ;
7134
7133
let sender_signer_addr = tests:: to_addr ( & sender_signer_sk) ;
7135
7134
let mut signers = TestSigners :: new ( vec ! [ sender_signer_sk. clone( ) ] ) ;
7136
- let tenure_count = 5 ;
7137
- let inter_blocks_per_tenure = 9 ;
7135
+ let tenure_count = 3 ;
7136
+ let inter_blocks_per_tenure = 3 ;
7138
7137
// setup sender + recipient for some test stx transfers
7139
7138
// these are necessary for the interim blocks to get mined at all
7140
7139
let sender_addr = tests:: to_addr ( & sender_sk) ;
7141
7140
let send_amt = 100 ;
7142
7141
let send_fee = 180 ;
7142
+
7143
+ let node_1_rpc = 51024 ;
7144
+ let node_1_p2p = 51023 ;
7145
+ let node_2_rpc = 51026 ;
7146
+ let node_2_p2p = 51025 ;
7147
+
7148
+ let localhost = "127.0.0.1" ;
7149
+ naka_conf. node . rpc_bind = format ! ( "{}:{}" , localhost, node_1_rpc) ;
7150
+ naka_conf. node . p2p_bind = format ! ( "{}:{}" , localhost, node_1_p2p) ;
7151
+ naka_conf. node . data_url = format ! ( "http://{}:{}" , localhost, node_1_rpc) ;
7152
+ naka_conf. node . p2p_address = format ! ( "{}:{}" , localhost, node_1_p2p) ;
7153
+ let http_origin = format ! ( "http://{}" , & naka_conf. node. rpc_bind) ;
7154
+
7143
7155
naka_conf. add_initial_balance (
7144
7156
PrincipalData :: from ( sender_addr. clone ( ) ) . to_string ( ) ,
7145
7157
( send_amt + send_fee) * tenure_count * inter_blocks_per_tenure,
@@ -7212,11 +7224,7 @@ fn mock_mining() {
7212
7224
blind_signer ( & naka_conf, & signers, proposals_submitted) ;
7213
7225
7214
7226
// Wait one block to confirm the VRF register, wait until a block commit is submitted
7215
- next_block_and ( & mut btc_regtest_controller, 60 , || {
7216
- let commits_count = commits_submitted. load ( Ordering :: SeqCst ) ;
7217
- Ok ( commits_count >= 1 )
7218
- } )
7219
- . unwrap ( ) ;
7227
+ wait_for_first_naka_block_commit ( 60 , & commits_submitted) ;
7220
7228
7221
7229
let mut follower_conf = naka_conf. clone ( ) ;
7222
7230
follower_conf. node . mock_mining = true ;
@@ -7225,18 +7233,10 @@ fn mock_mining() {
7225
7233
follower_conf. node . seed = vec ! [ 0x01 ; 32 ] ;
7226
7234
follower_conf. node . local_peer_seed = vec ! [ 0x02 ; 32 ] ;
7227
7235
7228
- let mut rng = rand:: thread_rng ( ) ;
7229
- let mut buf = [ 0u8 ; 8 ] ;
7230
- rng. fill_bytes ( & mut buf) ;
7231
-
7232
- let rpc_port = u16:: from_be_bytes ( buf[ 0 ..2 ] . try_into ( ) . unwrap ( ) ) . saturating_add ( 1025 ) - 1 ; // use a non-privileged port between 1024 and 65534
7233
- let p2p_port = u16:: from_be_bytes ( buf[ 2 ..4 ] . try_into ( ) . unwrap ( ) ) . saturating_add ( 1025 ) - 1 ; // use a non-privileged port between 1024 and 65534
7234
-
7235
- let localhost = "127.0.0.1" ;
7236
- follower_conf. node . rpc_bind = format ! ( "{}:{}" , & localhost, rpc_port) ;
7237
- follower_conf. node . p2p_bind = format ! ( "{}:{}" , & localhost, p2p_port) ;
7238
- follower_conf. node . data_url = format ! ( "http://{}:{}" , & localhost, rpc_port) ;
7239
- follower_conf. node . p2p_address = format ! ( "{}:{}" , & localhost, p2p_port) ;
7236
+ follower_conf. node . rpc_bind = format ! ( "{}:{}" , localhost, node_2_rpc) ;
7237
+ follower_conf. node . p2p_bind = format ! ( "{}:{}" , localhost, node_2_p2p) ;
7238
+ follower_conf. node . data_url = format ! ( "http://{}:{}" , localhost, node_2_rpc) ;
7239
+ follower_conf. node . p2p_address = format ! ( "{}:{}" , localhost, node_2_p2p) ;
7240
7240
7241
7241
let node_info = get_chain_info ( & naka_conf) ;
7242
7242
follower_conf. node . add_bootstrap_node (
0 commit comments