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

upgrade mpm to 1.12.5 and fix integration tests #163

Merged
merged 3 commits into from
Sep 28, 2022
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
8 changes: 4 additions & 4 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
branches:
- main
- genesis_dao
- genesis_dao

jobs:
build-and-test:
Expand All @@ -21,15 +21,15 @@ jobs:
profile: minimal
- name: setup environment
run: |
bash scripts/dev_setup.sh -b -t -y -p
bash scripts/dev_setup.sh -b -t -y -p
- name: test
run: |
source "$HOME/.profile"
mpm package test
- name: integration test
run: |
source "$HOME/.profile"
mpm integration-test
mpm integration-test --current-as-stdlib
- name: move-prover-test
run: |
source "$HOME/.profile"
Expand All @@ -40,4 +40,4 @@ jobs:
source "$HOME/.profile"
bash ./scripts/build.sh
- name: check changed files
run: bash ./scripts/changed_files.sh
run: bash ./scripts/changed_files.sh
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: 92C4BD219F80CC0A3708B819EA1E57967727A3ED42F5627ACA2408BCF40FC74C
source_digest: E9EBFB94E7BA4C1DB94C3F860A481AA819D6600B82D2F49971D1AE849AE3AA8F
build_flags:
dev_mode: false
test_mode: false
Expand Down
4 changes: 4 additions & 0 deletions build/StarcoinFramework/docs/StdlibUpgradeScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ deprecated, use <code>do_upgrade_from_v6_to_v7_with_language_version</code>.
<a href="UpgradeModulePlugin.md#0x1_UpgradeModulePlugin_initialize">UpgradeModulePlugin::initialize</a>();

//TODO : config rate need mind
// voting_delay: 60000 ms
// voting_period: 3600000 ms
// voting_quorum_rate: 4
// min_action_delay: 3600000 ms
<a href="StarcoinDAO.md#0x1_StarcoinDAO_create_dao">StarcoinDAO::create_dao</a>( <a href="Dao.md#0x1_Dao_voting_delay">Dao::voting_delay</a>&lt;<a href="STC.md#0x1_STC">STC</a>&gt;(), <a href="Dao.md#0x1_Dao_voting_period">Dao::voting_period</a>&lt;<a href="STC.md#0x1_STC">STC</a>&gt;(), <a href="Dao.md#0x1_Dao_voting_quorum_rate">Dao::voting_quorum_rate</a>&lt;<a href="STC.md#0x1_STC">STC</a>&gt;(), <a href="Dao.md#0x1_Dao_min_action_delay">Dao::min_action_delay</a>&lt;<a href="STC.md#0x1_STC">STC</a>&gt;(), 1000 * 1000 * 1000 * 1000);
}
</code></pre>
Expand Down
Binary file modified build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm
Binary file not shown.
28 changes: 17 additions & 11 deletions integration-tests/daospace/dao_upgrade_incompatible.exp
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
processed 18 tasks
processed 20 tasks

task 4 'run'. lines 97-105:
task 4 'run'. lines 87-95:
{
"gas_used": 526517,
"status": "Executed"
}

task 8 'run'. lines 121-136:
task 9 'run'. lines 117-132:
{
"gas_used": 200239,
"status": "Executed"
}

task 9 'run'. lines 138-147:
task 10 'run'. lines 134-143:
{
"gas_used": 1095207,
"status": "Executed"
}

task 11 'run'. lines 151-159:
task 12 'run'. lines 147-155:
{
"gas_used": 123208,
"status": "Executed"
}

task 13 'deploy'. lines 163-164:
Publish failure: MiscellaneousError
task 15 'run'. lines 161-169:
{
"gas_used": 11346,
"status": "Executed"
}

task 14 'run'. lines 166-174:
task 16 'run'. lines 171-179:
{
"gas_used": 123208,
"status": "Executed"
}

task 17 'run'. lines 180-188:
task 18 'deploy'. lines 183-184:
Publish failure: MiscellaneousError

task 19 'run'. lines 186-194:
{
"gas_used": 11346,
"status": "Executed"
"gas_used": 600,
"status": "MiscellaneousError"
}
38 changes: 22 additions & 16 deletions integration-tests/daospace/dao_upgrade_incompatible.move
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

//# faucet --addr alice --amount 10000000000

