Skip to content

Commit

Permalink
cast vote as abstract account
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckram123 committed Oct 10, 2023
1 parent f3f642a commit dc39dec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/contracts/apps/challenge/src/handlers/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,15 @@ fn cast_vote(
) -> AppResult {
let challenge = CHALLENGE_LIST.load(deps.storage, challenge_id)?;
let proposal_id = challenge.current_proposal_id;
let voter = match app
.account_registry(deps.as_ref())
.assert_proxy(&info.sender)
{
Ok(base) => base.manager,
Err(_) => info.sender,
};
let proposal_info =
SIMPLE_VOTING.cast_vote(deps.storage, &env.block, proposal_id, &info.sender, vote)?;
SIMPLE_VOTING.cast_vote(deps.storage, &env.block, proposal_id, &voter, vote)?;

Ok(app
.tag_response(Response::new(), "cast_vote")
Expand Down

0 comments on commit dc39dec

Please sign in to comment.