Skip to content

Commit

Permalink
Remove proposal_id field from Ballot structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ueco-jb committed Feb 22, 2022
1 parent af211cd commit 165e7f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/voting-contract/src/ballots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::ContractError;
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
pub struct Ballot {
pub voter: Addr,
pub proposal_id: u64,
pub points: u64,
pub vote: Vote,
}
Expand Down Expand Up @@ -58,7 +57,6 @@ impl<'a> Ballots<'a> {
Some(_) => Err(ContractError::AlreadyVoted {}),
None => Ok(Ballot {
voter: addr.clone(),
proposal_id,
points,
vote,
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/voting-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ pub fn list_votes_by_voter<Q: CustomQuery>(
.range(deps.storage, start, None, Order::Ascending)
.take(limit)
.map(|item| {
let (_, ballot) = item?;
let ((proposal_id, _), ballot) = item?;
Ok(VoteInfo {
proposal_id: ballot.proposal_id,
proposal_id,
voter: ballot.voter.into(),
vote: ballot.vote,
points: ballot.points,
Expand Down

0 comments on commit 165e7f6

Please sign in to comment.