From 1c5764ecb18f8cae33ba0c72c2d2e649b48203ee Mon Sep 17 00:00:00 2001 From: Hank Stoever Date: Tue, 5 Mar 2024 12:52:21 -0800 Subject: [PATCH] fix: expected reward cycle in integration test for pox info --- .../src/tests/neon_integrations.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/testnet/stacks-node/src/tests/neon_integrations.rs b/testnet/stacks-node/src/tests/neon_integrations.rs index cd0c96358e..5ea49c1cc9 100644 --- a/testnet/stacks-node/src/tests/neon_integrations.rs +++ b/testnet/stacks-node/src/tests/neon_integrations.rs @@ -6082,6 +6082,7 @@ fn pox_integration_test() { let http_origin = format!("http://{}", &conf.node.rpc_bind); btc_regtest_controller.bootstrap_chain(201); + let burnchain = burnchain_config.clone(); eprintln!("Chain bootstrapped..."); @@ -6139,9 +6140,12 @@ fn pox_integration_test() { pox_info.rejection_fraction, Some(pox_constants.pox_rejection_fraction) ); - assert_eq!(pox_info.reward_cycle_id, 0); - assert_eq!(pox_info.current_cycle.id, 0); - assert_eq!(pox_info.next_cycle.id, 1); + let reward_cycle = burnchain + .block_height_to_reward_cycle(sort_height) + .expect("Expected to be able to get reward cycle"); + assert_eq!(pox_info.reward_cycle_id, reward_cycle); + assert_eq!(pox_info.current_cycle.id, reward_cycle); + assert_eq!(pox_info.next_cycle.id, reward_cycle + 1); assert_eq!( pox_info.reward_cycle_length as u32, pox_constants.reward_cycle_length @@ -6184,6 +6188,9 @@ fn pox_integration_test() { } let pox_info = get_pox_info(&http_origin).unwrap(); + let reward_cycle = burnchain + .block_height_to_reward_cycle(sort_height) + .expect("Expected to be able to get reward cycle"); assert_eq!( &pox_info.contract_id, @@ -6207,9 +6214,9 @@ fn pox_integration_test() { pox_info.rejection_fraction, Some(pox_constants.pox_rejection_fraction) ); - assert_eq!(pox_info.reward_cycle_id, 14); - assert_eq!(pox_info.current_cycle.id, 14); - assert_eq!(pox_info.next_cycle.id, 15); + assert_eq!(pox_info.reward_cycle_id, reward_cycle); + assert_eq!(pox_info.current_cycle.id, reward_cycle); + assert_eq!(pox_info.next_cycle.id, reward_cycle + 1); assert_eq!( pox_info.reward_cycle_length as u32, pox_constants.reward_cycle_length