processor

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgHdrInterceptorProcessor

type ArgHdrInterceptorProcessor struct {
	Headers       storage.Cacher
	HeadersNonces dataRetriever.Uint64SyncMapCacher
	HdrValidator  process.HeaderValidator
	BlackList     process.BlackListHandler
}

ArgHdrInterceptorProcessor is the argument for the interceptor processor used for headers (shard, meta and so on)

type ArgTxBodyInterceptorProcessor

type ArgTxBodyInterceptorProcessor struct {
	MiniblockCache   storage.Cacher
	Marshalizer      marshal.Marshalizer
	Hasher           hashing.Hasher
	ShardCoordinator sharding.Coordinator
}

ArgTxBodyInterceptorProcessor is the argument for the interceptor processor used for tx block body

type ArgTxInterceptorProcessor

type ArgTxInterceptorProcessor struct {
	ShardedDataCache dataRetriever.ShardedDataCacherNotifier
	TxValidator      process.TxValidator
}

ArgTxInterceptorProcessor is the argument for the interceptor processor used for transactions (balance txs, smart contract results, reward and so on)

type HdrInterceptorProcessor

type HdrInterceptorProcessor struct {
	// contains filtered or unexported fields
}

HdrInterceptorProcessor is the processor used when intercepting headers (shard headers, meta headers) structs which satisfy HeaderHandler interface.

func NewHdrInterceptorProcessor

func NewHdrInterceptorProcessor(argument *ArgHdrInterceptorProcessor) (*HdrInterceptorProcessor, error)

NewHdrInterceptorProcessor creates a new TxInterceptorProcessor instance

func (*HdrInterceptorProcessor) IsInterfaceNil

func (hip *HdrInterceptorProcessor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HdrInterceptorProcessor) Save

Save will save the received data into the headers cacher as hash<->[plain header structure] and in headersNonces as nonce<->hash

func (*HdrInterceptorProcessor) Validate

Validate checks if the intercepted data can be processed

type InterceptedTransactionHandler

type InterceptedTransactionHandler interface {
	SenderShardId() uint32
	ReceiverShardId() uint32
	Nonce() uint64
	SenderAddress() state.AddressContainer
	TotalValue() *big.Int
	Transaction() data.TransactionHandler
}

InterceptedTransactionHandler defines an intercepted data wrapper over transaction handler that has receiver and sender shard getters

type TxBodyInterceptorProcessor

type TxBodyInterceptorProcessor struct {
	// contains filtered or unexported fields
}

TxBodyInterceptorProcessor is the processor used when intercepting miniblocks grouped in a block.TxBlockBody structure

func NewTxBodyInterceptorProcessor

func NewTxBodyInterceptorProcessor(argument *ArgTxBodyInterceptorProcessor) (*TxBodyInterceptorProcessor, error)

NewTxBodyInterceptorProcessor creates a new TxBodyInterceptorProcessor instance

func (*TxBodyInterceptorProcessor) IsInterfaceNil

func (tbip *TxBodyInterceptorProcessor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TxBodyInterceptorProcessor) Save

Save will save the received miniblocks inside the miniblock cacher after a new validation round that will be done on each miniblock

func (*TxBodyInterceptorProcessor) Validate

Validate checks if the intercepted data can be processed It returns nil as a body might consist of multiple miniblocks Since some might be valid and others not, we rather do the checking when we iterate the slice for processing as it is optimal to do so

type TxInterceptorProcessor

type TxInterceptorProcessor struct {
	// contains filtered or unexported fields
}

TxInterceptorProcessor is the processor used when intercepting transactions (smart contract results, receipts, transaction) structs which satisfy TransactionHandler interface.

func NewTxInterceptorProcessor

func NewTxInterceptorProcessor(argument *ArgTxInterceptorProcessor) (*TxInterceptorProcessor, error)

NewTxInterceptorProcessor creates a new TxInterceptorProcessor instance

func (*TxInterceptorProcessor) IsInterfaceNil

func (txip *TxInterceptorProcessor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TxInterceptorProcessor) Save

Save will save the received data into the cacher

func (*TxInterceptorProcessor) Validate

func (txip *TxInterceptorProcessor) Validate(data process.InterceptedData) error

Validate checks if the intercepted data can be processed

Jump to

Keyboard shortcuts

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