transaction

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTxProcessor

func NewTxProcessor(
	accounts state.AccountsAdapter,
	hasher hashing.Hasher,
	addressConv state.AddressConverter,
	marshalizer marshal.Marshalizer,
	shardCoordinator sharding.Coordinator,
	scProcessor process.SmartContractProcessor,
) (*txProcessor, error)

NewTxProcessor creates a new txProcessor engine

Types

type InterceptedTransaction

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

InterceptedTransaction holds and manages a transaction based struct with extended functionality

func NewInterceptedTransaction

func NewInterceptedTransaction(
	txBuff []byte,
	marshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	keyGen crypto.KeyGenerator,
	signer crypto.SingleSigner,
	addrConv state.AddressConverter,
	coordinator sharding.Coordinator,
) (*InterceptedTransaction, error)

NewInterceptedTransaction returns a new instance of InterceptedTransaction

func (*InterceptedTransaction) Hash

func (inTx *InterceptedTransaction) Hash() []byte

Hash gets the hash of this transaction

func (*InterceptedTransaction) IsAddressedToOtherShards added in v1.0.3

func (inTx *InterceptedTransaction) IsAddressedToOtherShards() bool

IsAddressedToOtherShards returns true if this transaction is not meant to be processed by the node from this shard

func (*InterceptedTransaction) RcvShard added in v1.0.3

func (inTx *InterceptedTransaction) RcvShard() uint32

RcvShard returns the receiver shard

func (*InterceptedTransaction) SndShard added in v1.0.3

func (inTx *InterceptedTransaction) SndShard() uint32

SndShard returns the sender shard

func (*InterceptedTransaction) Transaction

func (inTx *InterceptedTransaction) Transaction() *transaction.Transaction

Transaction returns the transaction pointer that actually holds the data

type TxInterceptor added in v1.0.3

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

TxInterceptor is used for intercepting transaction and storing them into a datapool

func NewTxInterceptor added in v1.0.3

func NewTxInterceptor(
	marshalizer marshal.Marshalizer,
	txPool dataRetriever.ShardedDataCacherNotifier,
	txStorer storage.Storer,
	addrConverter state.AddressConverter,
	hasher hashing.Hasher,
	singleSigner crypto.SingleSigner,
	keyGen crypto.KeyGenerator,
	shardCoordinator sharding.Coordinator,
) (*TxInterceptor, error)

NewTxInterceptor hooks a new interceptor for transactions

func (*TxInterceptor) ProcessReceivedMessage added in v1.0.3

func (txi *TxInterceptor) 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)

func (*TxInterceptor) SetBroadcastCallback added in v1.0.3

func (txi *TxInterceptor) SetBroadcastCallback(callback func(buffToSend []byte))

SetBroadcastCallback sets the callback method to send filtered out message

Jump to

Keyboard shortcuts

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