getters.gno
ExistsProposal
func ExistsProposal(
proposalID int64
) boolExistsProposal checks whether a proposal is stored.
Parameters
proposalID
int64
proposal identifier to look up
Return Values
bool
bool
true when proposalID is stored, otherwise false
ExistsVotingInfo
ExistsVotingInfo checks whether voting information exists for a user on a proposal.
Parameters
proposalID
int64
proposal identifier to inspect
addr
address
voter address to look up within proposalID
Return Values
bool
bool
true when voting information exists for the proposal and address
GetConfigVersionByProposalId
GetConfigVersionByProposalId returns the config version used by a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
int64
int64
governance configuration version captured by the proposal
error
error
nil on success, or an error when the proposal does not exist
GetCurrentProposalID
GetCurrentProposalID returns the current proposal ID counter.
Return Values
int64
int64
current proposal ID counter used for newly created proposals
GetCurrentVotingWeightSnapshot
GetCurrentVotingWeightSnapshot returns the current total voting weight and its timestamp anchor computed with the configured smoothing duration.
Return Values
int64
int64
total voting weight averaged over the configured smoothing window
int64
int64
Unix timestamp used as the snapshot history anchor
error
error
nil on success, or an error when the current configuration or snapshot data cannot be retrieved
GetDescriptionByProposalId
GetDescriptionByProposalId returns the description of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
string
string
proposal description
error
error
nil on success, or an error when the proposal does not exist
GetLatestConfigVersion
GetLatestConfigVersion returns the current governance configuration version.
Return Values
int64
int64
latest configuration version stored by governance
GetMaxSmoothingPeriod
GetMaxSmoothingPeriod returns the maximum smoothing period for delegation history cleanup.
Return Values
int64
int64
maximum permitted smoothing period in seconds
GetNayByProposalId
GetNayByProposalId returns the no vote weight of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
int64
int64
total voting weight recorded for no votes
error
error
nil on success, or an error when the proposal does not exist
GetOldestActiveProposalSnapshotTime
GetOldestActiveProposalSnapshotTime returns the oldest active proposal's timestamp anchor. An empty index returns no active proposal; a stale or missing first entry returns an error so cleanup cannot silently skip it.
Return Values
int64
int64
snapshot timestamp of the oldest active proposal, or zero when the index is empty or an error occurs
bool
bool
true when an active proposal was found at the oldest index entry, otherwise false
error
error
nil for an empty index or active entry, or an error when the entry is missing or inactive
GetProposalCreatedAt
GetProposalCreatedAt returns the creation timestamp of a proposal.
Parameters
proposalId
int64
proposal identifier to look up
Return Values
int64
int64
Unix timestamp at which the proposal was created
error
error
nil on success, or an error when the proposal does not exist
GetProposalCreatedHeight
GetProposalCreatedHeight returns the creation block height of a proposal.
Parameters
proposalId
int64
proposal identifier to look up
Return Values
int64
int64
block height at which the proposal was created
error
error
nil on success, or an error when the proposal does not exist
GetProposalStatusByProposalId
GetProposalStatusByProposalId returns the current status of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
string
string
status computed from the proposal and the current Unix time
error
error
nil on success, or an error when the proposal does not exist
GetProposals
GetProposals returns a read-only view of every proposal, keyed by the decimal string form of the proposal ID. Callers paginate it themselves through IterateByOffset. Reading an entry yields a clone, so the view cannot mutate realm state.
Return Values
*rotree.ReadOnlyTree
*rotree.ReadOnlyTree
read-only proposal tree keyed by decimal proposal ID
GetProposerByProposalId
GetProposerByProposalId returns the proposer address of a proposal.
Parameters
proposalId
int64
proposal identifier to look up
Return Values
address
address
address that submitted the proposal
error
error
nil on success, or an error when the proposal does not exist
GetQuorumAmountByProposalId
GetQuorumAmountByProposalId returns the quorum requirement for a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
int64
int64
minimum voting weight required for the proposal's quorum
error
error
nil on success, or an error when the proposal does not exist
GetTitleByProposalId
GetTitleByProposalId returns the title of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
string
string
proposal title
error
error
nil on success, or an error when the proposal does not exist
GetUserProposals
GetUserProposals returns a read-only view of the proposals created per user, keyed by creator address with the creator's proposal IDs as the value. Reading an entry yields a copy of the ID slice, so the view cannot mutate realm state.
Return Values
*rotree.ReadOnlyTree
*rotree.ReadOnlyTree
read-only user-proposal tree keyed by creator address
GetVoteStatus
GetVoteStatus returns the vote status of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
quorum
int64
minimum vote weight required for the proposal to pass
maxVotingWeight
int64
maximum possible voting weight recorded for the proposal
yesWeight
int64
total weight of yes votes
noWeight
int64
total weight of no votes
err
error
nil on success, or an error when the proposal does not exist
GetVoteWeight
GetVoteWeight returns the voting weight of an address for a proposal.
Parameters
proposalID
int64
proposal identifier to inspect
addr
address
voter address whose recorded vote weight is requested
Return Values
int64
int64
weight recorded for addr's vote
error
error
nil on success, or an error when no voting information exists for the proposal and address
GetVotedAt
GetVotedAt returns the timestamp when an address voted on a proposal.
Parameters
proposalID
int64
proposal identifier to inspect
addr
address
voter address whose vote timestamp is requested
Return Values
int64
int64
Unix timestamp recorded for addr's vote
error
error
nil on success, or an error when no voting information exists for the proposal and address
GetVotedHeight
GetVotedHeight returns the block height when an address voted on a proposal.
Parameters
proposalID
int64
proposal identifier to inspect
addr
address
voter address whose vote height is requested
Return Values
int64
int64
block height recorded for addr's vote
error
error
nil on success, or an error when no voting information exists for the proposal and address
GetVotingInfos
GetVotingInfos returns a read-only view of a proposal's value-backed voting infos, keyed by voter address. Existing proposals have an empty view before the first vote; nil is returned only when the stored voting-info tree is absent.
Parameters
proposalID
int64
proposal identifier whose voting information is requested
Return Values
*rotree.ReadOnlyTree
*rotree.ReadOnlyTree
read-only voting-info tree keyed by voter address, or nil when no tree is stored
GetYeaByProposalId
GetYeaByProposalId returns the yes vote weight of a proposal.
Parameters
proposalId
int64
proposal identifier to inspect
Return Values
int64
int64
total voting weight recorded for yes votes
error
error
nil on success, or an error when the proposal does not exist
Last updated