base

package
v0.0.0-...-b124b1e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 13 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 *ledgerBase.XLedgerConf
	// 链名
	BCName string
	// ledger handle
	Ledger *ledger.Ledger
	// crypto client
	Crypt cryptoBase.CryptoClient
	// acl manager
	// 注意:注入后才可以使用
	AclMgr aclBase.AclManager
	// contract Manager
	// 注意:依赖注入后才可以使用
	ContractMgr base.Manager
	// 注意:注入后才可以使用
	GovernTokenMgr govern.GovManager
	// 注意:注入后才可以使用
	ProposalMgr propose.ProposeManager
	// 注意:注入后才可以使用
	TimerTaskMgr ptimer.TimerManager
}

StateCtx 状态机运行上下文环境

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

IsInit 判断state是否初始化

func (*StateCtx) SetAclMG

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

func (*StateCtx) SetContractMG

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

func (*StateCtx) SetGovernTokenMG

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

func (*StateCtx) SetProposalMG

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

func (*StateCtx) SetTimerTaskMG

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

Jump to

Keyboard shortcuts

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