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

Remove proposal after executed or rejected #145

Merged
merged 3 commits into from
Sep 29, 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
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: 8EF29F90FF139AC49CC2FE59DA218D959B0B29842ABFA2203CAC3C96153AF336
source_digest: BA11C8B16393EE8048481F812F0038A5D20D703FD7F7B2B9BD5F49840B6703E1
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> store
<pre><code><b>struct</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_InstallPluginAction">InstallPluginAction</a>&lt;ToInstallPluginT&gt; <b>has</b> drop, 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> store
<pre><code><b>struct</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a> <b>has</b> drop, 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 169-180:
task 7 'run'. lines 158-169:
{
"gas_used": 1809468,
"status": "Executed"
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

//# 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 @@ -73,7 +62,7 @@ module creator::DAOHelper {

struct XPlugin has store, drop{}

struct XAction<phantom TokenT> has store {
struct XAction<phantom TokenT> has store, drop {
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 {
struct XAction<phantom TokenT> has store, drop {
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": 581714,
"gas_used": 582817,
"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": 514254,
"gas_used": 515357,
"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 {
struct BossProposalAction<phantom DAOT> has key, store, drop {
boss: address,
}

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

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

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

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

}
}
// check: EXECUTED
// 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.
20 changes: 18 additions & 2 deletions integration-tests/starcoin_dao/starcoin_upgrade_module.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 44 tasks
processed 45 tasks

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

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

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