interceptors

package
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderInterceptor

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

HeaderInterceptor represents an interceptor used for block headers

func NewHeaderInterceptor

func NewHeaderInterceptor(
	marshalizer marshal.Marshalizer,
	headers storage.Cacher,
	headersNonces dataRetriever.Uint64SyncMapCacher,
	headerValidator process.HeaderValidator,
	multiSigVerifier crypto.MultiSigVerifier,
	hasher hashing.Hasher,
	shardCoordinator sharding.Coordinator,
	nodesCoordinator sharding.NodesCoordinator,
) (*HeaderInterceptor, error)

NewHeaderInterceptor hooks a new interceptor for block headers Fetched block headers will be placed in a data pool

func (*HeaderInterceptor) IsInterfaceNil added in v1.0.16

func (hi *HeaderInterceptor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HeaderInterceptor) ParseReceivedMessage added in v1.0.12

func (hi *HeaderInterceptor) ParseReceivedMessage(message p2p.MessageP2P) (*block.InterceptedHeader, error)

ParseReceivedMessage will transform the received p2p.Message in an InterceptedHeader. If the header hash is present in storage it will output an error

func (*HeaderInterceptor) ProcessReceivedMessage

func (hi *HeaderInterceptor) ProcessReceivedMessage(message p2p.MessageP2P) error

ProcessReceivedMessage will be the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)

type MetachainHeaderInterceptor

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

MetachainHeaderInterceptor represents an interceptor used for metachain block headers

func NewMetachainHeaderInterceptor

func NewMetachainHeaderInterceptor(
	marshalizer marshal.Marshalizer,
	metachainHeaders storage.Cacher,
	metachainHeadersNonces dataRetriever.Uint64SyncMapCacher,
	headerValidator process.HeaderValidator,
	multiSigVerifier crypto.MultiSigVerifier,
	hasher hashing.Hasher,
	shardCoordinator sharding.Coordinator,
	nodesCoordinator sharding.NodesCoordinator,
) (*MetachainHeaderInterceptor, error)

NewMetachainHeaderInterceptor hooks a new interceptor for metachain block headers Fetched metachain block headers will be placed in a data pool

func (*MetachainHeaderInterceptor) IsInterfaceNil added in v1.0.16

func (mhi *MetachainHeaderInterceptor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MetachainHeaderInterceptor) ProcessReceivedMessage

func (mhi *MetachainHeaderInterceptor) ProcessReceivedMessage(message p2p.MessageP2P) error

ProcessReceivedMessage will be the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)

type PeerBlockBodyInterceptor

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

PeerBlockBodyInterceptor represents an interceptor used for peer changes block bodies

func NewPeerBlockBodyInterceptor

func NewPeerBlockBodyInterceptor(
	marshalizer marshal.Marshalizer,
	cache storage.Cacher,
	storer storage.Storer,
	hasher hashing.Hasher,
	shardCoordinator sharding.Coordinator,
) (*PeerBlockBodyInterceptor, error)

NewPeerBlockBodyInterceptor creates a new instance of a TxBlockBodyInterceptor

func (*PeerBlockBodyInterceptor) IsInterfaceNil added in v1.0.16

func (pbbi *PeerBlockBodyInterceptor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PeerBlockBodyInterceptor) ProcessReceivedMessage

func (pbbi *PeerBlockBodyInterceptor) ProcessReceivedMessage(message p2p.MessageP2P) error

ProcessReceivedMessage will be the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)

type TxBlockBodyInterceptor

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

TxBlockBodyInterceptor represents an interceptor used for transaction block bodies

func NewTxBlockBodyInterceptor

func NewTxBlockBodyInterceptor(
	marshalizer marshal.Marshalizer,
	cache storage.Cacher,
	storer storage.Storer,
	hasher hashing.Hasher,
	shardCoordinator sharding.Coordinator,
) (*TxBlockBodyInterceptor, error)

NewTxBlockBodyInterceptor creates a new instance of a TxBlockBodyInterceptor

func (*TxBlockBodyInterceptor) IsInterfaceNil added in v1.0.16

func (tbbi *TxBlockBodyInterceptor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TxBlockBodyInterceptor) ProcessReceivedMessage

func (tbbi *TxBlockBodyInterceptor) ProcessReceivedMessage(message p2p.MessageP2P) error

ProcessReceivedMessage will be the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)

Jump to

Keyboard shortcuts

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