Skip to content

Commit

Permalink
remove deprecated test, replace with tooling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Reginald Fitz Hart committed Feb 3, 2025
1 parent e15acb5 commit b37214e
Showing 1 changed file with 23 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#[test_only]
module ol_framework::test_boundary {
use std::vector;
use std::features;
use diem_std::bls12381;
use diem_framework::stake;
use diem_framework::timestamp;
Expand All @@ -21,7 +20,6 @@ module ol_framework::test_boundary {
use ol_framework::epoch_boundary;
use ol_framework::block;
use ol_framework::ol_account;
use ol_framework::ol_features_constants;

use diem_std::debug::print;

Expand All @@ -47,6 +45,29 @@ module ol_framework::test_boundary {
set
}


#[test(root = @ol_framework, alice = @0x1000a, marlon = @0x12345)]
fun meta_test_override_epoch_change(root: &signer) {
common_test_setup(root);
// testing mainnet, so change the chain_id
testnet::unset(root);
// test setup advances to epoch #2
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 2, 7357001);
epoch_boundary::test_set_boundary_ready(root, epoch);

timestamp::fast_forward_seconds(1); // needed for reconfig
block::test_maybe_advance_epoch(root, 603000001, 602000000);

// test epoch did not advance and needs to be triggered
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 2, 7357003);

// test epoch can be triggered and advances
epoch_boundary::test_trigger(root);
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 3, 7357004);
}
// We need to test e2e of the epoch boundary
#[test(root = @ol_framework)]
fun e2e_boundary_happy(root: signer) {
Expand Down Expand Up @@ -368,30 +389,4 @@ module ol_framework::test_boundary {
// aborts
}


#[test(root = @ol_framework, alice = @0x1000a, marlon = @0x12345)]
fun test_epoch_trigger_enabled(root: &signer) {
common_test_setup(root);
// testing mainnet, so change the chainid
testnet::unset(root);
// test setup advances to epoch #2
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 2, 7357001);
epoch_boundary::test_set_boundary_ready(root, epoch);

// case: epoch trigger set
features::change_feature_flags(root, vector[ol_features_constants::get_epoch_trigger()], vector[]);
assert!(features::is_enabled(ol_features_constants::get_epoch_trigger()), 7357002);
timestamp::fast_forward_seconds(1); // needed for reconfig
block::test_maybe_advance_epoch(root, 603000001, 602000000);

// test epoch did not advance and needs to be triggered
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 2, 7357003);

// test epoch can be triggered and advances
epoch_boundary::test_trigger(root);
let epoch = reconfiguration::get_current_epoch();
assert!(epoch == 3, 7357004);
}
}

0 comments on commit b37214e

Please sign in to comment.