Skip to content

Commit

Permalink
#131 Add only_new_module (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
WGB5445 authored and sanlee42 committed Mar 16, 2023
1 parent be7f3a9 commit e8a7ebd
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
16 changes: 16 additions & 0 deletions integration-tests/package_txn_manager/only_new_module.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
processed 11 tasks

task 3 'run'. lines 7-18:
{
"gas_used": 97932,
"status": "Executed"
}

task 6 'run'. lines 26-34:
{
"gas_used": 11344,
"status": "Executed"
}

task 8 'deploy'. lines 42-42:
Publish failure: Discard { status_code: StrView(21), status_code_name: "INVALID_MODULE_PUBLISHER" }
49 changes: 49 additions & 0 deletions integration-tests/package_txn_manager/only_new_module.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//# init -n dev

//# faucet --addr alice --amount 100000000000000000

//# faucet --addr bob

//# run --signers alice
script {
use StarcoinFramework::Config;
use StarcoinFramework::Version;
use StarcoinFramework::PackageTxnManager;
use StarcoinFramework::Option;
fun main(account: signer) {
Config::publish_new_config<Version::Version>(&account, Version::new_version(1));
PackageTxnManager::update_module_upgrade_strategy(&account, PackageTxnManager::get_strategy_new_module(), Option::some<u64>(2));
}
}
// check: EXECUTED

//# package
module alice::hello {
public fun hello() {}
}
//# deploy {{$.package[0].file}} --signers alice

//# run --signers alice
script {
use alice::hello;

fun main(_account: signer) {
hello::hello();
}
}
// check: EXECUTED

//# package
module alice::hello {
public fun hello() {}
public fun hello_bob() {}
}

//# deploy {{$.package[1].file}} --signers alice

//# package
module alice::say {
public fun hello() {}
}

//# deploy {{$.package[2].file}} --signers alice

0 comments on commit e8a7ebd

Please sign in to comment.