1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use crate::{
    account,
    certificate::{ExternalProposalId, VotePlanId},
    date::BlockDate,
    tokens::identifier::TokenIdentifier,
    vote::{Options, PayloadType, Tally},
};
use chain_vote::MemberPublicKey;
use imhamt::Hamt;
use std::collections::hash_map::DefaultHasher;

pub struct VotePlanStatus {
    pub id: VotePlanId,
    pub payload: PayloadType,
    pub vote_start: BlockDate,
    pub vote_end: BlockDate,
    pub committee_end: BlockDate,
    pub committee_public_keys: Vec<MemberPublicKey>,
    pub proposals: Vec<VoteProposalStatus>,
    pub voting_token: TokenIdentifier,
}

pub struct VoteProposalStatus {
    pub index: u8,
    pub proposal_id: ExternalProposalId,
    pub options: Options,
    pub tally: Tally,
    pub votes: Hamt<DefaultHasher, account::Identifier, ()>,
}