transaction

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetaTxProcessor

func NewMetaTxProcessor(
	hasher hashing.Hasher,
	marshalizer marshal.Marshalizer,
	accounts state.AccountsAdapter,
	pubkeyConv core.PubkeyConverter,
	shardCoordinator sharding.Coordinator,
	scProcessor process.SmartContractProcessor,
	txTypeHandler process.TxTypeHandler,
	economicsFee process.FeeHandler,
) (*metaTxProcessor, error)

NewMetaTxProcessor creates a new txProcessor engine

func NewTransactionCostEstimator

func NewTransactionCostEstimator(
	txTypeHandler process.TxTypeHandler,
	feeHandler process.FeeHandler,
	query external.SCQueryService,
	gasSchedule map[string]map[string]uint64,
) (*transactionCostEstimator, error)

NewTransactionCostEstimator will create a new transaction cost estimator

func NewTxProcessor

func NewTxProcessor(args ArgsNewTxProcessor) (*txProcessor, error)

NewTxProcessor creates a new txProcessor engine

Types

type ArgsNewTxProcessor added in v0.0.2

type ArgsNewTxProcessor struct {
	Accounts          state.AccountsAdapter
	Hasher            hashing.Hasher
	PubkeyConv        core.PubkeyConverter
	Marshalizer       marshal.Marshalizer
	SignMarshalizer   marshal.Marshalizer
	ShardCoordinator  sharding.Coordinator
	ScProcessor       process.SmartContractProcessor
	TxFeeHandler      process.TransactionFeeHandler
	TxTypeHandler     process.TxTypeHandler
	EconomicsFee      process.FeeHandler
	ReceiptForwarder  process.IntermediateTransactionHandler
	BadTxForwarder    process.IntermediateTransactionHandler
	ArgsParser        process.ArgumentsParser
	ScrForwarder      process.IntermediateTransactionHandler
	DisabledRelayedTx bool
}

ArgsNewTxProcessor defines defines the arguments needed for new tx processor

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,
	protoMarshalizer marshal.Marshalizer,
	signMarshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	keyGen crypto.KeyGenerator,
	signer crypto.SingleSigner,
	pubkeyConv core.PubkeyConverter,
	coordinator sharding.Coordinator,
	feeHandler process.FeeHandler,
	whiteListerVerifiedTxs process.WhiteListHandler,
	argsParser process.ArgumentsParser,
	chainID []byte,
	minTxVersion uint32,
) (*InterceptedTransaction, error)

NewInterceptedTransaction returns a new instance of InterceptedTransaction

func (*InterceptedTransaction) CheckValidity

func (inTx *InterceptedTransaction) CheckValidity() error

CheckValidity checks if the received transaction is valid (not nil fields, valid sig and so on)

func (*InterceptedTransaction) Fee

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

Fee returns the estimated cost of the transaction

func (*InterceptedTransaction) Hash

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

Hash gets the hash of this transaction

func (*InterceptedTransaction) Identifiers

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

Identifiers returns the identifiers used in requests

func (*InterceptedTransaction) IsForCurrentShard

func (inTx *InterceptedTransaction) IsForCurrentShard() bool

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

func (*InterceptedTransaction) IsInterfaceNil

func (inTx *InterceptedTransaction) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*InterceptedTransaction) Nonce

func (inTx *InterceptedTransaction) Nonce() uint64

Nonce returns the transaction nonce

func (*InterceptedTransaction) ReceiverShardId

func (inTx *InterceptedTransaction) ReceiverShardId() uint32

ReceiverShardId returns the receiver shard id

func (*InterceptedTransaction) SenderAddress

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

SenderAddress returns the transaction sender address

func (*InterceptedTransaction) SenderShardId

func (inTx *InterceptedTransaction) SenderShardId() uint32

SenderShardId returns the transaction sender shard id

func (*InterceptedTransaction) String

func (inTx *InterceptedTransaction) String() string

String returns the transaction's most important fields as string

func (*InterceptedTransaction) Transaction

func (inTx *InterceptedTransaction) Transaction() data.TransactionHandler

Transaction returns the transaction pointer that actually holds the data

func (*InterceptedTransaction) Type

func (inTx *InterceptedTransaction) Type() string

Type returns the type of this intercepted data

Jump to

Keyboard shortcuts

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