Skip to content

Commit

Permalink
Revert "Remove proposal after executed or rejected (#145)"
Browse files Browse the repository at this point in the history
This reverts commit 1e17512.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent 8e20d4b commit c27c894
Show file tree
Hide file tree
Showing 25 changed files with 85 additions and 194 deletions.
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: BA11C8B16393EE8048481F812F0038A5D20D703FD7F7B2B9BD5F49840B6703E1
source_digest: 8EF29F90FF139AC49CC2FE59DA218D959B0B29842ABFA2203CAC3C96153AF336
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/MemberProposalPlugin.mv
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@



<pre><code><b>struct</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_InstallPluginAction">InstallPluginAction</a>&lt;ToInstallPluginT&gt; <b>has</b> drop, store
<pre><code><b>struct</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_InstallPluginAction">InstallPluginAction</a>&lt;ToInstallPluginT&gt; <b>has</b> store
</code></pre>


Expand Down
2 changes: 1 addition & 1 deletion build/StarcoinFramework/docs/MemberProposalPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@



<pre><code><b>struct</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a> <b>has</b> drop, store
<pre><code><b>struct</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a> <b>has</b> store
</code></pre>


Expand Down
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/MemberProposalPlugin.mvsm
Binary file not shown.
40 changes: 20 additions & 20 deletions integration-tests/daospace/dao_proposal.exp
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
processed 42 tasks

task 7 'run'. lines 158-169:
task 7 'run'. lines 169-180:
{
"gas_used": 1809468,
"status": "Executed"
}

task 8 'run'. lines 171-185:
task 8 'run'. lines 182-196:
{
"gas_used": 109239,
"status": "Executed"
}

task 9 'run'. lines 187-212:
task 9 'run'. lines 198-223:
{
"gas_used": 306386,
"status": "Executed"
}

task 11 'run'. lines 217-233:
task 11 'run'. lines 228-244:
{
"gas_used": 239832,
"status": "Executed"
}

task 12 'run'. lines 235-251:
task 12 'run'. lines 246-262:
{
"gas_used": 239832,
"status": "Executed"
}

task 16 'run'. lines 259-273:
task 16 'run'. lines 270-284:
{
"gas_used": 104944,
"status": "Executed"
}

task 19 'run'. lines 280-293:
task 19 'run'. lines 291-304:
{
"gas_used": 532278,
"status": {
Expand All @@ -52,46 +52,46 @@ task 19 'run'. lines 280-293:
}
}

task 22 'run'. lines 300-311:
task 22 'run'. lines 311-322:
{
"gas_used": 577624,
"status": "Executed"
}

task 23 'run'. lines 314-338:
task 23 'run'. lines 325-349:
{
"gas_used": 476235,
"status": "Executed"
}

task 25 'run'. lines 342-351:
task 25 'run'. lines 353-362:
{
"gas_used": 11943,
"status": "Executed"
}

task 26 'call'. lines 353-353:
task 26 'call'. lines 364-364:
"0xb5d577dc9ce59725e29886632e69ecdf/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>>"

task 28 'run'. lines 357-376:
task 28 'run'. lines 368-387:
{
"gas_used": 6523189,
"status": "Executed"
}

task 29 'call'. lines 379-379:
task 29 'call'. lines 390-390:
"0xa7dcef9aef26202fce82a7c7d6672afb/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>>"

task 31 'run'. lines 383-396:
task 31 'run'. lines 394-407:
{
"gas_used": 6195892,
"status": "Executed"
}

task 32 'call'. lines 399-399:
task 32 'call'. lines 410-410:
"0x3d4926eeda5b14b0ac979269ee79e40e/1/0x00000000000000000000000000000001::IdentifierNFT::IdentifierNFT<0x00000000000000000000000000000001::DAOSpace::DAOMember<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>,0x00000000000000000000000000000001::DAOSpace::DAOMemberBody<0x662ba5a1a1da0f1c70a9762c7eeb7aaf::DAOHelper::X>>"

task 34 'run'. lines 403-416:
task 34 'run'. lines 414-427:
{
"gas_used": 35135,
"status": {
Expand All @@ -107,20 +107,20 @@ task 34 'run'. lines 403-416:
}
}

task 36 'run'. lines 421-436:
task 36 'run'. lines 432-447:
{
"gas_used": 106454,
"status": "Executed"
}

task 39 'run'. lines 444-454:
task 39 'run'. lines 455-465:
{
"gas_used": 115442,
"status": "Executed"
}

task 41 'run'. lines 459-471:
task 41 'run'. lines 470-482:
{
"gas_used": 452403,
"gas_used": 451300,
"status": "Executed"
}
15 changes: 13 additions & 2 deletions integration-tests/daospace/dao_proposal.move
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//# init -n dev
//# init -n dev --debug

