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

proposal.gno

NewProposalTree

func NewProposalTree() *bptree.BPTree

NewProposalTree creates an empty B+ tree for proposals keyed by proposal ID.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty 16-way proposal tree

source

NewProposalUserVotingInfoTree

NewProposalUserVotingInfoTree creates an empty B+ tree mapping proposal IDs to their per-user voting-information trees.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty 16-way proposal voting-information index tree

source

NewUserProposalTree

NewUserProposalTree creates an empty B+ tree mapping users to proposal IDs.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty 16-way user-proposal index tree

source

NewVotingInfoTree

NewVotingInfoTree creates an empty B+ tree for per-user voting information.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty 16-way voting-information tree

source

Types

Proposal

Proposal represents a governance proposal with all its associated data and state. This is the core structure that tracks proposal lifecycle from creation to execution.

source

Methods

Clone

Clone returns a deep copy of the proposal, including its type-specific data and nested execution messages.

The returned proposal and all nested status, metadata, data, and message values are independent copies; mutating the clone does not mutate realm state.

Return Values

Name
Type
Description

*Proposal

*Proposal

independent proposal copy, or nil when the receiver is nil

source

ConfigVersion

ConfigVersion returns the governance configuration version used by the proposal.

Return Values

Name
Type
Description

int64

int64

configuration version captured when the proposal was created

source

CreatedAt

CreatedAt returns the proposal creation timestamp recorded in its schedule.

Return Values

Name
Type
Description

int64

int64

proposal creation timestamp

source

CreatedHeight

CreatedHeight returns the block height at which the proposal was created.

Return Values

Name
Type
Description

int64

int64

proposal creation block height

source

Data

Data returns the proposal's type-specific data.

Return Values

Name
Type
Description

*ProposalData

*ProposalData

type-specific proposal data stored on the proposal

source

Description

Description returns the proposal description stored in its metadata.

Return Values

Name
Type
Description

string

string

proposal description

source

ID

ID returns the unique identifier assigned to the proposal.

Return Values

Name
Type
Description

int64

int64

proposal identifier used as its storage key

source

IsCommunityPoolSpendType

IsCommunityPoolSpendType reports whether the proposal spends community-pool funds.

Return Values

Name
Type
Description

bool

bool

true when the proposal type is CommunityPoolSpend

source

IsParameterChangeType

IsParameterChangeType reports whether the proposal changes governance parameters.

Return Values

Name
Type
Description

bool

bool

true when the proposal type is ParameterChange

source

IsProposer

IsProposer reports whether addr matches the proposal's proposer address.

Parameters

Name
Type
Description

addr

address

address to compare with the proposal proposer

Return Values

Name
Type
Description

bool

bool

true when addr is the proposal proposer

source

IsTextType

IsTextType reports whether the proposal is a text proposal.

Return Values

Name
Type
Description

bool

bool

true when the proposal type is Text

source

Metadata

Metadata returns the proposal's title and description metadata.

Return Values

Name
Type
Description

*ProposalMetadata

*ProposalMetadata

metadata stored on the proposal

source

Proposer

Proposer returns the address that created the proposal.

Return Values

Name
Type
Description

address

address

proposal creator's address

source

SnapshotTime

SnapshotTime returns the timestamp used to look up historical voting weight.

Return Values

Name
Type
Description

int64

int64

voting-weight snapshot timestamp

source

Status

Status returns the proposal's schedule, vote, and action status.

Return Values

Name
Type
Description

*ProposalStatus

*ProposalStatus

mutable aggregate status associated with the proposal

source

Title

Title returns the proposal title stored in its metadata.

Return Values

Name
Type
Description

string

string

proposal title

source

Type

Type returns the proposal's type discriminator from its type-specific data.

Return Values

Name
Type
Description

ProposalType

ProposalType

proposal kind, such as text, community-pool spend, or parameter change

source

VotingMaxWeight

VotingMaxWeight returns the maximum voting weight recorded for this proposal.

Return Values

Name
Type
Description

int64

int64

maximum voting weight used for the proposal's quorum calculation

source

VotingNoWeight

VotingNoWeight returns the total weight recorded for "no" votes.

Return Values

Name
Type
Description

int64

int64

current "no" vote weight

source

VotingQuorumAmount

VotingQuorumAmount returns the minimum total vote weight required to pass.

Return Values

Name
Type
Description

int64

int64

quorum vote weight required by this proposal's configuration

source

VotingYesWeight

VotingYesWeight returns the total weight recorded for "yes" votes.

Return Values

Name
Type
Description

int64

int64

current "yes" vote weight

source

Constructors

  • func NewProposal(proposalID int64, status *ProposalStatus, metadata *ProposalMetadata, data *ProposalData, proposerAddress address, configVersion int64, snapshotTime int64, createdHeight int64) *Proposal (source)

Last updated