Skip to content

Commit

Permalink
Update proposal.rs (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsehow authored Dec 15, 2022
1 parent 9afa125 commit 457dfea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/proposal/dao-proposal-single/src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ pub fn advance_proposal_id(store: &mut dyn Storage) -> StdResult<u64> {

impl SingleChoiceProposal {
/// Consumes the proposal and returns a version which may be used
/// in a query response. The difference being that proposal
/// in a query response. Why is this necessary? Proposal
/// statuses are only updated on vote, execute, and close
/// events. It is possible though that since a vote has occured
/// the proposal expiring has changed its status. This method
/// recomputes the status so that queries get accurate
/// information.
/// events; thus, it is possible that, if the proposal expires since
/// a vote has occurred, the status we read from the proposal status
/// may be out of date. This method recomputes the status so that
/// queries get accurate information.
pub fn into_response(mut self, block: &BlockInfo, id: u64) -> ProposalResponse {
self.update_status(block);
ProposalResponse { id, proposal: self }
Expand Down

0 comments on commit 457dfea

Please sign in to comment.