propose

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KernMethod

type KernMethod struct {
	BcName  string
	Percent int64 // 全网提案最小赞成比例,计算票数大于等于此值时提案通过;可通过提案修改
}

func NewKernContractMethod

func NewKernContractMethod(bcName string) *KernMethod

func (*KernMethod) CheckVoteResult

func (t *KernMethod) CheckVoteResult(ctx contract.KContext) (*contract.Response, error)

func (*KernMethod) Propose

func (t *KernMethod) Propose(ctx contract.KContext) (*contract.Response, error)

func (*KernMethod) Query

func (t *KernMethod) Query(ctx contract.KContext) (*contract.Response, error)

func (*KernMethod) SetPercent

func (t *KernMethod) SetPercent(ctx contract.KContext) (*contract.Response, error)

修改全网赞成比例

func (*KernMethod) Thaw

func (*KernMethod) Trigger

func (t *KernMethod) Trigger(ctx contract.KContext) (*contract.Response, error)

func (*KernMethod) Vote

type LedgerRely

type LedgerRely interface {
	// 获取状态机最新确认快照
	GetTipXMSnapshotReader() (ledger.XMSnapshotReader, error)
}

type Manager

type Manager struct {
	Ctx *ProposeCtx
}

Manager manages all timer releated data, providing read/write interface

func (*Manager) GetObjectBySnapshot

func (mgr *Manager) GetObjectBySnapshot(bucket string, object []byte) ([]byte, error)

func (*Manager) GetProposalByID

func (mgr *Manager) GetProposalByID(proposalID string) (*pb.Proposal, error)

GetProposalByID get proposal by proposal_id

type ProposalID

type ProposalID struct {
	ProposalID string `json:"proposal_id"`
}

type ProposeCtx

type ProposeCtx struct {
	// 基础上下文
	xcontext.BaseCtx
	BcName   string
	Ledger   LedgerRely
	Contract contract.Manager
}

func NewProposeCtx

func NewProposeCtx(bcName string, leg LedgerRely, contract contract.Manager) (*ProposeCtx, error)

type ProposeManager

type ProposeManager interface {
	GetProposalByID(proposalID string) (*pb.Proposal, error)
}

func NewProposeManager

func NewProposeManager(ctx *ProposeCtx) (ProposeManager, error)

NewTimerManager create instance of ProposeManager

Jump to

Keyboard shortcuts

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