propose

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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