@@ -7294,7 +7294,7 @@ fn get_block_times(
7294
7294
& sender_addr,
7295
7295
contract3_name,
7296
7296
"get-tenure-time" ,
7297
- vec ! [ & clarity:: vm:: Value :: UInt ( tenure_height ) ] ,
7297
+ vec ! [ & clarity:: vm:: Value :: UInt ( block_height ) ] ,
7298
7298
) ;
7299
7299
let time3_tenure = time3_tenure_value
7300
7300
. expect_optional ( )
@@ -7349,15 +7349,7 @@ fn get_block_times(
7349
7349
time0_now, time1_now,
7350
7350
"Time from pre- and post-epoch 3.0 contracts should match"
7351
7351
) ;
7352
- assert_eq ! (
7353
- time0, time3_tenure,
7354
- "Tenure time should match Clarity 2 block time"
7355
- ) ;
7356
7352
assert_eq ! ( time0_now, time1_now, "Time should match across contracts" ) ;
7357
- assert_eq ! (
7358
- time0_now, time3_now_tenure,
7359
- "Clarity 3 tenure time should match Clarity 2 block time"
7360
- ) ;
7361
7353
7362
7354
(
7363
7355
time0,
@@ -7394,7 +7386,7 @@ fn check_block_times() {
7394
7386
let deploy_fee = 3000 ;
7395
7387
naka_conf. add_initial_balance (
7396
7388
PrincipalData :: from ( sender_addr. clone ( ) ) . to_string ( ) ,
7397
- 3 * deploy_fee + ( send_amt + send_fee) * 2 ,
7389
+ 3 * deploy_fee + ( send_amt + send_fee) * 12 ,
7398
7390
) ;
7399
7391
naka_conf. add_initial_balance (
7400
7392
PrincipalData :: from ( sender_signer_addr. clone ( ) ) . to_string ( ) ,
@@ -7471,7 +7463,7 @@ fn check_block_times() {
7471
7463
next_block_and ( & mut btc_regtest_controller, 60 , || {
7472
7464
let info = get_chain_info_result ( & naka_conf) . unwrap ( ) ;
7473
7465
last_stacks_block_height = info. stacks_tip_height as u128 ;
7474
- last_tenure_height = last_stacks_block_height;
7466
+ last_tenure_height = last_stacks_block_height + 1 ;
7475
7467
Ok ( info. burn_block_height == epoch_3_start)
7476
7468
} )
7477
7469
. unwrap ( ) ;
@@ -7510,7 +7502,7 @@ fn check_block_times() {
7510
7502
let contract_clarity3 = r#"
7511
7503
(define-read-only (get-block-time (height uint)) (get-stacks-block-info? time height))
7512
7504
(define-read-only (get-tenure-time (height uint)) (get-tenure-info? time height))
7513
- (define-read-only (get-last-tenure-time) (get-tenure-info? time (- tenure -height u1)))
7505
+ (define-read-only (get-last-tenure-time) (get-tenure-info? time (- stacks-block -height u1)))
7514
7506
"# ;
7515
7507
7516
7508
let contract_tx3 = make_contract_publish (
@@ -7546,14 +7538,23 @@ fn check_block_times() {
7546
7538
last_tenure_height += 1 ;
7547
7539
info ! ( "New tenure {last_tenure_height}, Stacks height: {last_stacks_block_height}" ) ;
7548
7540
7549
- let ( time0, _time0_now , _time1, _time1_now, _time3_tenure , time3_block, _time3_now_tenure ) =
7541
+ let ( time0, time0_now , _time1, _time1_now, time3_tenure , time3_block, time3_now_tenure ) =
7550
7542
get_block_times (
7551
7543
& naka_conf,
7552
7544
& sender_addr,
7553
7545
last_stacks_block_height - 1 ,
7554
7546
last_tenure_height - 1 ,
7555
7547
) ;
7556
7548
7549
+ assert_eq ! (
7550
+ time0, time3_tenure,
7551
+ "Tenure time should match Clarity 2 block time"
7552
+ ) ;
7553
+ assert_eq ! (
7554
+ time0_now, time3_now_tenure,
7555
+ "Clarity 3 tenure time should match Clarity 2 block time in the first block of a tenure"
7556
+ ) ;
7557
+
7557
7558
// Mine a Nakamoto block
7558
7559
info ! ( "Mining Nakamoto block" ) ;
7559
7560
@@ -7588,17 +7589,17 @@ fn check_block_times() {
7588
7589
_time1a_now,
7589
7590
_time3a_tenure,
7590
7591
time3a_block,
7591
- _time3a_now_tenure ,
7592
+ time3a_now_tenure ,
7592
7593
) = get_block_times (
7593
7594
& naka_conf,
7594
7595
& sender_addr,
7595
7596
last_stacks_block_height - 1 ,
7596
7597
last_tenure_height - 1 ,
7597
7598
) ;
7598
7599
7599
- assert ! (
7600
- time0a - time0 >= 1 ,
7601
- "get-block-info? time should have changed. time_0 = {time0}. time_0_a = {time0a} "
7600
+ assert_eq ! (
7601
+ time0a, time0,
7602
+ "get-block-info? time should not have changed"
7602
7603
) ;
7603
7604
assert ! (
7604
7605
time3a_block - time3_block >= 1 ,
@@ -7618,6 +7619,7 @@ fn check_block_times() {
7618
7619
send_amt,
7619
7620
) ;
7620
7621
submit_tx ( & http_origin, & transfer_tx) ;
7622
+ sender_nonce += 1 ;
7621
7623
7622
7624
// wait for the block to be mined
7623
7625
wait_for ( 30 , || {
@@ -7632,11 +7634,11 @@ fn check_block_times() {
7632
7634
let (
7633
7635
time0b,
7634
7636
_time0b_now,
7635
- time1b ,
7637
+ _time1b ,
7636
7638
_time1b_now,
7637
7639
_time3b_tenure,
7638
7640
time3b_block,
7639
- _time3b_now_tenure ,
7641
+ time3b_now_tenure ,
7640
7642
) = get_block_times (
7641
7643
& naka_conf,
7642
7644
& sender_addr,
@@ -7645,17 +7647,17 @@ fn check_block_times() {
7645
7647
) ;
7646
7648
7647
7649
assert_eq ! (
7648
- time0a , time0b ,
7650
+ time0b , time0a ,
7649
7651
"get-block-info? time should not have changed"
7650
7652
) ;
7651
- assert_eq ! (
7652
- time0b, time1b,
7653
- "Time from pre- and post-epoch 3.0 contracts should match"
7654
- ) ;
7655
7653
assert ! (
7656
7654
time3b_block - time3a_block >= 1 ,
7657
7655
"get-stacks-block-info? time should have changed"
7658
7656
) ;
7657
+ assert_eq ! (
7658
+ time3b_now_tenure, time3a_now_tenure,
7659
+ "get-tenure-info? time should not have changed"
7660
+ ) ;
7659
7661
}
7660
7662
7661
7663
coord_channel
0 commit comments