Skip to content

Commit

Permalink
[Feature] Proposal add title and introduction (#183)
Browse files Browse the repository at this point in the history
* Add title and introduction

* description -> extend

* Event add introduction
  • Loading branch information
WGB5445 committed Oct 17, 2022
1 parent f186ec8 commit 4ebe51b
Show file tree
Hide file tree
Showing 30 changed files with 231 additions and 173 deletions.
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/MemberProposalPlugin.mv
Binary file not shown.
6 changes: 3 additions & 3 deletions build/StarcoinFramework/docs/InstallPluginProposalPlugin.md
Expand Up @@ -150,7 +150,7 @@



<pre><code><b>public</b> <b>fun</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store, ToInstallPluginT: store&gt;(sender: &signer, required_caps: vector&lt;<a href="DAOSpace.md#0x1_DAOSpace_CapType">DAOSpace::CapType</a>&gt;, description: vector&lt;u8&gt;, action_delay: u64)
<pre><code><b>public</b> <b>fun</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store, ToInstallPluginT: store&gt;(sender: &signer, required_caps: vector&lt;<a href="DAOSpace.md#0x1_DAOSpace_CapType">DAOSpace::CapType</a>&gt;, title: vector&lt;u8&gt;, introduction: vector&lt;u8&gt;, description: vector&lt;u8&gt;, action_delay: u64)
</code></pre>


Expand All @@ -159,15 +159,15 @@
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store, ToInstallPluginT: store&gt;(sender: &signer, required_caps: vector&lt;CapType&gt;, description: vector&lt;u8&gt;, action_delay: u64){
<pre><code><b>public</b> <b>fun</b> <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store, ToInstallPluginT: store&gt;(sender: &signer, required_caps: vector&lt;CapType&gt;, title:vector&lt;u8&gt;, introduction:vector&lt;u8&gt;, description: vector&lt;u8&gt;, action_delay: u64){
<b>let</b> witness = <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin">InstallPluginProposalPlugin</a>{};

<b>let</b> cap = <a href="DAOSpace.md#0x1_DAOSpace_acquire_proposal_cap">DAOSpace::acquire_proposal_cap</a>&lt;DAOT, <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin">InstallPluginProposalPlugin</a>&gt;(&witness);
<b>let</b> action = <a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_InstallPluginAction">InstallPluginAction</a>&lt;ToInstallPluginT&gt;{
required_caps,
};

<a href="DAOSpace.md#0x1_DAOSpace_create_proposal">DAOSpace::create_proposal</a>(&cap, sender, action, description, action_delay);
<a href="DAOSpace.md#0x1_DAOSpace_create_proposal">DAOSpace::create_proposal</a>(&cap, sender, action, title, introduction, description, action_delay);
}
</code></pre>

Expand Down
24 changes: 12 additions & 12 deletions build/StarcoinFramework/docs/MemberProposalPlugin.md
Expand Up @@ -197,7 +197,7 @@



<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store&gt;(sender: &signer, description: vector&lt;u8&gt;, member: <b>address</b>, image_data: vector&lt;u8&gt;, image_url: vector&lt;u8&gt;, init_sbt: u128, action_delay: u64)
<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store&gt;(sender: &signer, title: vector&lt;u8&gt;, introduction: vector&lt;u8&gt;, description: vector&lt;u8&gt;, member: <b>address</b>, image_data: vector&lt;u8&gt;, image_url: vector&lt;u8&gt;, init_sbt: u128, action_delay: u64)
</code></pre>


Expand All @@ -206,7 +206,7 @@
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store&gt;(sender: &signer, description: vector&lt;u8&gt;, member: <b>address</b>, image_data:vector&lt;u8&gt;, image_url:vector&lt;u8&gt;, init_sbt: u128, action_delay: u64){
<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT: store&gt;(sender: &signer, title:vector&lt;u8&gt;, introduction:vector&lt;u8&gt;, description: vector&lt;u8&gt;, member: <b>address</b>, image_data:vector&lt;u8&gt;, image_url:vector&lt;u8&gt;, init_sbt: u128, action_delay: u64){
<b>let</b> witness = <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin">MemberProposalPlugin</a>{};
<b>let</b> cap = <a href="DAOSpace.md#0x1_DAOSpace_acquire_proposal_cap">DAOSpace::acquire_proposal_cap</a>&lt;DAOT, <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin">MemberProposalPlugin</a>&gt;(&witness);
<b>let</b> action = <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a>{
Expand All @@ -217,7 +217,7 @@
};
<b>assert</b>!(!<a href="DAOSpace.md#0x1_DAOSpace_is_exist_member_offer">DAOSpace::is_exist_member_offer</a>&lt;DAOT&gt;(member), <a href="Errors.md#0x1_Errors_already_published">Errors::already_published</a>(<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_ERR_MEMBER_OFFER_EXIST">ERR_MEMBER_OFFER_EXIST</a>));
<b>assert</b>!(!<a href="DAOSpace.md#0x1_DAOSpace_is_member">DAOSpace::is_member</a>&lt;DAOT&gt;(member), <a href="Errors.md#0x1_Errors_already_published">Errors::already_published</a>(<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_ERR_MEMBER_EXIST">ERR_MEMBER_EXIST</a>));
<a href="DAOSpace.md#0x1_DAOSpace_create_proposal">DAOSpace::create_proposal</a>(&cap, sender, action, description, action_delay);
<a href="DAOSpace.md#0x1_DAOSpace_create_proposal">DAOSpace::create_proposal</a>(&cap, sender, action, title, introduction, description, action_delay);
}
</code></pre>

Expand All @@ -231,7 +231,7 @@



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal_entry">create_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, description: vector&lt;u8&gt;, member: <b>address</b>, image_data: vector&lt;u8&gt;, image_url: vector&lt;u8&gt;, init_sbt: u128, action_delay: u64)
<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal_entry">create_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, title: vector&lt;u8&gt;, introduction: vector&lt;u8&gt;, description: vector&lt;u8&gt;, member: <b>address</b>, image_data: vector&lt;u8&gt;, image_url: vector&lt;u8&gt;, init_sbt: u128, action_delay: u64)
</code></pre>


Expand All @@ -240,8 +240,8 @@
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal_entry">create_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, description: vector&lt;u8&gt;, member: <b>address</b>, image_data:vector&lt;u8&gt;, image_url:vector&lt;u8&gt;, init_sbt: u128, action_delay: u64){
<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT&gt;(&sender, description, member, image_data, image_url, init_sbt, action_delay);
<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal_entry">create_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, title:vector&lt;u8&gt;, introduction:vector&lt;u8&gt;, description: vector&lt;u8&gt;, member: <b>address</b>, image_data:vector&lt;u8&gt;, image_url:vector&lt;u8&gt;, init_sbt: u128, action_delay: u64){
<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_create_proposal">create_proposal</a>&lt;DAOT&gt;(&sender, title, introduction, description, member, image_data, image_url, init_sbt, action_delay);
}
</code></pre>

Expand Down Expand Up @@ -307,7 +307,7 @@



<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT: store&gt;(sender: &signer, description: vector&lt;u8&gt;, action_delay: u64)
<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT: store&gt;(sender: &signer, title: vector&lt;u8&gt;, introduction: vector&lt;u8&gt;, description: vector&lt;u8&gt;, action_delay: u64)
</code></pre>


Expand All @@ -316,8 +316,8 @@
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT:store&gt;(sender:&signer, description: vector&lt;u8&gt;,action_delay:u64){
<a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">InstallPluginProposalPlugin::create_proposal</a>&lt;DAOT, <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a>&gt;(sender, <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_required_caps">required_caps</a>(), description, action_delay);
<pre><code><b>public</b> <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT:store&gt;(sender:&signer, title:vector&lt;u8&gt;, introduction:vector&lt;u8&gt;, description: vector&lt;u8&gt;,action_delay:u64){
<a href="InstallPluginProposalPlugin.md#0x1_InstallPluginProposalPlugin_create_proposal">InstallPluginProposalPlugin::create_proposal</a>&lt;DAOT, <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_MemberJoinAction">MemberJoinAction</a>&gt;(sender, <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_required_caps">required_caps</a>(), title, introduction, description, action_delay);
}
</code></pre>

Expand All @@ -331,7 +331,7 @@



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal_entry">install_plugin_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, description: vector&lt;u8&gt;, action_delay: u64)
<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal_entry">install_plugin_proposal_entry</a>&lt;DAOT: store&gt;(sender: signer, title: vector&lt;u8&gt;, introduction: vector&lt;u8&gt;, description: vector&lt;u8&gt;, action_delay: u64)
</code></pre>


Expand All @@ -340,8 +340,8 @@
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal_entry">install_plugin_proposal_entry</a>&lt;DAOT:store&gt;(sender:signer, description: vector&lt;u8&gt;, action_delay:u64){
<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT&gt;(&sender, description, action_delay);
<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal_entry">install_plugin_proposal_entry</a>&lt;DAOT:store&gt;(sender:signer, title:vector&lt;u8&gt;, introduction:vector&lt;u8&gt;, description: vector&lt;u8&gt;, action_delay:u64){
<a href="MemberProposalPlugin.md#0x1_MemberProposalPlugin_install_plugin_proposal">install_plugin_proposal</a>&lt;DAOT&gt;(&sender, title, introduction, description, action_delay);
}
</code></pre>

Expand Down
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/MemberProposalPlugin.mvsm
Binary file not shown.
4 changes: 2 additions & 2 deletions integration-tests/daospace/dao_proposal.exp
Expand Up @@ -60,7 +60,7 @@ task 22 'run'. lines 299-310:

task 23 'run'. lines 313-337:
{
"gas_used": 476235,
"gas_used": 480715,
"status": "Executed"
}

Expand Down Expand Up @@ -109,7 +109,7 @@ task 34 'run'. lines 402-415:

task 36 'run'. lines 420-435:
{
"gas_used": 106454,
"gas_used": 106530,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_proposal.move
Expand Up @@ -103,7 +103,7 @@ module creator::DAOHelper {
total,
receiver,
};
let proposal_id = DAOSpace::create_proposal(&cap, sender, action, b"ipfs://description", action_delay);
let proposal_id = DAOSpace::create_proposal(&cap, sender, action,b"title",b"ipfs://introduction", b"ipfs://extend", action_delay);
checkpoint<DAOT>(proposal_id);

proposal_id
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_proposal_rejected.move
Expand Up @@ -81,7 +81,7 @@ module creator::DAOHelper {
total,
receiver,
};
let proposal_id = DAOSpace::create_proposal(&cap, sender, action, b"ipfs://description", action_delay);
let proposal_id = DAOSpace::create_proposal(&cap, sender, action,b"title",b"ipfs://introduction", b"ipfs://extend", action_delay);
checkpoint<DAOT>(proposal_id);

proposal_id
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/gas_oracle_plugin.exp
Expand Up @@ -38,7 +38,7 @@ task 16 'run'. lines 140-149:

task 17 'run'. lines 152-177:
{
"gas_used": 449602,
"gas_used": 459302,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/gas_oracle_plugin.move
Expand Up @@ -160,7 +160,7 @@ script {
fun main(account: signer) {
let description = b"oracle select proposal";
let action_delay = 0;
GasOracleProposalPlugin::create_oracle_add_proposal<XDAO, AliceToken>(account, description, action_delay, @alice);
GasOracleProposalPlugin::create_oracle_add_proposal<XDAO, AliceToken>(account, b"oracle select proposal",b"oracle select proposal", description, action_delay, @alice);
let proposal = DAOSpace::proposal<XDAO>(1);
let proposer = DAOSpace::proposal_proposer(&proposal);
let (start_time, end_time) = DAOSpace::proposal_time(&proposal);
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/mint_proposal_plugin.exp
Expand Up @@ -55,7 +55,7 @@ task 19 'run'. lines 164-173:

task 20 'run'. lines 175-206:
{
"gas_used": 450230,
"gas_used": 456366,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/mint_proposal_plugin.move
Expand Up @@ -186,7 +186,7 @@ script {
let amount = 100000;
let action_delay = 0;
MintProposalPlugin::create_mint_proposal<XDAO, AliceToken>(
&sender, description, @bob, amount, action_delay);
&sender,b"mint to bob", b"mint to bob", description, @bob, amount, action_delay);

let proposal = DAOSpace::proposal<XDAO>(1);

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/daospaceplugin/salary_gov_plugin.move
Expand Up @@ -161,14 +161,14 @@ module creator::SalaryGovPlugin {
}

/// Create proposal for specific admin account
public(script) fun create_boss_elect_proposal<DAOT: store>(sender: signer, description: vector<u8>, action_delay: u64) {
public(script) fun create_boss_elect_proposal<DAOT: store>(sender: signer, title:vector<u8>, introduction:vector<u8>, description: vector<u8>, action_delay: u64) {
let witness = SalaryGovPlugin {};

let cap = DAOSpace::acquire_proposal_cap<DAOT, SalaryGovPlugin>(&witness);
let action = BossProposalAction<DAOT> {
boss: Signer::address_of(&sender)
};
DAOSpace::create_proposal(&cap, &sender, action, description, action_delay);
DAOSpace::create_proposal(&cap, &sender, action, title, introduction, description, action_delay);
}

public(script) fun execute_proposal<DAOT: store>(sender: signer, proposal_id: u64) {
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/starcoin_dao/starcoin_onchain_config.exp
Expand Up @@ -38,7 +38,7 @@ task 21 'run'. lines 111-120:

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

Expand Down Expand Up @@ -98,7 +98,7 @@ task 40 'run'. lines 232-248:

task 41 'run'. lines 250-261:
{
"gas_used": 164164,
"gas_used": 164212,
"status": {
"MoveAbort": {
"location": {
Expand Down
Expand Up @@ -127,7 +127,7 @@ script {

fun propose (sender: signer){
assert!(RewardConfig::reward_delay() == 1, 101);
OnChainStarcoinDAOConfig::propose_update_reward_config(&sender, b"update", 5 , 3600000);
OnChainStarcoinDAOConfig::propose_update_reward_config(&sender, b"update",b"update",b"update", 5 , 3600000);
}
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/starcoin_dao/starcoin_upgrade_module.exp
Expand Up @@ -38,7 +38,7 @@ task 21 'run'. lines 111-120:

task 23 'run'. lines 127-137:
{
"gas_used": 434673,
"gas_used": 441669,
"status": "Executed"
}

Expand Down
Expand Up @@ -131,7 +131,7 @@ script{

//alice create proposal
fun create_proposal(sender: signer, package_hash: vector<u8>){
UpgradeModulePlugin::create_proposal<StarcoinDAO>(&sender, b"Upgrade module", 3600000, package_hash, 1, true);
UpgradeModulePlugin::create_proposal<StarcoinDAO>(&sender,b"Upgrade module", b"Upgrade module" ,b"Upgrade module", 3600000, package_hash, 1, true);
}
}
// check: EXECUTED
Expand Down

0 comments on commit 4ebe51b

Please sign in to comment.