Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request stacks-network#4488 from stacks-network/fix/pox-in…
Browse files Browse the repository at this point in the history
…fo-test

fix: expected reward cycle in integration test for pox info
  • Loading branch information
hstove authored Mar 5, 2024
2 parents 0b34e09 + 1c5764e commit bf5a833
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions testnet/stacks-node/src/tests/neon_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...");

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit bf5a833

Please sign in to comment.