mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-22 19:13:37 +08:00
remove test_v1_pox_default_contract
This commit is contained in:
@@ -4677,102 +4677,6 @@ fn test_sortition_divergence_pre_21() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_v1_pox_default_contract() {
|
||||
if env::var("BITCOIND_TEST") != Ok("1".into()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let reward_cycle_len = 5;
|
||||
let prepare_phase_len = 3;
|
||||
let epoch_2_05 = 205;
|
||||
let epoch_2_1 = 212;
|
||||
let v1_unlock_height = 213;
|
||||
|
||||
let pox_constants = PoxConstants::new(
|
||||
reward_cycle_len,
|
||||
prepare_phase_len,
|
||||
4 * prepare_phase_len / 5,
|
||||
1,
|
||||
1,
|
||||
u64::max_value() - 2,
|
||||
u64::max_value() - 1,
|
||||
v1_unlock_height,
|
||||
);
|
||||
|
||||
let (mut conf, _) = neon_integration_test_conf();
|
||||
|
||||
let mut epochs = core::STACKS_EPOCHS_REGTEST.to_vec();
|
||||
epochs[1].end_height = epoch_2_05;
|
||||
epochs[2].start_height = epoch_2_05;
|
||||
epochs[2].end_height = epoch_2_1;
|
||||
epochs[3].start_height = epoch_2_1;
|
||||
conf.burnchain.epochs = Some(epochs);
|
||||
|
||||
let mut burnchain_config = Burnchain::regtest(&conf.get_burn_db_path());
|
||||
burnchain_config.pox_constants = pox_constants.clone();
|
||||
|
||||
let mut btcd_controller = BitcoinCoreController::new(conf.clone());
|
||||
btcd_controller
|
||||
.start_bitcoind()
|
||||
.map_err(|_e| ())
|
||||
.expect("Failed starting bitcoind");
|
||||
|
||||
let mut btc_regtest_controller = BitcoinRegtestController::with_burnchain(
|
||||
conf.clone(),
|
||||
None,
|
||||
Some(burnchain_config.clone()),
|
||||
None,
|
||||
);
|
||||
|
||||
btc_regtest_controller.bootstrap_chain(epoch_2_1 - 3);
|
||||
|
||||
eprintln!("Chain bootstrapped...");
|
||||
|
||||
let mut run_loop = neon::RunLoop::new(conf.clone());
|
||||
let runloop_burnchain = burnchain_config.clone();
|
||||
|
||||
let blocks_processed = run_loop.get_blocks_processed_arc();
|
||||
|
||||
thread::spawn(move || run_loop.start(Some(runloop_burnchain), 0));
|
||||
|
||||
// give the run loop some time to start up!
|
||||
wait_for_runloop(&blocks_processed);
|
||||
info!("wait_for_runloop over");
|
||||
|
||||
// first block wakes up the run loop
|
||||
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
|
||||
|
||||
// first block will hold our VRF registration
|
||||
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
|
||||
|
||||
// second block will be the first mined Stacks block
|
||||
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
|
||||
|
||||
info!("advance to epoch_2_1 (height {}) finished.", epoch_2_1,);
|
||||
|
||||
// pre-v1_unlock_height means POX-1
|
||||
assert_eq!("pox", contract_name_from_get_pox_info(&conf));
|
||||
|
||||
// advance the chain to v1_unlock_height
|
||||
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
|
||||
|
||||
// advance the chain to v1_unlock_height+1
|
||||
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
|
||||
|
||||
// post-v1_unlock_height means POX-2
|
||||
assert_eq!("pox-2", contract_name_from_get_pox_info(&conf));
|
||||
|
||||
fn contract_name_from_get_pox_info(conf: &Config) -> String {
|
||||
let http_origin = format!("http://{}", &conf.node.rpc_bind);
|
||||
let pox_info = neon_integrations::get_pox_info(&http_origin);
|
||||
let mut parts = pox_info.contract_id.split('.');
|
||||
parts.next();
|
||||
parts.next().unwrap().to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
#[ignore]
|
||||
|
||||
Reference in New Issue
Block a user