@@ -945,7 +945,7 @@ fn simple_neon_integration() {
945
945
let send_fee = 100 ;
946
946
naka_conf. add_initial_balance (
947
947
PrincipalData :: from ( sender_addr. clone ( ) ) . to_string ( ) ,
948
- send_amt + send_fee,
948
+ send_amt * 2 + send_fee,
949
949
) ;
950
950
let sender_signer_sk = Secp256k1PrivateKey :: new ( ) ;
951
951
let sender_signer_addr = tests:: to_addr ( & sender_signer_sk) ;
@@ -3168,11 +3168,13 @@ fn forked_tenure_is_ignored() {
3168
3168
) ;
3169
3169
let sender_signer_sk = Secp256k1PrivateKey :: new ( ) ;
3170
3170
let sender_signer_addr = tests:: to_addr ( & sender_signer_sk) ;
3171
+ let recipient = PrincipalData :: from ( StacksAddress :: burn_address ( false ) ) ;
3171
3172
naka_conf. add_initial_balance (
3172
3173
PrincipalData :: from ( sender_signer_addr. clone ( ) ) . to_string ( ) ,
3173
3174
100000 ,
3174
3175
) ;
3175
3176
let stacker_sk = setup_stacker ( & mut naka_conf) ;
3177
+ let http_origin = format ! ( "http://{}" , & naka_conf. node. rpc_bind) ;
3176
3178
3177
3179
test_observer:: spawn ( ) ;
3178
3180
let observer_port = test_observer:: EVENT_OBSERVER_PORT ;
@@ -3318,11 +3320,20 @@ fn forked_tenure_is_ignored() {
3318
3320
3319
3321
// Now let's produce a second block for tenure C and ensure it builds off of block C.
3320
3322
let blocks_before = mined_blocks. load ( Ordering :: SeqCst ) ;
3321
- next_block_and ( & mut btc_regtest_controller, 60 , || {
3322
- let blocks_count = mined_blocks. load ( Ordering :: SeqCst ) ;
3323
- Ok ( blocks_count > blocks_before)
3324
- } )
3325
- . unwrap ( ) ;
3323
+ let start_time = Instant :: now ( ) ;
3324
+ // submit a tx so that the miner will mine an extra block
3325
+ let sender_nonce = 0 ;
3326
+ let transfer_tx =
3327
+ make_stacks_transfer ( & sender_sk, sender_nonce, send_fee, & recipient, send_amt) ;
3328
+ submit_tx ( & http_origin, & transfer_tx) ;
3329
+ info ! ( "Tenure C is mining a second block" ) ;
3330
+ while mined_blocks. load ( Ordering :: SeqCst ) <= blocks_before {
3331
+ assert ! (
3332
+ start_time. elapsed( ) < Duration :: from_secs( 45 ) ,
3333
+ "FAIL: Test timed out while waiting for block production" ,
3334
+ ) ;
3335
+ thread:: sleep ( Duration :: from_secs ( 1 ) ) ;
3336
+ }
3326
3337
3327
3338
info ! ( "Tenure C produced a second block!" ) ;
3328
3339
@@ -3333,21 +3344,16 @@ fn forked_tenure_is_ignored() {
3333
3344
let block_2_c = blocks. last ( ) . unwrap ( ) ;
3334
3345
3335
3346
info ! ( "Starting tenure D." ) ;
3336
- // Submit a block commit op for tenure D
3347
+ // Submit a block commit op for tenure D and mine a stacks block
3337
3348
let commits_before = commits_submitted. load ( Ordering :: SeqCst ) ;
3338
- next_block_and ( & mut btc_regtest_controller, 60 , || {
3339
- let commits_count = commits_submitted. load ( Ordering :: SeqCst ) ;
3340
- Ok ( commits_count > commits_before)
3341
- } )
3342
- . unwrap ( ) ;
3343
-
3344
- // Wait for a stacks block to be broadcasted
3345
3349
let blocks_before = mined_blocks. load ( Ordering :: SeqCst ) ;
3346
3350
next_block_and ( & mut btc_regtest_controller, 60 , || {
3351
+ let commits_count = commits_submitted. load ( Ordering :: SeqCst ) ;
3347
3352
let blocks_count = mined_blocks. load ( Ordering :: SeqCst ) ;
3348
- Ok ( blocks_count > blocks_before)
3353
+ Ok ( commits_count > commits_before && blocks_count > blocks_before)
3349
3354
} )
3350
3355
. unwrap ( ) ;
3356
+
3351
3357
let block_tenure_d = NakamotoChainState :: get_canonical_block_header ( chainstate. db ( ) , & sortdb)
3352
3358
. unwrap ( )
3353
3359
. unwrap ( ) ;
0 commit comments