transaction

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: GPL-3.0 Imports: 14 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) Nonce

func (inTx *InterceptedTransaction) Nonce() uint64

Nonce returns the transaction nonce

func (*InterceptedTransaction) RcvShard added in v1.0.3

func (inTx *InterceptedTransaction) RcvShard() uint32

RcvShard returns the receiver shard

func (*InterceptedTransaction) SenderAddress

func (inTx *InterceptedTransaction) SenderAddress() state.AddressContainer

SenderAddress returns the transaction sender address

func (*InterceptedTransaction) SenderShardId

func (inTx *InterceptedTransaction) SenderShardId() uint32

SenderShardId returns the transaction sender shard id

func (*InterceptedTransaction) SndShard added in v1.0.3

func (inTx *InterceptedTransaction) SndShard() uint32

SndShard returns the sender shard

func (*InterceptedTransaction) TotalValue added in v1.0.16

func (inTx *InterceptedTransaction) TotalValue() *big.Int

TotalValue returns the maximum cost of transaction totalValue = txValue + gasPrice*gasLimit

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,
	txValidator process.TxValidator,
	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) IsInterfaceNil added in v1.0.16

func (txi *TxInterceptor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

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