transaction

package
v1.999.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const RefundGasMessage = "refundedGas"

RefundGasMessage is the message returned in the data field of a receipt, for move balance transactions that provide more gas than needed

Variables

This section is empty.

Functions

func NewMetaTxProcessor

func NewMetaTxProcessor(args ArgsNewMetaTxProcessor) (*metaTxProcessor, error)

NewMetaTxProcessor creates a new txProcessor engine

func NewTransactionCostEstimator

func NewTransactionCostEstimator(
	txTypeHandler process.TxTypeHandler,
	feeHandler process.FeeHandler,
	txSimulator facade.TransactionSimulatorProcessor,
	accounts state.AccountsAdapter,
	shardCoordinator sharding.Coordinator,
	epochNotifier process.EpochNotifier,
	tooMuchGasMessageV2EnableEpoch uint32,
) (*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 ArgsNewMetaTxProcessor

type ArgsNewMetaTxProcessor struct {
	Hasher                                hashing.Hasher
	Marshalizer                           marshal.Marshalizer
	Accounts                              state.AccountsAdapter
	PubkeyConv                            core.PubkeyConverter
	ShardCoordinator                      sharding.Coordinator
	ScProcessor                           process.SmartContractProcessor
	TxTypeHandler                         process.TxTypeHandler
	EconomicsFee                          process.FeeHandler
	ESDTEnableEpoch                       uint32
	BuiltInFunctionOnMetachainEnableEpoch uint32
	EpochNotifier                         process.EpochNotifier
}

ArgsNewMetaTxProcessor defines the arguments needed for new meta tx processor

type ArgsNewTxProcessor

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
	RelayedTxEnableEpoch                  uint32
	RelayedTxV2EnableEpoch                uint32
	PenalizedTooMuchGasEnableEpoch        uint32
	MetaProtectionEnableEpoch             uint32
	AddFailedRelayedToInvalidDisableEpoch uint32
	EpochNotifier                         process.EpochNotifier
}

ArgsNewTxProcessor 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,
	enableSignedTxWithHash bool,
	txSignHasher hashing.Hasher,
	txVersionChecker process.TxVersionCheckerHandler,
) (*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