//// creator address is 0x662ba5a1a1da0f1c70a9762c7eeb7aaf
//# faucet --addr creator --amount 100000000000
Expand All @@ -10,6 +10,17 @@

//# faucet --addr cindy --amount 10000000000


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

//# publish
module creator::DAOHelper {
use StarcoinFramework::DAOPluginMarketplace;
Expand Down Expand Up @@ -62,7 +73,7 @@ module creator::DAOHelper {

struct XPlugin has store, drop{}

struct XAction<phantom TokenT> has store, drop {
struct XAction<phantom TokenT> has store {
total: u128,
receiver: address,
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_proposal_rejected.move
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module creator::DAOHelper {

struct XPlugin has store, drop{}

struct XAction<phantom TokenT> has store, drop {
struct XAction<phantom TokenT> has store {
total: u128,
receiver: address,
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/gas_oracle_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ task 24 'run'. lines 221-229:

task 26 'run'. lines 234-251:
{
"gas_used": 582817,
"gas_used": 581714,
"status": "Executed"
}
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/mint_proposal_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ task 26 'run'. lines 232-246:

task 28 'run'. lines 250-271:
{
"gas_used": 515357,
"gas_used": 514254,
"status": "Executed"
}
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/salary_gov_plugin.move
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module creator::SalaryGovPlugin {
last_receive_time: u64,
}

struct BossProposalAction<phantom DAOT> has key, store, drop {
struct BossProposalAction<phantom DAOT> has key, store {
boss: address,
}

Expand Down
20 changes: 2 additions & 18 deletions integration-tests/starcoin_dao/starcoin_onchain_config.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 42 tasks
processed 41 tasks

task 11 'run'. lines 23-37:
{
Expand Down Expand Up @@ -92,22 +92,6 @@ task 38 'run'. lines 219-228:

task 40 'run'. lines 232-248:
{
"gas_used": 496864,
"gas_used": 495761,
"status": "Executed"
}

task 41 'run'. lines 250-261:
{
"gas_used": 164164,
"status": {
"MoveAbort": {
"location": {
"Module": {
"address": "0x00000000000000000000000000000001",
"name": "DAOSpace"
}
},
"abort_code": "103175"
}
}
}
15 changes: 1 addition & 14 deletions integration-tests/starcoin_dao/starcoin_onchain_config.move
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,4 @@ script{

}
}
// check: EXECUTED

//# run --signers alice
script{
use StarcoinFramework::DAOSpace;
use StarcoinFramework::StarcoinDAO::StarcoinDAO;

fun execute_proposal(sender: signer){
assert!(DAOSpace::proposal_state<StarcoinDAO>(1) == 8 , 104);
DAOSpace::clean_proposal_by_id<StarcoinDAO>(&sender, 1);
let _ = DAOSpace::proposal<StarcoinDAO>(1);
}
}
// check: ABORT, code 103175, proposal 1 not exist.
// check: EXECUTED
20 changes: 2 additions & 18 deletions integration-tests/starcoin_dao/starcoin_upgrade_module.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 45 tasks
processed 44 tasks

task 11 'run'. lines 23-37:
{
Expand Down Expand Up @@ -92,22 +92,6 @@ task 39 'run'. lines 227-236:

task 41 'run'. lines 240-252:
{
"gas_used": 519740,
"gas_used": 518637,
"status": "Executed"
}

task 44 'run'. lines 258-269:
{
"gas_used": 148462,
"status": {
"MoveAbort": {
"location": {
"Module": {
"address": "0x00000000000000000000000000000001",
"name": "DAOSpace"
}
},
"abort_code": "103175"
}
}
}
15 changes: 1 addition & 14 deletions integration-tests/starcoin_dao/starcoin_upgrade_module.move
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,11 @@ script{
fun execute_proposal(sender: signer){
assert!(DAOSpace::proposal_state<StarcoinDAO>(1) == 7 , 103);
UpgradeModulePlugin::execute_proposal<StarcoinDAO>(&sender, 1);
assert!(DAOSpace::proposal_state<StarcoinDAO>(1) == 8 , 104);
assert!(DAOSpace::proposal_state<StarcoinDAO>(1) == 8 , 103);
}
}
// check: EXECUTED

//# block --author=0x3 --timestamp 93880000

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

//# run --signers alice
script{
use StarcoinFramework::DAOSpace;
use StarcoinFramework::StarcoinDAO::StarcoinDAO;

fun execute_proposal(sender: signer){
assert!(DAOSpace::proposal_state<StarcoinDAO>(1) == 8 , 104);
DAOSpace::clean_proposals<StarcoinDAO>(&sender);
let _ = DAOSpace::proposal<StarcoinDAO>(1);
}
}
// check: ABORT, code 103175, proposal 1 not exist.
Loading

0 comments on commit c27c894

Please sign in to comment.