Documentation ¶
Index ¶
- type DistributionInfo
- type Output
- type Proposal
- type ProposalManager
- func (pm *ProposalManager) AddProposal(p *Proposal) bool
- func (pm *ProposalManager) DeleteProposal(proposalID string) bool
- func (pm *ProposalManager) ExecuteProposal(proposalID string)
- func (pm *ProposalManager) GetProposal(proposalID string) *DistributionInfo
- func (pm *ProposalManager) ListProposal() []*DistributionInfo
- func (pm *ProposalManager) LoadFromDB()
- func (pm *ProposalManager) SetDealing(proposalID string)
- func (pm *ProposalManager) SetFailed(proposalID string)
- func (pm *ProposalManager) SetSuccess(proposalID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributionInfo ¶
type Proposal ¶
type Proposal struct { Data []Output `json:"data"` Chain string `json:"chain"` ID string `json:"id"` }
Proposal 提案内容
type ProposalManager ¶
type ProposalManager struct {
// contains filtered or unexported fields
}
ProposalManager 提案管理,负责增删查
func NewProposalManager ¶
func NewProposalManager(db *dgwdb.LDBDatabase, ts *primitives.TxStore) *ProposalManager
NewProposalManager 新建一个ProposalManager实例并返回
func (*ProposalManager) AddProposal ¶
func (pm *ProposalManager) AddProposal(p *Proposal) bool
AddProposal 新增一个提案
func (*ProposalManager) DeleteProposal ¶
func (pm *ProposalManager) DeleteProposal(proposalID string) bool
DeleteProposal 删除一个提案, 返回是否删除完成
func (*ProposalManager) ExecuteProposal ¶
func (pm *ProposalManager) ExecuteProposal(proposalID string)
ExecuteProposal 执行指定的提案
func (*ProposalManager) GetProposal ¶
func (pm *ProposalManager) GetProposal(proposalID string) *DistributionInfo
GetProposal 查找指定提案
func (*ProposalManager) ListProposal ¶
func (pm *ProposalManager) ListProposal() []*DistributionInfo
ListProposal 返回所有的提案
func (*ProposalManager) LoadFromDB ¶
func (pm *ProposalManager) LoadFromDB()
LoadFromDB 把保存在磁盘里面的未完成的proposal读取到内存
func (*ProposalManager) SetDealing ¶
func (pm *ProposalManager) SetDealing(proposalID string)
SetDealing 设置提案状态为执行中
func (*ProposalManager) SetFailed ¶
func (pm *ProposalManager) SetFailed(proposalID string)
SetFailed 设置提案状态为执行失败
func (*ProposalManager) SetSuccess ¶
func (pm *ProposalManager) SetSuccess(proposalID string)
SetSuccess 设置提案状态为执行成功
Click to show internal directories.
Click to hide internal directories.