context

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateCtx

type StateCtx struct {
	// 基础上下文
	xctx.BaseCtx
	// 运行环境配置
	EnvCfg *xconf.EnvConf
	// 账本配置
	LedgerCfg *lconf.XLedgerConf
	// 链名
	BCName string
	// ledger handle
	Ledger *ledger.Ledger
	// crypto client
	Crypt cryptoBase.CryptoClient
	// acl manager
	// 注意:注入后才可以使用
	AclMgr aclBase.AclManager
	// contract Manager
	// 注意:依赖注入后才可以使用
	ContractMgr contract.Manager
	// 注意:注入后才可以使用
	GovernTokenMgr governToken.GovManager
	// 注意:注入后才可以使用
	ProposalMgr propose.ProposeManager
	// 注意:注入后才可以使用
	TimerTaskMgr timerTask.TimerManager
}

状态机运行上下文环境

func NewStateCtx

func NewStateCtx(envCfg *xconf.EnvConf, bcName string,
	leg *ledger.Ledger, crypt cryptoBase.CryptoClient) (*StateCtx, error)

func (*StateCtx) IsInit

func (t *StateCtx) IsInit() bool

state各个func里尽量调一下判断

func (*StateCtx) SetAclMG

func (t *StateCtx) SetAclMG(aclMgr aclBase.AclManager)

func (*StateCtx) SetContractMG

func (t *StateCtx) SetContractMG(contractMgr contract.Manager)

func (*StateCtx) SetGovernTokenMG

func (t *StateCtx) SetGovernTokenMG(governTokenMgr governToken.GovManager)

func (*StateCtx) SetProposalMG

func (t *StateCtx) SetProposalMG(proposalMgr propose.ProposeManager)

func (*StateCtx) SetTimerTaskMG

func (t *StateCtx) SetTimerTaskMG(timerTaskMgr timerTask.TimerManager)

Jump to

Keyboard shortcuts

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