transaction

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 21 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 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
	EnableEpochsHandler common.EnableEpochsHandler
	TxVersionChecker    process.TxVersionCheckerHandler
	GuardianChecker     process.GuardianChecker
}

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
	EnableRoundsHandler process.EnableRoundsHandler
	EnableEpochsHandler common.EnableEpochsHandler
	TxVersionChecker    process.TxVersionCheckerHandler
	GuardianChecker     process.GuardianChecker
	TxLogsProcessor     process.TransactionLogProcessor
}

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) GetTxMessageForSignatureVerification added in v1.5.0

func (inTx *InterceptedTransaction) GetTxMessageForSignatureVerification() ([]byte, error)

GetTxMessageForSignatureVerification returns the transaction data that the signature needs to be verified on

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

func (*InterceptedTransaction) VerifyGuardianSig added in v1.5.0

func (inTx *InterceptedTransaction) VerifyGuardianSig(tx *transaction.Transaction) error

VerifyGuardianSig verifies if the guardian signature is valid

Jump to

Keyboard shortcuts

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