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.
Value
governor.Proposal
proposals
*v0.Tree// id (zero-padded string) -> \*Proposal
- OID
- 053687…bb70:4
proposals details
nextID
int64Value
1
totalCount
int64Value
0
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
- 053687…bb70:8
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
- 053687…bb70:10
CastVote details
Execute
func(id int64)Execute marks a Succeeded proposal as executed. It panics unless the proposal has reached the Succeeded state.
- OID
- 053687…bb70:11
Execute details
State
func(id int64) stringState returns the current lifecycle state of proposal id.
- OID
- 053687…bb70:12
State details
computeState
func(p *governor.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
- 053687…bb70:13
computeState details
mustGet
func(id int64) *governor.Proposal- OID
- 053687…bb70:14
mustGet details
idKey
func(id int64) stringidKey returns a zero-padded, lexicographically-sortable key for an id so the avl tree iterates proposals in numeric order.
- OID
- 053687…bb70:15
idKey details
bar
func(value int64, total int64, width int) stringbar renders a proportional ▓░ progress bar of fixed width.
- OID
- 053687…bb70:16
bar details
Render
func(path string) stringRender lists all proposals with their tallies and states as Markdown.
- OID
- 053687…bb70:17