customtx

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(customTxProcessors Processors)

初始化设置自定义处理器。此函数只能在ledgermgmt.initialize()函数期间调用。

func InitializeTestEnv

func InitializeTestEnv(processors Processors)

initializetestenv初始化用于测试的自定义Tx处理器

Types

type InvalidTxError

type InvalidTxError struct {
	Msg string
}

自定义事务处理器(接口“processor”的实现)应引发InvalidTxError。 如果它希望分类帐将特定交易记录为无效

func (*InvalidTxError) Error

func (e *InvalidTxError) Error() string

type Processor

type Processor interface {
	GenerateSimulationResults(txEnvelop *common.Envelope, simulator ledger.TxSimulator, initializingLedger bool) error
}

处理器允许在提交期间为自定义事务生成模拟结果。 自定义处理器可以以适当的方式表示信息,并可以使用此过程来翻译 信息以“txSimulationResults”的形式显示。因为原始信息是在 自定义表示,“processor”的一个实现应注意自定义表示 用于确定性方式的模拟,应注意跨结构版本的兼容性。 “initializingledger”true表示正在处理的事务来自Genesis块或分类帐是 同步状态(如果发现statedb落后于区块链,则可能在对等启动期间发生)。 在前一种情况下,处理的交易预期是有效的,在后一种情况下,只有有效的交易 重新处理,因此可以跳过任何验证。

func GetProcessor

func GetProcessor(txType common.HeaderType) Processor

GetProcessor返回与txtype关联的处理器

type Processors

type Processors map[common.HeaderType]Processor

处理器维护自定义事务类型与其对应的Tx处理器之间的关联

Jump to

Keyboard shortcuts

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