Skip to content

Commit

Permalink
[tests] testing force upgrade of libra-framework (0LNetworkCommunity#201
Browse files Browse the repository at this point in the history
)
  • Loading branch information
0o-de-lally committed Aug 16, 2024
1 parent b6f7c4a commit 89e2808
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Binary file modified framework/releases/head.mrb
Binary file not shown.
9 changes: 7 additions & 2 deletions framework/src/upgrade_fixtures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ pub fn upgrade_fixtures() -> anyhow::Result<()> {
let modules = vec!["move-stdlib".to_string()];
generate_fixtures(p, modules, false)?;

// for single step arbitrary/forced upgrades
// places the all_your_base in the move-stdlib dir
let p = fixture_path.join("upgrade-single-lib-force");
std::fs::create_dir_all(&p)?;
let modules = vec!["libra-framework".to_string()];
generate_fixtures(p, modules, true)?;

// for multi step upgrades
// places the all_your_base in the libra_framework dir
let p = fixture_path.join("upgrade-multi-lib");
Expand All @@ -126,7 +133,6 @@ pub fn upgrade_fixtures() -> anyhow::Result<()> {
"vendor-stdlib".to_string(),
"libra-framework".to_string(),
];

generate_fixtures(p, modules, false)?;

// generate fixtures with arbitrary release
Expand All @@ -137,7 +143,6 @@ pub fn upgrade_fixtures() -> anyhow::Result<()> {
"vendor-stdlib".to_string(),
"libra-framework".to_string(),
];

generate_fixtures(p, modules, true)?;

Ok(())
Expand Down
20 changes: 17 additions & 3 deletions tools/txs/tests/upgrade_compatible_from_mainnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,24 @@ async fn smoke_upgrade_mainnet_compatible_multiple() {
.await;
}

/// do the same as above, but use the "arbitrary" upgrade policy to force an
/// upgrade.
/////// TEST ARBITRARY UPGRADES ///////
// do the same as above, but use the "arbitrary" upgrade policy to force an
// upgrade.
//
/// Force upgrade Libra
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn smoke_upgrade_mainnet_compatible_multiple_force() {
async fn smoke_upgrade_mainnet_force_libra() {
support::upgrade_multiple_impl(
"upgrade-single-lib-force",
vec!["1-libra-framework"],
ReleaseTarget::Mainnet,
)
.await;
}

/// Upgrade all modules
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn smoke_upgrade_mainnet_force_multiple() {
support::upgrade_multiple_impl(
"upgrade-multi-lib-force",
vec!["1-move-stdlib", "2-vendor-stdlib", "3-libra-framework"],
Expand Down

0 comments on commit 89e2808

Please sign in to comment.