votingPeriod
int64votingPeriod is the number of blocks a proposal stays open for voting.
Value
100
VoteAgainst
untyped bigintVote support values.
Value
(0 <untyped> bigint)
VoteFor
untyped bigintVote support values.
Value
(1 <untyped> bigint)
VoteAbstain
untyped bigintVote support values.
Value
(2 <untyped> bigint)
StateActive
untyped stringProposal state values.
Value
"Active"
StateSucceeded
untyped stringProposal state values.
Value
"Succeeded"
StateDefeated
untyped stringProposal state values.
Value
"Defeated"
StateExecuted
untyped stringProposal state values.
Value
"Executed"
Proposal
typeProposal is a single governance proposal. It carries no ID field: the id belongs to the store, which hands it back on lookup and iteration.
Value
v1.Proposal
proposals
*v0.Storeproposals assigns the proposal ids. v0 kept its own nextID plus an idKey() that zero-padded to width 12, which stopped ordering Render past 10^12, and its own totalCount, which the store's LastID already answers.
- OID
- 0baf59…f4b0:4
proposals details
Propose
func(description string) int64Propose opens a new proposal and returns its id. The snapshot height and deadline are recorded from the current chain height.
- OID
- 0baf59…f4b0:7
Propose details
CastVote
func(id int64, support int)CastVote records one vote for the caller on proposal id. support is 0=against, 1=for, 2=abstain. One address may vote at most once per proposal, and voting is only allowed while the proposal is Active.
- OID
- 0baf59…f4b0:9
CastVote details
Execute
func(id int64)Execute marks a Succeeded proposal as executed. It panics unless the proposal has reached the Succeeded state.
- OID
- 0baf59…f4b0:10
Execute details
State
func(id int64) stringState returns the current lifecycle state of proposal id.
- OID
- 0baf59…f4b0:11
State details
computeState
func(p *v1.Proposal, h int64) stringcomputeState is the pure state machine: it decides the state of p at chain height h. Kept free of globals so it is unit-testable.
- OID
- 0baf59…f4b0:12
computeState details
mustGet
func(id int64) *v1.Proposal- OID
- 0baf59…f4b0:13
mustGet details
bar
func(value int64, total int64, width int) stringbar renders a proportional ▓░ progress bar of fixed width.
- OID
- 0baf59…f4b0:14
bar details
Render
func(path string) stringRender lists all proposals with their tallies and states as Markdown.
- OID
- 0baf59…f4b0:15