Documentation ¶
Overview ¶
Package agendas manages the various deployment agendas that are directly voted upon with the vote bits in vote transactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
Types ¶
type AgendaDB ¶
type AgendaDB struct { NumAgendas int // contains filtered or unexported fields }
AgendaDB represents the data for the stored DB.
func NewAgendasDB ¶
func NewAgendasDB(client DeploymentSource, dbPath string) (*AgendaDB, error)
NewAgendasDB opens an existing database or create a new one using with the specified file name. An initialized agendas db connection is returned.
func (*AgendaDB) AgendaInfo ¶
func (db *AgendaDB) AgendaInfo(agendaID string) (*AgendaTagged, error)
AgendaInfo fetches an agenda's details given it's agendaID.
func (*AgendaDB) AllAgendas ¶
func (db *AgendaDB) AllAgendas() (agendas []*AgendaTagged, err error)
AllAgendas returns all agendas and their info in the db.
func (*AgendaDB) CheckAgendasUpdates ¶
func (db *AgendaDB) CheckAgendasUpdates(activeVersions map[uint32][]chaincfg.ConsensusDeployment) error
CheckAgendasUpdates checks for update at the start of the process and will proceed to update when necessary.
type AgendaTagged ¶
type AgendaTagged struct { ID string `json:"id" storm:"id"` Description string `json:"description"` Mask uint16 `json:"mask"` StartTime uint64 `json:"starttime" storm:"index"` ExpireTime uint64 `json:"expiretime" storm:"index"` Status dbtypes.AgendaStatusType `json:"status" storm:"index"` QuorumProgress float64 `json:"quorumprogress" storm:"index"` Choices []dcrjson.Choice `json:"choices"` VoteVersion uint32 `json:"voteversion"` }
AgendaTagged has the same fields as dcrjson.Agenda plus the VoteVersion field, but with the ID field marked as the primary key via the `storm:"id"` tag. Fields tagged for indexing by the DB are: StartTime, ExpireTime, Status, and QuorumProgress.
type DeploymentSource ¶
DeploymentSource provides a cleaner way to track the rpcclient methods used in this package. It also allows usage of alternative implementations to satisfy the interface.