Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] testing force upgrade of libra-framework #201

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading