proposal.gno
NewProposalTree
func NewProposalTree() *bptree.BPTreeNewProposalTree creates an empty B+ tree for proposals keyed by proposal ID.
Return Values
*bptree.BPTree
*bptree.BPTree
empty 16-way proposal tree
NewProposalUserVotingInfoTree
NewProposalUserVotingInfoTree creates an empty B+ tree mapping proposal IDs to their per-user voting-information trees.
Return Values
*bptree.BPTree
*bptree.BPTree
empty 16-way proposal voting-information index tree
NewUserProposalTree
NewUserProposalTree creates an empty B+ tree mapping users to proposal IDs.
Return Values
*bptree.BPTree
*bptree.BPTree
empty 16-way user-proposal index tree
NewVotingInfoTree
NewVotingInfoTree creates an empty B+ tree for per-user voting information.
Return Values
*bptree.BPTree
*bptree.BPTree
empty 16-way voting-information tree
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.
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
*Proposal
*Proposal
independent proposal copy, or nil when the receiver is nil
ConfigVersion
ConfigVersion returns the governance configuration version used by the proposal.
Return Values
int64
int64
configuration version captured when the proposal was created
CreatedAt
CreatedAt returns the proposal creation timestamp recorded in its schedule.
Return Values
int64
int64
proposal creation timestamp
CreatedHeight
CreatedHeight returns the block height at which the proposal was created.
Return Values
int64
int64
proposal creation block height
Data
Data returns the proposal's type-specific data.
Return Values
*ProposalData
*ProposalData
type-specific proposal data stored on the proposal
Description
Description returns the proposal description stored in its metadata.
Return Values
string
string
proposal description
ID
ID returns the unique identifier assigned to the proposal.
Return Values
int64
int64
proposal identifier used as its storage key
IsCommunityPoolSpendType
IsCommunityPoolSpendType reports whether the proposal spends community-pool funds.
Return Values
bool
bool
true when the proposal type is CommunityPoolSpend
IsParameterChangeType
IsParameterChangeType reports whether the proposal changes governance parameters.
Return Values
bool
bool
true when the proposal type is ParameterChange
IsProposer
IsProposer reports whether addr matches the proposal's proposer address.
Parameters
addr
address
address to compare with the proposal proposer
Return Values
bool
bool
true when addr is the proposal proposer
IsTextType
IsTextType reports whether the proposal is a text proposal.
Return Values
bool
bool
true when the proposal type is Text
Metadata
Metadata returns the proposal's title and description metadata.
Return Values
*ProposalMetadata
*ProposalMetadata
metadata stored on the proposal
Proposer
Proposer returns the address that created the proposal.
Return Values
address
address
proposal creator's address
SnapshotTime
SnapshotTime returns the timestamp used to look up historical voting weight.
Return Values
int64
int64
voting-weight snapshot timestamp
Status
Status returns the proposal's schedule, vote, and action status.
Return Values
*ProposalStatus
*ProposalStatus
mutable aggregate status associated with the proposal
Title
Title returns the proposal title stored in its metadata.
Return Values
string
string
proposal title
Type
Type returns the proposal's type discriminator from its type-specific data.
Return Values
ProposalType
ProposalType
proposal kind, such as text, community-pool spend, or parameter change
VotingMaxWeight
VotingMaxWeight returns the maximum voting weight recorded for this proposal.
Return Values
int64
int64
maximum voting weight used for the proposal's quorum calculation
VotingNoWeight
VotingNoWeight returns the total weight recorded for "no" votes.
Return Values
int64
int64
current "no" vote weight
VotingQuorumAmount
VotingQuorumAmount returns the minimum total vote weight required to pass.
Return Values
int64
int64
quorum vote weight required by this proposal's configuration
VotingYesWeight
VotingYesWeight returns the total weight recorded for "yes" votes.
Return Values
int64
int64
current "yes" vote weight
Constructors
func NewProposal(proposalID int64, status *ProposalStatus, metadata *ProposalMetadata, data *ProposalData, proposerAddress address, configVersion int64, snapshotTime int64, createdHeight int64) *Proposal(source)
Last updated