For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

source

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

Name
Type
Description

int64

int64

available voting weight

source

IsVoted

IsVoted checks if the user has already cast their vote.

Return Values

Name
Type
Description

bool

bool

true if user has voted on this proposal

source

VotedAt

VotedAt returns the timestamp when the vote was cast. Returns 0 if the user hasn't voted yet.

Return Values

Name
Type
Description

int64

int64

timestamp when vote was cast

source

VotedHeight

VotedHeight returns the block height when the vote was cast. Returns 0 if the user hasn't voted yet.

Return Values

Name
Type
Description

int64

int64

block height when vote was cast

source

VotedNo

VotedNo checks if the user voted "no" on the proposal. Only meaningful if IsVoted() returns true.

Return Values

Name
Type
Description

bool

bool

true if user voted "no"

source

VotedWeight

VotedWeight returns the weight actually used when voting. Returns 0 if the user hasn't voted yet.

Return Values

Name
Type
Description

int64

int64

weight used for voting, or 0 if not voted

source

VotedYes

VotedYes checks if the user voted "yes" on the proposal. Only meaningful if IsVoted() returns true.

Return Values

Name
Type
Description

bool

bool

true if user voted "yes"

source

VotingType

VotingType returns a human-readable string representation of the vote choice.

Return Values

Name
Type
Description

string

string

"yes" or "no" based on voting choice

source

Constructors

  • func DefaultVotingInfo() VotingInfo (source)

  • func NewVotedVotingInfo(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) VotingInfo (source)

  • func NewVotingInfo(availableVoteWeight int64) VotingInfo (source)

Last updated