distribution

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionInfo

type DistributionInfo struct {
	Proposal   *Proposal `json:"proposal"`
	CreateTime time.Time `json:"create_time"`
	Status     int       `json:"status"`
}

type Output

type Output struct {
	Address string `json:"address"`
	Amount  int64  `json:"amount"`
}

Output 一笔提案里面的一个输出

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 设置提案状态为执行成功

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL