voting_info.gno
Types
VotingInfo
VotingInfo tracks voting-related information for a specific user on a specific proposal. This structure maintains the user's voting eligibility, voting history, and voting power.
Methods
AvailableVoteWeight
AvailableVoteWeight returns the total voting weight available to this user. This weight is determined at proposal creation time based on delegation snapshots.
Return Values
int64
int64
available voting weight
IsVoted
IsVoted checks if the user has already cast their vote.
Return Values
bool
bool
true if user has voted on this proposal
VotedAt
VotedAt returns the timestamp when the vote was cast. Returns 0 if the user hasn't voted yet.
Return Values
int64
int64
timestamp when vote was cast
VotedHeight
VotedHeight returns the block height when the vote was cast. Returns 0 if the user hasn't voted yet.
Return Values
int64
int64
block height when vote was cast
VotedNo
VotedNo checks if the user voted "no" on the proposal. Only meaningful if IsVoted() returns true.
Return Values
bool
bool
true if user voted "no"
VotedWeight
VotedWeight returns the weight actually used when voting. Returns 0 if the user hasn't voted yet.
Return Values
int64
int64
weight used for voting, or 0 if not voted
VotedYes
VotedYes checks if the user voted "yes" on the proposal. Only meaningful if IsVoted() returns true.
Return Values
bool
bool
true if user voted "yes"
VotingType
VotingType returns a human-readable string representation of the vote choice.
Return Values
string
string
"yes" or "no" based on voting choice
Constructors
Last updated