Skip to content

Commit

Permalink
fix: check vote ended
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 committed May 3, 2024
1 parent fd09763 commit 62f6238
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Binary file modified precompile/binaries/stdlib/vip_weight_vote.mv
Binary file not shown.
2 changes: 2 additions & 0 deletions precompile/modules/initia_stdlib/sources/vip/weight_vote.move
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ module initia_std::vip_weight_vote {
proposal_id: u64,
vote_yes: bool,
) acquires ModuleStore {
let (_, timestamp) = get_block_info();
let vote_option = if (vote_yes) {
1
} else {
Expand All @@ -418,6 +419,7 @@ module initia_std::vip_weight_vote {
let key = table_key::encode_u64(proposal_id);
assert!(table::contains(&module_store.proposals, key), error::not_found(EPROPOSAL_NOT_FOUND));
let proposal = table::borrow_mut(&mut module_store.proposals, key);
assert!(timestamp < proposal.voting_end_time, error::invalid_state(EVOTING_END));

let voting_power_stage = table_key::encode_u64(proposal.voting_power_stage);
let weight_vote = table::borrow(&module_store.weight_votes, voting_power_stage);
Expand Down

0 comments on commit 62f6238

Please sign in to comment.