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

getters.gno

ExistsProposal

func ExistsProposal(
	proposalID int64
) bool

ExistsProposal checks whether a proposal is stored.

Parameters

Name
Type
Description

proposalID

int64

proposal identifier to look up

Return Values

Name
Type
Description

bool

bool

true when proposalID is stored, otherwise false

source

ExistsVotingInfo

ExistsVotingInfo checks whether voting information exists for a user on a proposal.

Parameters

Name
Type
Description

proposalID

int64

proposal identifier to inspect

addr

address

voter address to look up within proposalID

Return Values

Name
Type
Description

bool

bool

true when voting information exists for the proposal and address

source

GetConfigVersionByProposalId

GetConfigVersionByProposalId returns the config version used by a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

int64

int64

governance configuration version captured by the proposal

error

error

nil on success, or an error when the proposal does not exist

source

GetCurrentProposalID

GetCurrentProposalID returns the current proposal ID counter.

Return Values

Name
Type
Description

int64

int64

current proposal ID counter used for newly created proposals

source

GetCurrentVotingWeightSnapshot

GetCurrentVotingWeightSnapshot returns the current total voting weight and its timestamp anchor computed with the configured smoothing duration.

Return Values

Name
Type
Description

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

source

GetDescriptionByProposalId

GetDescriptionByProposalId returns the description of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

string

string

proposal description

error

error

nil on success, or an error when the proposal does not exist

source

GetLatestConfigVersion

GetLatestConfigVersion returns the current governance configuration version.

Return Values

Name
Type
Description

int64

int64

latest configuration version stored by governance

source

GetMaxSmoothingPeriod

GetMaxSmoothingPeriod returns the maximum smoothing period for delegation history cleanup.

Return Values

Name
Type
Description

int64

int64

maximum permitted smoothing period in seconds

source

GetNayByProposalId

GetNayByProposalId returns the no vote weight of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

int64

int64

total voting weight recorded for no votes

error

error

nil on success, or an error when the proposal does not exist

source

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

Name
Type
Description

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

source

GetProposalCreatedAt

GetProposalCreatedAt returns the creation timestamp of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to look up

Return Values

Name
Type
Description

int64

int64

Unix timestamp at which the proposal was created

error

error

nil on success, or an error when the proposal does not exist

source

GetProposalCreatedHeight

GetProposalCreatedHeight returns the creation block height of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to look up

Return Values

Name
Type
Description

int64

int64

block height at which the proposal was created

error

error

nil on success, or an error when the proposal does not exist

source

GetProposalStatusByProposalId

GetProposalStatusByProposalId returns the current status of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

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

source

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

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

read-only proposal tree keyed by decimal proposal ID

source

GetProposerByProposalId

GetProposerByProposalId returns the proposer address of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to look up

Return Values

Name
Type
Description

address

address

address that submitted the proposal

error

error

nil on success, or an error when the proposal does not exist

source

GetQuorumAmountByProposalId

GetQuorumAmountByProposalId returns the quorum requirement for a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

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

source

GetTitleByProposalId

GetTitleByProposalId returns the title of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

string

string

proposal title

error

error

nil on success, or an error when the proposal does not exist

source

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

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

read-only user-proposal tree keyed by creator address

source

GetVoteStatus

GetVoteStatus returns the vote status of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

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

source

GetVoteWeight

GetVoteWeight returns the voting weight of an address for a proposal.

Parameters

Name
Type
Description

proposalID

int64

proposal identifier to inspect

addr

address

voter address whose recorded vote weight is requested

Return Values

Name
Type
Description

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

source

GetVotedAt

GetVotedAt returns the timestamp when an address voted on a proposal.

Parameters

Name
Type
Description

proposalID

int64

proposal identifier to inspect

addr

address

voter address whose vote timestamp is requested

Return Values

Name
Type
Description

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

source

GetVotedHeight

GetVotedHeight returns the block height when an address voted on a proposal.

Parameters

Name
Type
Description

proposalID

int64

proposal identifier to inspect

addr

address

voter address whose vote height is requested

Return Values

Name
Type
Description

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

source

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

Name
Type
Description

proposalID

int64

proposal identifier whose voting information is requested

Return Values

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

read-only voting-info tree keyed by voter address, or nil when no tree is stored

source

GetYeaByProposalId

GetYeaByProposalId returns the yes vote weight of a proposal.

Parameters

Name
Type
Description

proposalId

int64

proposal identifier to inspect

Return Values

Name
Type
Description

int64

int64

total voting weight recorded for yes votes

error

error

nil on success, or an error when the proposal does not exist

source

Last updated