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

[Feature] Proposal add title and introduction #183

Merged
merged 7 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions integration-tests/daospace/dao_proposal.exp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ task 22 'run'. lines 300-311:

task 23 'run'. lines 314-338:
{
"gas_used": 482246,
"gas_used": 479496,
"status": "Executed"
}

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

task 36 'run'. lines 421-436:
{
"gas_used": 106598,
"gas_used": 106530,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_proposal.move
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module creator::DAOHelper {
total,
receiver,
};
let proposal_id = DAOSpace::create_proposal(&cap, sender, action,b"ipfs://description",b"ipfs://description", 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
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module creator::DAOHelper {
total,
receiver,
};
let proposal_id = DAOSpace::create_proposal(&cap, sender, action,b"ipfs://description",b"ipfs://description", 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
14 changes: 7 additions & 7 deletions sources/daospace/DAOSpace.move
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,8 @@ module StarcoinFramework::DAOSpace {
title: vector<u8>,
/// introduction of proposal , short introduction
introduction:vector<u8>,
/// description of proposal , ipfs://
description:vector<u8>,
/// extend of proposal , ipfs:// | { "title":"xxxxx",........ }
extend:vector<u8>,
/// when voting begins.
start_time: u64,
/// when voting ends.
Expand Down Expand Up @@ -1634,8 +1634,8 @@ module StarcoinFramework::DAOSpace {
title: vector<u8>,
/// the proposal id.
proposal_id: u64,
/// description of proposal , ipfs://
description: vector<u8>,
/// extend of proposal , ipfs:// | { "title":"xxxxx",........ }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event 里是不是也包含上 introduction 字段

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event 里是不是也包含上 introduction 字段

这里有想过加,但是考虑event 都是后端抓取,需要比较全面的信息,所以会直接取IPFS的信息?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event 里是不是也包含上 introduction 字段

这里有想过加,但是考虑event 都是后端抓取,需要比较全面的信息,所以会直接取IPFS的信息?

如果有了 title 和 introduction, ipfs 的扩展就不是必须的了吧。感觉还是加全了。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event 里是不是也包含上 introduction 字段

这里有想过加,但是考虑event 都是后端抓取,需要比较全面的信息,所以会直接取IPFS的信息?

如果有了 title 和 introduction, ipfs 的扩展就不是必须的了吧。感觉还是加全了。

fixed

extend: vector<u8>,
/// proposer is the user who create the proposal.
proposer: address,
}
Expand Down Expand Up @@ -1676,7 +1676,7 @@ module StarcoinFramework::DAOSpace {
action: ActionT,
title: vector<u8>,
introduction: vector<u8>,
description: vector<u8>,
extend: vector<u8>,
action_delay: u64,
): u64 acquires DAO, GlobalProposals, DAOAccountCapHolder, ProposalActions, ProposalEvent, GlobalProposalActions {
// check DAO member
Expand Down Expand Up @@ -1705,7 +1705,7 @@ module StarcoinFramework::DAOSpace {
proposer,
title: copy title,
introduction: copy introduction,
description: copy description,
extend: copy extend,
start_time,
end_time: start_time + voting_period,
yes_votes: 0,
Expand Down Expand Up @@ -1772,7 +1772,7 @@ module StarcoinFramework::DAOSpace {
let dao_id = dao_id(dao_address);
let proposal_event = borrow_global_mut<ProposalEvent<DAOT>>(dao_address);
Event::emit_event(&mut proposal_event.proposal_create_event,
ProposalCreatedEvent { dao_id, proposal_id, title, description: copy description, proposer },
ProposalCreatedEvent { dao_id, proposal_id, title, extend: copy extend, proposer },
);

proposal_id
Expand Down