Skip to content

Commit a149699

Browse files
committed
remove CURRENT_TESTING_EPOCH and use StacksEpochId::latest() instead
1 parent da5289b commit a149699

File tree

5 files changed

+26
-30
lines changed

5 files changed

+26
-30
lines changed

stacks-node/src/tests/epoch_21.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ fn transition_adds_get_pox_addr_recipients() {
10921092
&(*addr_variant as u8)
10931093
),
10941094
ClarityVersion::Clarity2,
1095-
CURRENT_TESTING_EPOCH,
1095+
StacksEpochId::latest(),
10961096
false,
10971097
)
10981098
.unwrap()
@@ -1134,7 +1134,7 @@ fn transition_adds_get_pox_addr_recipients() {
11341134
let pox_addr_tuple = execute(
11351135
&format!("{{ hashbytes: 0x{bytes}, version: 0x{version:02x} }}"),
11361136
ClarityVersion::Clarity2,
1137-
CURRENT_TESTING_EPOCH,
1137+
StacksEpochId::latest(),
11381138
false,
11391139
)
11401140
.unwrap()
@@ -1574,7 +1574,7 @@ fn transition_removes_pox_sunset() {
15741574
execute(
15751575
&format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"),
15761576
ClarityVersion::Clarity1,
1577-
CURRENT_TESTING_EPOCH,
1577+
StacksEpochId::latest(),
15781578
false,
15791579
)
15801580
.unwrap()
@@ -1633,7 +1633,7 @@ fn transition_removes_pox_sunset() {
16331633
execute(
16341634
&format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"),
16351635
ClarityVersion::Clarity2,
1636-
CURRENT_TESTING_EPOCH,
1636+
StacksEpochId::latest(),
16371637
false,
16381638
)
16391639
.unwrap()
@@ -2239,7 +2239,7 @@ fn test_sortition_divergence_pre_21() {
22392239
execute(
22402240
&format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"),
22412241
ClarityVersion::Clarity1,
2242-
CURRENT_TESTING_EPOCH,
2242+
StacksEpochId::latest(),
22432243
false,
22442244
)
22452245
.unwrap()
@@ -2789,7 +2789,7 @@ fn test_v1_unlock_height_with_current_stackers() {
27892789
let pox_addr_tuple_1 = execute(
27902790
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
27912791
ClarityVersion::Clarity2,
2792-
CURRENT_TESTING_EPOCH,
2792+
StacksEpochId::latest(),
27932793
false,
27942794
)
27952795
.unwrap()
@@ -2828,7 +2828,7 @@ fn test_v1_unlock_height_with_current_stackers() {
28282828
let pox_addr_tuple_2 = execute(
28292829
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
28302830
ClarityVersion::Clarity2,
2831-
CURRENT_TESTING_EPOCH,
2831+
StacksEpochId::latest(),
28322832
false,
28332833
)
28342834
.unwrap()
@@ -3051,7 +3051,7 @@ fn test_v1_unlock_height_with_delay_and_current_stackers() {
30513051
let pox_addr_tuple_1 = execute(
30523052
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
30533053
ClarityVersion::Clarity2,
3054-
CURRENT_TESTING_EPOCH,
3054+
StacksEpochId::latest(),
30553055
false,
30563056
)
30573057
.unwrap()
@@ -3102,7 +3102,7 @@ fn test_v1_unlock_height_with_delay_and_current_stackers() {
31023102
let pox_addr_tuple_2 = execute(
31033103
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
31043104
ClarityVersion::Clarity2,
3105-
CURRENT_TESTING_EPOCH,
3105+
StacksEpochId::latest(),
31063106
false,
31073107
)
31083108
.unwrap()

stacks-node/src/tests/epoch_22.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn disable_pox() {
195195
let pox_addr_tuple_1 = execute(
196196
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
197197
ClarityVersion::Clarity2,
198-
CURRENT_TESTING_EPOCH,
198+
StacksEpochId::latest(),
199199
false,
200200
)
201201
.unwrap()
@@ -204,7 +204,7 @@ fn disable_pox() {
204204
let pox_addr_tuple_3 = execute(
205205
&format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"),
206206
ClarityVersion::Clarity2,
207-
CURRENT_TESTING_EPOCH,
207+
StacksEpochId::latest(),
208208
false,
209209
)
210210
.unwrap()
@@ -256,7 +256,7 @@ fn disable_pox() {
256256
let pox_addr_tuple_2 = execute(
257257
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
258258
ClarityVersion::Clarity2,
259-
CURRENT_TESTING_EPOCH,
259+
StacksEpochId::latest(),
260260
false,
261261
)
262262
.unwrap()
@@ -725,7 +725,7 @@ fn pox_2_unlock_all() {
725725
let pox_addr_tuple_1 = execute(
726726
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
727727
ClarityVersion::Clarity2,
728-
CURRENT_TESTING_EPOCH,
728+
StacksEpochId::latest(),
729729
false,
730730
)
731731
.unwrap()
@@ -734,7 +734,7 @@ fn pox_2_unlock_all() {
734734
let pox_addr_tuple_3 = execute(
735735
&format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"),
736736
ClarityVersion::Clarity2,
737-
CURRENT_TESTING_EPOCH,
737+
StacksEpochId::latest(),
738738
false,
739739
)
740740
.unwrap()
@@ -787,7 +787,7 @@ fn pox_2_unlock_all() {
787787
let pox_addr_tuple_2 = execute(
788788
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
789789
ClarityVersion::Clarity2,
790-
CURRENT_TESTING_EPOCH,
790+
StacksEpochId::latest(),
791791
false,
792792
)
793793
.unwrap()

stacks-node/src/tests/epoch_24.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use crate::tests::neon_integrations::{
4242
get_account, get_chain_info, get_pox_info, neon_integration_test_conf, next_block_and_wait,
4343
submit_tx, test_observer, wait_for_runloop,
4444
};
45-
use crate::tests::CURRENT_TESTING_EPOCH;
4645
use crate::{neon, BitcoinRegtestController, BurnchainController};
4746

4847
#[cfg(test)]
@@ -222,7 +221,7 @@ fn fix_to_pox_contract() {
222221
let pox_addr_tuple_1 = execute(
223222
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
224223
ClarityVersion::Clarity2,
225-
CURRENT_TESTING_EPOCH,
224+
StacksEpochId::latest(),
226225
false,
227226
)
228227
.unwrap()
@@ -231,7 +230,7 @@ fn fix_to_pox_contract() {
231230
let pox_addr_tuple_3 = execute(
232231
&format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"),
233232
ClarityVersion::Clarity2,
234-
CURRENT_TESTING_EPOCH,
233+
StacksEpochId::latest(),
235234
false,
236235
)
237236
.unwrap()
@@ -284,7 +283,7 @@ fn fix_to_pox_contract() {
284283
let pox_addr_tuple_2 = execute(
285284
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
286285
ClarityVersion::Clarity2,
287-
CURRENT_TESTING_EPOCH,
286+
StacksEpochId::latest(),
288287
false,
289288
)
290289
.unwrap()
@@ -856,7 +855,7 @@ fn verify_auto_unlock_behavior() {
856855
let pox_addr_tuple_1 = execute(
857856
&format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"),
858857
ClarityVersion::Clarity2,
859-
CURRENT_TESTING_EPOCH,
858+
StacksEpochId::latest(),
860859
false,
861860
)
862861
.unwrap()
@@ -865,7 +864,7 @@ fn verify_auto_unlock_behavior() {
865864
let pox_addr_tuple_3 = execute(
866865
&format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"),
867866
ClarityVersion::Clarity2,
868-
CURRENT_TESTING_EPOCH,
867+
StacksEpochId::latest(),
869868
false,
870869
)
871870
.unwrap()
@@ -918,7 +917,7 @@ fn verify_auto_unlock_behavior() {
918917
let pox_addr_tuple_2 = execute(
919918
&format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"),
920919
ClarityVersion::Clarity2,
921-
CURRENT_TESTING_EPOCH,
920+
StacksEpochId::latest(),
922921
false,
923922
)
924923
.unwrap()

stacks-node/src/tests/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ pub const SK_3: &str = "cb95ddd0fe18ec57f4f3533b95ae564b3f1ae063dbf75b46334bd862
7878

7979
pub const ADDR_4: &str = "ST31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZZ239N96";
8080

81-
/// The epoch that is being used for tests that call the clarity vm.
82-
pub const CURRENT_TESTING_EPOCH: StacksEpochId = StacksEpochId::Epoch32;
83-
8481
lazy_static! {
8582
pub static ref PUBLISH_CONTRACT: Vec<u8> = make_contract_publish(
8683
&StacksPrivateKey::from_hex(

stacks-node/src/tests/neon_integrations.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ use crate::neon_node::RelayerThread;
9292
use crate::operations::BurnchainOpSigner;
9393
use crate::stacks_common::types::PrivateKey;
9494
use crate::syncctl::PoxSyncWatchdogComms;
95+
use crate::tests::gen_random_port;
9596
use crate::tests::nakamoto_integrations::{get_key_for_cycle, wait_for};
96-
use crate::tests::{gen_random_port, CURRENT_TESTING_EPOCH};
9797
use crate::{neon, BitcoinRegtestController, BurnchainController, Config, ConfigFile, Keychain};
9898

9999
fn inner_neon_integration_test_conf(seed: Option<Vec<u8>>) -> (Config, StacksAddress) {
@@ -2370,7 +2370,7 @@ fn stx_delegate_btc_integration_test() {
23702370
execute(
23712371
&format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"),
23722372
ClarityVersion::Clarity2,
2373-
CURRENT_TESTING_EPOCH,
2373+
StacksEpochId::latest(),
23742374
false,
23752375
)
23762376
.unwrap()
@@ -5360,7 +5360,7 @@ fn pox_integration_test() {
53605360
execute(
53615361
&format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"),
53625362
ClarityVersion::Clarity1,
5363-
CURRENT_TESTING_EPOCH,
5363+
StacksEpochId::latest(),
53645364
false,
53655365
)
53665366
.unwrap()
@@ -5474,7 +5474,7 @@ fn pox_integration_test() {
54745474
execute(
54755475
&format!("{{ hashbytes: 0x{pox_2_pubkey_hash}, version: 0x00 }}"),
54765476
ClarityVersion::Clarity1,
5477-
CURRENT_TESTING_EPOCH,
5477+
StacksEpochId::latest(),
54785478
false,
54795479
)
54805480
.unwrap()
@@ -5500,7 +5500,7 @@ fn pox_integration_test() {
55005500
execute(
55015501
&format!("{{ hashbytes: 0x{pox_2_pubkey_hash}, version: 0x00 }}"),
55025502
ClarityVersion::Clarity1,
5503-
CURRENT_TESTING_EPOCH,
5503+
StacksEpochId::latest(),
55045504
false,
55055505
)
55065506
.unwrap()

0 commit comments

Comments
 (0)