Skip to content
Closed
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
17 changes: 16 additions & 1 deletion contracts/proposal/dao-proposal-single/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ pub fn execute_propose(

let total_power = get_total_power(deps.as_ref(), &config.dao, Some(env.block.height))?;

// If the proposer has all of the voting power, the proposal
// should be created and auto passed.
let proposer_voting_power = get_voting_power(
deps.as_ref(),
proposer.clone(),
&config.dao,
Some(env.block.height),
)?;

let status = if total_power == proposer_voting_power {
Status::Open
} else {
Status::Passed
};

let proposal = {
// Limit mutability to this block.
let mut proposal = SingleChoiceProposal {
Expand All @@ -210,7 +225,7 @@ pub fn execute_propose(
threshold: config.threshold,
total_power,
msgs,
status: Status::Open,
status,
votes: Votes::zero(),
allow_revoting: config.allow_revoting,
};
Expand Down