////# run --signers creator
//script {
// use StarcoinFramework::StdlibUpgradeScripts;
//
// fun upgrade_from_v11_to_v12() {
// StdlibUpgradeScripts::upgrade_from_v12_to_v12_1();
// }
//}
//// check: EXECUTED

//# publish
module creator::DAOHelper {
use StarcoinFramework::DAOPluginMarketplace;
Expand Down Expand Up @@ -109,6 +99,12 @@ module creator::test {
public fun hello() {}
}

//# package
module creator::test {
public fun hello() {}
public fun world(_i: u8) {}
}

//# package
module creator::test {
public fun hello(_i: u8) {}
Expand Down Expand Up @@ -153,17 +149,26 @@ script {
use creator::DAOHelper;

fun main(_sender: signer, package_hash: vector<u8>) {
DAOHelper::submit_upgrade_plan(package_hash, 2, false);
DAOHelper::submit_upgrade_plan(package_hash, 2, true);
}
}
//check: EXECUTED

//# block --author 0x1 --timestamp 86600000

//# deploy {{$.package[1].file}} --signers alice
//check: Publish failure: MiscellaneousError

//# run --signers alice --args {{$.package[1].package_hash}}
//# run --signers alice
script {
use creator::test;

fun main(_sender: signer) {
test::world(2);
}
}
//check: EXECUTED

//# run --signers alice --args {{$.package[2].package_hash}}
script {
use creator::DAOHelper;

Expand All @@ -175,14 +180,15 @@ script {

//# block --author 0x1 --timestamp 86700000

//# deploy {{$.package[1].file}} --signers alice
//# deploy {{$.package[2].file}} --signers alice
//check: Publish failure: MiscellaneousError

//# run --signers alice
script {
use creator::test;

fun main(_sender: signer) {
test::world(1);
test::hello(3);
}
}
//check: EXECUTED
//check: ABORT. incompatiable upgrade is not allowed.
67 changes: 56 additions & 11 deletions integration-tests/starcoin_dao/starcoin_onchain_config.exp
Original file line number Diff line number Diff line change
@@ -1,51 +1,96 @@
processed 23 tasks
processed 41 tasks

task 4 'run'. lines 10-25:
task 11 'run'. lines 23-37:
{
"gas_used": 880000,
"gas_used": 594906,
"status": "Executed"
}

task 8 'run'. lines 34-45:
task 12 'run'. lines 39-53:
{
"gas_used": 594906,
"status": "Executed"
}

task 13 'run'. lines 55-69:
{
"gas_used": 594906,
"status": "Executed"
}

task 14 'run'. lines 71-85:
{
"gas_used": 594906,
"status": "Executed"
}

task 18 'run'. lines 93-104:
{
"gas_used": 101440,
"status": "Executed"
}

task 11 'run'. lines 52-61:
task 21 'run'. lines 111-120:
{
"gas_used": 575872,
"status": "Executed"
}

task 12 'run'. lines 64-73:
task 22 'run'. lines 123-132:
{
"gas_used": 448939,
"status": "Executed"
}

task 14 'call'. lines 77-77:
task 24 'call'. lines 136-136:
"0xa7dcef9aef26202fce82a7c7d6672afb/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>>"

task 16 'run'. lines 82-92:
task 26 'run'. lines 140-153:
{
"gas_used": 6111871,
"status": "Executed"
}

task 18 'run'. lines 96-104:
task 27 'call'. lines 154-156:
"0xb5d577dc9ce59725e29886632e69ecdf/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>>"

task 29 'run'. lines 159-170:
{
"gas_used": 5442229,
"status": "Executed"
}

task 30 'call'. lines 171-173:
"0x9255386a0faee0205777b798ba4fc6c4/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>>"

task 32 'run'. lines 176-188:
{
"gas_used": 5442229,
"status": "Executed"
}

task 33 'call'. lines 189-191:
"0xb0c32ba18ae392ec1978360105bc3956/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x00000000000000000000000000000001::StarcoinDAO::StarcoinDAO>>"

task 35 'run'. lines 195-205:
{
"gas_used": 5442229,
"status": "Executed"
}

task 37 'run'. lines 209-217:
{
"gas_used": 72156,
"status": "Executed"
}

task 20 'run'. lines 108-117:
task 38 'run'. lines 219-228:
{
"gas_used": 173612,
"status": "Executed"
}

task 22 'run'. lines 121-137:
task 40 'run'. lines 232-248:
{
"gas_used": 495761,
"status": "Executed"
Expand Down
Loading