types

package
Version: v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: GPL-3.0 Imports: 26 Imported by: 197

Documentation

Overview

Package types contains data types related to Klatyn consensus.

Klaytn nodes achieve a consensus of the global state by processing the same transactions in the same order.

Transaction is an atomic operation originated from an Externally Owned Account (EOA) transiting the global state of Klaytn. Klaytn supports multiple transaction types to efficiently trigger KLAY transfer or contract execution. LegacyTransaction, the Ethereum compatible transaction, could be sent to both of EOA and Smart Contract (SC). However, it cannot support advanced features of Klaytn such as multi-sig or fee-delegation. All transaction types except LegacyTransaction are enforced to be sent to either of EOA or SC. With a slice of transaction signatures signed by multiple accounts, they can support a multi-sig account to transact. Some transaction types support full or partial fee-delegation feature as well as basic transaction features. Fee-delegation transactions have additional field(s) to charge some amount of transaction fee to a fee payer's account.

Block consists of transactions and a header which includes additional information for consensus and transaction support. A block guarantees the sequential execution of transactions inside, and a block header enables Klaytn nodes to order the blocks. The block header also provides additional data generated by the transaction execution such as transaction receipts, and logs.

This package implements Klaytn Block, Transaction and related functions and variables to support them.

Source Files

Functions and variables related to Block and Transaction are defined in the files listed below.

  • block.go : defines block and block header
  • bloom.go : defines bloom and its functions for bloom filter which helps user to filter transaction receipts efficiently
  • contract_ref.go : interfaces ContractRef to deliver a fee payer address to the contract execution environment
  • derive_sha.go : implements keccak256 hash functions in various ways
  • gen_header_json.go : auto-generated code for JSON marshalling/un-marshalling of block header
  • gen_log_json.go : auto-generated code for JSON marshalling/un-marshalling of contract execution log
  • gen_receipt_json.go : auto-generated code for JSON marshalling/un-marshalling of transaction receipt
  • istanbul.go : provides a block header modified for istanbul consensus
  • log.go : implements contract execution log
  • receipt.go : implements transaction receipt
  • transaction.go : defines transaction
  • transaction_signing.go : interfaces signer and implements transaction signing/verification functions
  • tx_internal_data.go : defines internal data of transaction supporting various transaction types
  • tx_internal_data_account_creation.go : implements the transaction creating an EOA account
  • tx_internal_data_account_update.go : implements the transaction updating account key of an account
  • tx_internal_data_cancel.go : implements the transaction canceling a transaction in the txpool
  • tx_internal_data_chain_data_anchoring.go : implements the transaction transferring data to service chain
  • tx_internal_data_fee_delegated_account_update.go : implements the fee-delegated version of account update transaction
  • tx_internal_data_fee_delegated_account_update_with_ratio.go : implements the partially fee-delegated version of account update transaction
  • tx_internal_data_fee_delegated_cancel.go: implements the fee-delegated version of cancel transaction
  • tx_internal_data_fee_delegated_cancel_with_ratio.go: implements the partially fee-delegated version of cancel transaction
  • tx_internal_data_fee_delegated_smart_contract_deploy.go : implements the fee-delegated version of contract deploy transaction
  • tx_internal_data_fee_delegated_smart_contract_deploy_with_ratio.go : implements the partially fee-delegated version of contract deploy transaction
  • tx_internal_data_fee_delegated_smart_contract_execution.go : implements the fee-delegated version of contract execution transaction
  • tx_internal_data_fee_delegated_smart_contract_execution_with_ratio.go : implements the partially fee-delegated version of contract execution transaction
  • tx_internal_data_fee_delegated_value_transfer.go: implements the fee-delegated version of value transfer transaction
  • tx_internal_data_fee_delegated_value_transfer_memo.go: implements the fee-delegated version of value transfer with memo transaction
  • tx_internal_data_fee_delegated_value_transfer_memo_with_ratio.go: implements the partially fee-delegated version of value transfer with memo transaction
  • tx_internal_data_fee_delegated_value_transfer_with_ratio.go :implements the partially fee-delegated version of value transfer transaction
  • tx_internal_data_legacy.go: implements the legacy transaction compatible with Ethereum
  • tx_internal_data_serializer.go: implements serialization functions of transaction internal data
  • tx_internal_data_smart_contract_deploy.go: implements the transaction deploying a smart contract
  • tx_internal_data_smart_contract_execution.go: implements the transaction executing a smart contract
  • tx_internal_data_value_transfer.go: implements the transaction sending KLAY to an EOA
  • tx_internal_data_value_transfer_memo.go: implements the transaction sending KLAY to an EOA with data
  • tx_signature.go : implements transaction signature (V, R, S)
  • tx_signatures.go : implements a slice of transaction signature to support multi-sig accounts

Index

Constants

View Source
const (
	AnchoringDataType0    uint8 = 0
	AnchoringJSONDataType uint8 = 128
)
View Source
const (
	Engine_IBFT int = iota
	Engine_Clique
	Engine_Gxhash
)
View Source
const (
	// BloomByteLength represents the number of bytes used in a header log bloom.
	BloomByteLength = 256

	// BloomBitLength represents the number of bits used in a header log bloom.
	BloomBitLength = 8 * BloomByteLength
)
View Source
const (
	ImplDeriveShaOriginal int = iota
	ImplDeriveShaSimple
	ImplDeriveShaConcat
)
View Source
const (
	// ReceiptStatusFailed is the status code of a transaction if execution failed.
	ReceiptStatusFailed = uint(0)

	// ReceiptStatusSuccessful is the status code of a transaction if execution succeeded.
	ReceiptStatusSuccessful = uint(1)

	// TODO-Klaytn Enable more error below.
	// Klaytn specific
	// NOTE-Klaytn Value should be consecutive from ReceiptStatusFailed to the last ReceiptStatusLast
	//         Add a new ReceiptStatusErrXXX before ReceiptStatusLast
	ReceiptStatusErrDefault                              = uint(0x02) // Default
	ReceiptStatusErrDepth                                = uint(0x03)
	ReceiptStatusErrContractAddressCollision             = uint(0x04)
	ReceiptStatusErrCodeStoreOutOfGas                    = uint(0x05)
	ReceiptStatuserrMaxCodeSizeExceed                    = uint(0x06)
	ReceiptStatusErrOutOfGas                             = uint(0x07)
	ReceiptStatusErrWriteProtection                      = uint(0x08)
	ReceiptStatusErrExecutionReverted                    = uint(0x09)
	ReceiptStatusErrOpcodeComputationCostLimitReached    = uint(0x0a)
	ReceiptStatusErrAddressAlreadyExists                 = uint(0x0b)
	ReceiptStatusErrNotAProgramAccount                   = uint(0x0c)
	ReceiptStatusErrNotHumanReadableAddress              = uint(0x0d)
	ReceiptStatusErrFeeRatioOutOfRange                   = uint(0x0e)
	ReceiptStatusErrAccountKeyFailNotUpdatable           = uint(0x0f)
	ReceiptStatusErrDifferentAccountKeyType              = uint(0x10)
	ReceiptStatusErrAccountKeyNilUninitializable         = uint(0x11)
	ReceiptStatusErrNotOnCurve                           = uint(0x12)
	ReceiptStatusErrZeroKeyWeight                        = uint(0x13)
	ReceiptStatusErrUnserializableKey                    = uint(0x14)
	ReceiptStatusErrDuplicatedKey                        = uint(0x15)
	ReceiptStatusErrWeightedSumOverflow                  = uint(0x16)
	ReceiptStatusErrUnsatisfiableThreshold               = uint(0x17)
	ReceiptStatusErrZeroLength                           = uint(0x18)
	ReceiptStatusErrLengthTooLong                        = uint(0x19)
	ReceiptStatusErrNestedRoleBasedKey                   = uint(0x1a)
	ReceiptStatusErrLegacyTransactionMustBeWithLegacyKey = uint(0x1b)
	ReceiptStatusErrDeprecated                           = uint(0x1c)
	ReceiptStatusErrNotSupported                         = uint(0x1d)
	ReceiptStatusErrInvalidCodeFormat                    = uint(0x1e)
	ReceiptStatusLast                                    = uint(0x1f) // Last value which is not an actual ReceiptStatus

)
View Source
const EthereumTxTypeEnvelope = TxType(0x78)
View Source
const SubTxTypeBits uint = 3

Variables

View Source
var (
	// EmptyRootHash is transaction/receipt root hash when there is no transaction.
	// This value is initialized in InitDeriveSha.
	EmptyRootHash = common.Hash{}
	EngineType    = Engine_IBFT
)
View Source
var (
	// IstanbulDigest represents a hash of "Istanbul practical byzantine fault tolerance"
	// to identify whether the block is from Istanbul consensus engine
	IstanbulDigest = common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365")

	IstanbulExtraVanity = 32 // Fixed number of extra-data bytes reserved for validator vanity
	IstanbulExtraSeal   = 65 // Fixed number of extra-data bytes reserved for validator seal

	// ErrInvalidIstanbulHeaderExtra is returned if the length of extra-data is less than 32 bytes
	ErrInvalidIstanbulHeaderExtra = errors.New("invalid istanbul header extra-data")
)
View Source
var (
	ErrInvalidSig         = errors.New("invalid transaction v, r, s values")
	ErrInvalidSigSender   = errors.New("invalid transaction v, r, s values of the sender")
	ErrInvalidSigFeePayer = errors.New("invalid transaction v, r, s values of the fee payer")

	ErrInvalidTxTypeForAnchoredData = errors.New("invalid transaction type for anchored data")
)
View Source
var (
	ErrTxTypeNotSupported         = errors.New("transaction type not supported")
	ErrSenderPubkeyNotSupported   = errors.New("SenderPubkey is not supported for this signer")
	ErrSenderFeePayerNotSupported = errors.New("SenderFeePayer is not supported for this signer")
	ErrHashFeePayerNotSupported   = errors.New("HashFeePayer is not supported for this signer")
)
View Source
var Bloom9 = bloom9
View Source
var (
	ErrInvalidChainId = errors.New("invalid chain id for signer")
)
View Source
var ErrShouldBeSingleSignature = errors.New("the number of signatures should be one")

Functions

func BloomLookup

func BloomLookup(bin Bloom, topic bytesBacked) bool

func CalcFeeWithRatio

func CalcFeeWithRatio(feeRatio FeeRatio, fee *big.Int) (*big.Int, *big.Int)

CalcFeeWithRatio returns feePayer's fee and sender's fee based on feeRatio. For example, if fee = 100 and feeRatio = 30, feePayer = 30 and feeSender = 70.

func DecodeAnchoringDataToJSON added in v1.5.2

func DecodeAnchoringDataToJSON(data []byte) (interface{}, error)

DecodeAnchoringDataToJSON decodes an anchoring data.

func DeriveSha

func DeriveSha(list DerivableList) common.Hash

func FilterTransactionWithBaseFee added in v1.9.0

func FilterTransactionWithBaseFee(pending map[common.Address]Transactions, baseFee *big.Int) map[common.Address]Transactions

FilterTransactionWithBaseFee returns a list of transactions for each account that filters transactions that are greater than or equal to baseFee.

func InitDeriveSha

func InitDeriveSha(i IDeriveSha)

func IntrinsicGas

func IntrinsicGas(data []byte, accessList AccessList, contractCreation bool, r params.Rules) (uint64, error)

IntrinsicGas computes the 'intrinsic gas' for a message with the given data.

func IntrinsicGasPayload

func IntrinsicGasPayload(gas uint64, data []byte) (uint64, error)

func IntrinsicGasPayloadLegacy

func IntrinsicGasPayloadLegacy(gas uint64, data []byte) (uint64, error)

func LogsBloom

func LogsBloom(logs []*Log) *big.Int

func Number

func Number(b1, b2 *Block) bool

func Sender

func Sender(signer Signer, tx *Transaction) (common.Address, error)

Sender returns the address of the transaction. If an ethereum transaction, it calls SenderFrom(). Otherwise, it just returns tx.From() because the other transaction types have the field `from`. NOTE: this function should not be called if tx signature validation is required. In that situtation, you should call ValidateSender().

func SenderFeePayer

func SenderFeePayer(signer Signer, tx *Transaction) (common.Address, error)

SenderFeePayer returns the fee payer address of the transaction. If the transaction is not a fee-delegated transaction, the fee payer is set to the address of the `from` of the transaction.

func SenderFeePayerPubkey

func SenderFeePayerPubkey(signer Signer, tx *Transaction) ([]*ecdsa.PublicKey, error)

SenderFeePayerPubkey returns the public key derived from the signature (V, R, S) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.

SenderFeePayerPubkey may cache the public key, allowing it to be used regardless of signing method. The cache is invalidated if the cached signer does not match the signer used in the current call.

func SenderFrom

func SenderFrom(signer Signer, tx *Transaction) (common.Address, error)

SenderFrom returns the address derived from the signature (V, R, S) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.

SenderFrom may cache the address, allowing it to be used regardless of signing method. The cache is invalidated if the cached signer does not match the signer used in the current call.

func SenderPubkey

func SenderPubkey(signer Signer, tx *Transaction) ([]*ecdsa.PublicKey, error)

SenderPubkey returns the public key derived from the signature (V, R, S) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.

SenderPubkey may cache the public key, allowing it to be used regardless of signing method. The cache is invalidated if the cached signer does not match the signer used in the current call.

Types

type AccessList added in v1.8.0

type AccessList []AccessTuple

AccessList is an EIP-2930 access list

func (AccessList) StorageKeys added in v1.8.0

func (al AccessList) StorageKeys() int

StorageKeys returns the total number of storage keys in the access list.

type AccessTuple added in v1.8.0

type AccessTuple struct {
	Address     common.Address `json:"address"        gencodec:"required"`
	StorageKeys []common.Hash  `json:"storageKeys"    gencodec:"required"`
}

AccessTuple is the element type of the access list

func (AccessTuple) MarshalJSON added in v1.8.0

func (a AccessTuple) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*AccessTuple) UnmarshalJSON added in v1.8.0

func (a *AccessTuple) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type AccountKeyPicker

type AccountKeyPicker interface {
	GetKey(address common.Address) accountkey.AccountKey
	Exist(addr common.Address) bool
}

AccountKeyPicker has a function GetKey() to retrieve an account key from statedb.

type AccountRefWithFeePayer

type AccountRefWithFeePayer struct {
	SenderAddress   common.Address
	FeePayerAddress common.Address
}

AccountRefWithFeePayer implements ContractRef. This structure has an additional field `feePayer` compared to `AccountRef`.

func NewAccountRefWithFeePayer

func NewAccountRefWithFeePayer(sender common.Address, feePayer common.Address) *AccountRefWithFeePayer

func (*AccountRefWithFeePayer) Address

func (a *AccountRefWithFeePayer) Address() common.Address

func (*AccountRefWithFeePayer) FeePayer

func (a *AccountRefWithFeePayer) FeePayer() common.Address

type AnchoringData added in v1.2.0

type AnchoringData struct {
	Type uint8
	Data []byte
}

func NewAnchoringDataType0 added in v1.2.0

func NewAnchoringDataType0(block *Block, blockCount uint64, txCount uint64) (*AnchoringData, error)

func NewAnchoringJSONDataType added in v1.5.2

func NewAnchoringJSONDataType(v interface{}) (*AnchoringData, error)

type AnchoringDataInternal added in v1.2.0

type AnchoringDataInternal interface {
	GetBlockHash() common.Hash
	GetBlockNumber() *big.Int
}

func DecodeAnchoringData added in v1.2.0

func DecodeAnchoringData(data []byte) (AnchoringDataInternal, error)

DecodeAnchoringData decodes an anchoring data used by main and sub bridges.

type AnchoringDataInternalType0 added in v1.2.0

type AnchoringDataInternalType0 struct {
	BlockHash     common.Hash `json:"blockHash"`
	TxHash        common.Hash `json:"transactionsRoot"`
	ParentHash    common.Hash `json:"parentHash"`
	ReceiptHash   common.Hash `json:"receiptsRoot"`
	StateRootHash common.Hash `json:"stateRoot"`
	BlockNumber   *big.Int    `json:"blockNumber"`
	BlockCount    *big.Int    `json:"blockCount"`
	TxCount       *big.Int    `json:"txCount"`
}

func (*AnchoringDataInternalType0) GetBlockHash added in v1.2.0

func (data *AnchoringDataInternalType0) GetBlockHash() common.Hash

func (*AnchoringDataInternalType0) GetBlockNumber added in v1.2.0

func (data *AnchoringDataInternalType0) GetBlockNumber() *big.Int

type AnchoringDataLegacy added in v1.2.0

type AnchoringDataLegacy struct {
	BlockHash     common.Hash `json:"blockHash"`
	TxHash        common.Hash `json:"transactionsRoot"`
	ParentHash    common.Hash `json:"parentHash"`
	ReceiptHash   common.Hash `json:"receiptsRoot"`
	StateRootHash common.Hash `json:"stateRoot"`
	BlockNumber   *big.Int    `json:"blockNumber"`
}

AnchoringDataLegacy is an old anchoring type that does not support an data type.

func (*AnchoringDataLegacy) GetBlockHash added in v1.2.0

func (data *AnchoringDataLegacy) GetBlockHash() common.Hash

func (*AnchoringDataLegacy) GetBlockNumber added in v1.2.0

func (data *AnchoringDataLegacy) GetBlockNumber() *big.Int

type Block

type Block struct {

	// These fields are used to track inter-peer block relay.
	ReceivedAt   time.Time
	ReceivedFrom interface{}
	// contains filtered or unexported fields
}

Block represents an entire block in the Klaytn blockchain.

func NewBlock

func NewBlock(header *Header, txs []*Transaction, receipts []*Receipt) *Block

NewBlock creates a new block. The input data is copied, changes to header and to the field values will not affect the block.

The values of TxHash, ReceiptHash and Bloom in header are ignored and set to values derived from the given txs and receipts.

func NewBlockWithHeader

func NewBlockWithHeader(header *Header) *Block

NewBlockWithHeader creates a block with the given header data. The header data is copied, changes to header and to the field values will not affect the block.

func SetRoundToBlock

func SetRoundToBlock(block *Block, r int64) *Block

func (*Block) BlockScore

func (b *Block) BlockScore() *big.Int

func (*Block) Bloom

func (b *Block) Bloom() Bloom

func (*Block) Body

func (b *Block) Body() *Body

Body returns the non-header content of the block.

func (*Block) DecodeRLP

func (b *Block) DecodeRLP(s *rlp.Stream) error

DecodeRLP decodes the Klaytn

func (*Block) EncodeRLP

func (b *Block) EncodeRLP(w io.Writer) error

EncodeRLP serializes a block into the Klaytn RLP block format.

func (*Block) Extra

func (b *Block) Extra() []byte

func (*Block) GasUsed

func (b *Block) GasUsed() uint64

func (*Block) Hash

func (b *Block) Hash() common.Hash

Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.

func (*Block) HashNoNonce

func (b *Block) HashNoNonce() common.Hash

func (*Block) Header

func (b *Block) Header() *Header

func (*Block) Number

func (b *Block) Number() *big.Int

func (*Block) NumberU64

func (b *Block) NumberU64() uint64

func (*Block) ParentHash

func (b *Block) ParentHash() common.Hash

func (*Block) ReceiptHash

func (b *Block) ReceiptHash() common.Hash

func (*Block) Rewardbase

func (b *Block) Rewardbase() common.Address

func (*Block) Root

func (b *Block) Root() common.Hash

func (*Block) Size

func (b *Block) Size() common.StorageSize

Size returns the true RLP encoded storage size of the block, either by encoding and returning it, or returning a previsouly cached value.

func (*Block) String

func (b *Block) String() string

func (*Block) Time

func (b *Block) Time() *big.Int

func (*Block) TimeFoS

func (b *Block) TimeFoS() uint8

func (*Block) Transaction

func (b *Block) Transaction(hash common.Hash) *Transaction

func (*Block) Transactions

func (b *Block) Transactions() Transactions

func (*Block) TxHash

func (b *Block) TxHash() common.Hash

func (*Block) WithBody

func (b *Block) WithBody(transactions []*Transaction) *Block

WithBody returns a new block with the given transactions.

func (*Block) WithSeal

func (b *Block) WithSeal(header *Header) *Block

WithSeal returns a new block with the data from b but the header replaced with the sealed one.

type BlockBy

type BlockBy func(b1, b2 *Block) bool

func (BlockBy) Sort

func (self BlockBy) Sort(blocks Blocks)

type Blocks

type Blocks []*Block

type Bloom

type Bloom [BloomByteLength]byte

Bloom represents a 2048 bit bloom filter.

func BytesToBloom

func BytesToBloom(b []byte) Bloom

BytesToBloom converts a byte slice to a bloom filter. It panics if b is not of suitable size.

func CreateBloom

func CreateBloom(receipts Receipts) Bloom

func (*Bloom) Add

func (b *Bloom) Add(d *big.Int)

Add adds d to the filter. Future calls of Test(d) will return true.

func (Bloom) Big

func (b Bloom) Big() *big.Int

Big converts b to a big integer.

func (Bloom) Bytes

func (b Bloom) Bytes() []byte

func (Bloom) MarshalText

func (b Bloom) MarshalText() ([]byte, error)

MarshalText encodes b as a hex string with 0x prefix.

func (*Bloom) SetBytes

func (b *Bloom) SetBytes(d []byte)

SetBytes sets the content of b to the given bytes. It panics if d is not of suitable size.

func (Bloom) Test

func (b Bloom) Test(test *big.Int) bool

func (Bloom) TestBytes

func (b Bloom) TestBytes(test []byte) bool

func (*Bloom) UnmarshalText

func (b *Bloom) UnmarshalText(input []byte) error

UnmarshalText b as a hex string with 0x prefix.

type Body

type Body struct {
	Transactions []*Transaction
}

Body is a simple (mutable, non-safe) data container for storing and moving a block's data contents (transactions) together.

type ContractRef

type ContractRef interface {
	Address() common.Address
	FeePayer() common.Address
}

ContractRef is a reference to the contract's backing object

type DerivableList

type DerivableList interface {
	Len() int
	GetRlp(i int) []byte
}

type DeriveShaConcat

type DeriveShaConcat struct{}

An alternative implementation of DeriveSha() This function generates a hash of `DerivableList` as below: 1. make a byte slice by concatenating RLP-encoded items 2. make a hash of the byte slice.

func (DeriveShaConcat) DeriveSha

func (d DeriveShaConcat) DeriveSha(list DerivableList) (hash common.Hash)

type DeriveShaSimple

type DeriveShaSimple struct{}

An alternative implementation of DeriveSha() This function generates a hash of `DerivableList` by simulating merkle tree generation

func (DeriveShaSimple) DeriveSha

func (d DeriveShaSimple) DeriveSha(list DerivableList) common.Hash

type EIP155Signer

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

EIP155Transaction implements Signer using the EIP155 rules.

func NewEIP155Signer

func NewEIP155Signer(chainId *big.Int) EIP155Signer

func (EIP155Signer) ChainID added in v1.8.0

func (s EIP155Signer) ChainID() *big.Int

ChainID returns the chain id.

func (EIP155Signer) Equal

func (s EIP155Signer) Equal(s2 Signer) bool

func (EIP155Signer) Hash

func (s EIP155Signer) Hash(tx *Transaction) common.Hash

Hash returns the hash to be signed by the sender. It does not uniquely identify the transaction.

func (EIP155Signer) HashFeePayer

func (s EIP155Signer) HashFeePayer(tx *Transaction) (common.Hash, error)

HashFeePayer returns the hash with a fee payer's address to be signed by a fee payer. It does not uniquely identify the transaction.

func (EIP155Signer) Sender

func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error)

func (EIP155Signer) SenderFeePayer

func (s EIP155Signer) SenderFeePayer(tx *Transaction) ([]*ecdsa.PublicKey, error)

func (EIP155Signer) SenderPubkey

func (s EIP155Signer) SenderPubkey(tx *Transaction) ([]*ecdsa.PublicKey, error)

func (EIP155Signer) SignatureValues

func (s EIP155Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big.Int, err error)

SignatureValues returns a new transaction with the given signature. This signature needs to be in the [R || S || V] format where V is 0 or 1.

type FeeRatio

type FeeRatio uint8
const MaxFeeRatio FeeRatio = 100

MaxFeeRatio is the maximum value of feeRatio. Since it is represented in percentage, the maximum value is 100.

func (FeeRatio) IsValid

func (f FeeRatio) IsValid() bool

FeeRatio is valid where it is [1,99].

type FrontierSigner added in v1.9.0

type FrontierSigner struct{}

func (FrontierSigner) ChainID added in v1.9.0

func (s FrontierSigner) ChainID() *big.Int

func (FrontierSigner) Equal added in v1.9.0

func (s FrontierSigner) Equal(s2 Signer) bool

func (FrontierSigner) Hash added in v1.9.0

func (fs FrontierSigner) Hash(tx *Transaction) common.Hash

Hash returns the hash to be signed by the sender. It does not uniquely identify the transaction.

func (FrontierSigner) HashFeePayer added in v1.9.0

func (fs FrontierSigner) HashFeePayer(tx *Transaction) (common.Hash, error)

func (FrontierSigner) Sender added in v1.9.0

func (fs FrontierSigner) Sender(tx *Transaction) (common.Address, error)

func (FrontierSigner) SenderFeePayer added in v1.9.0

func (fs FrontierSigner) SenderFeePayer(tx *Transaction) ([]*ecdsa.PublicKey, error)

func (FrontierSigner) SenderPubkey added in v1.9.0

func (fs FrontierSigner) SenderPubkey(tx *Transaction) ([]*ecdsa.PublicKey, error)

func (FrontierSigner) SignatureValues added in v1.9.0

func (fs FrontierSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error)

SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.

type Header struct {
	ParentHash  common.Hash    `json:"parentHash"       gencodec:"required"`
	Rewardbase  common.Address `json:"reward"           gencodec:"required"`
	Root        common.Hash    `json:"stateRoot"        gencodec:"required"`
	TxHash      common.Hash    `json:"transactionsRoot" gencodec:"required"`
	ReceiptHash common.Hash    `json:"receiptsRoot"     gencodec:"required"`
	Bloom       Bloom          `json:"logsBloom"        gencodec:"required"`
	BlockScore  *big.Int       `json:"blockScore"       gencodec:"required"`
	Number      *big.Int       `json:"number"           gencodec:"required"`
	GasUsed     uint64         `json:"gasUsed"          gencodec:"required"`
	Time        *big.Int       `json:"timestamp"        gencodec:"required"`
	// TimeFoS represents a fraction of a second since `Time`.
	TimeFoS    uint8  `json:"timestampFoS"              gencodec:"required"`
	Extra      []byte `json:"extraData"                 gencodec:"required"`
	Governance []byte `json:"governanceData"            gencodec:"required"`
	Vote       []byte `json:"voteData,omitempty"`

	BaseFee *big.Int `json:"baseFeePerGas,omitempty"    rlp:"optional"`
}

Header represents a block header in the Klaytn blockchain.

func CopyHeader

func CopyHeader(h *Header) *Header

CopyHeader creates a deep copy of a block header to prevent side effects from modifying a header variable.

func IstanbulFilteredHeader

func IstanbulFilteredHeader(h *Header, keepSeal bool) *Header

IstanbulFilteredHeader returns a filtered header which some information (like seal, committed seals) are clean to fulfill the Istanbul hash rules. It returns nil if the extra-data cannot be decoded/encoded by rlp.

func SetRoundToHeader

func SetRoundToHeader(h *Header, r int64) *Header

func (*Header) EmptyBody added in v1.6.0

func (h *Header) EmptyBody() bool

EmptyBody returns true if there is no additional 'body' to complete the header that is: no transactions.

func (*Header) EmptyReceipts added in v1.6.0

func (h *Header) EmptyReceipts() bool

EmptyReceipts returns true if there are no receipts for this header/block.

func (*Header) Hash

func (h *Header) Hash() common.Hash

Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding.

func (*Header) HashNoNonce

func (h *Header) HashNoNonce() common.Hash

HashNoNonce returns the hash which is used as input for the proof-of-work search.

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Header) Round added in v1.6.0

func (h *Header) Round() byte

func (*Header) Size

func (h *Header) Size() common.StorageSize

Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.

func (*Header) String

func (h *Header) String() string

func (*Header) UnmarshalJSON

func (h *Header) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type HomesteadSigner added in v1.9.0

type HomesteadSigner struct{ FrontierSigner }

HomesteadTransaction implements TransactionInterface using the homestead rules.

func (HomesteadSigner) ChainID added in v1.9.0

func (s HomesteadSigner) ChainID() *big.Int

func (HomesteadSigner) Equal added in v1.9.0

func (s HomesteadSigner) Equal(s2 Signer) bool

func (HomesteadSigner) Sender added in v1.9.0

func (hs HomesteadSigner) Sender(tx *Transaction) (common.Address, error)

func (HomesteadSigner) SignatureValues added in v1.9.0

func (hs HomesteadSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error)

SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.

type IDeriveSha

type IDeriveSha interface {
	DeriveSha(list DerivableList) common.Hash
}

type IstanbulExtra

type IstanbulExtra struct {
	Validators    []common.Address
	Seal          []byte
	CommittedSeal [][]byte
}

func ExtractIstanbulExtra

func ExtractIstanbulExtra(h *Header) (*IstanbulExtra, error)

ExtractIstanbulExtra extracts all values of the IstanbulExtra from the header. It returns an error if the length of the given extra-data is less than 32 bytes or the extra-data can not be decoded.

func (*IstanbulExtra) DecodeRLP

func (ist *IstanbulExtra) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the istanbul fields from a RLP stream.

func (*IstanbulExtra) EncodeRLP

func (ist *IstanbulExtra) EncodeRLP(w io.Writer) error

EncodeRLP serializes the istanbul fields into the Klaytn RLP format.

type Log

type Log struct {
	// Consensus fields:
	// address of the contract that generated the event
	Address common.Address `json:"address" gencodec:"required"`
	// list of topics provided by the contract.
	Topics []common.Hash `json:"topics" gencodec:"required"`
	// supplied by the contract, usually ABI-encoded
	Data []byte `json:"data" gencodec:"required"`

	// Derived fields. These fields are filled in by the node
	// but not secured by consensus.
	// block in which the transaction was included
	BlockNumber uint64 `json:"blockNumber"`
	// hash of the transaction
	TxHash common.Hash `json:"transactionHash" gencodec:"required"`
	// index of the transaction in the block
	TxIndex uint `json:"transactionIndex" gencodec:"required"`
	// hash of the block in which the transaction was included
	BlockHash common.Hash `json:"blockHash"`
	// index of the log in the receipt
	Index uint `json:"logIndex" gencodec:"required"`

	// The Removed field is true if this log was reverted due to a chain reorganisation.
	// You must pay attention to this field if you receive logs through a filter query.
	Removed bool `json:"removed"`
}

Log represents a contract log event. These events are generated by the LOG opcode and stored/indexed by the node.

func (*Log) DecodeRLP

func (l *Log) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder.

func (*Log) EncodeRLP

func (l *Log) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder.

func (Log) MarshalJSON

func (l Log) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Log) String

func (l *Log) String() string

func (*Log) UnmarshalJSON

func (l *Log) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type LogForStorage

type LogForStorage Log

LogForStorage is a wrapper around a Log that flattens and parses the entire content of a log including non-consensus fields.

func (*LogForStorage) DecodeRLP

func (l *LogForStorage) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder.

func (*LogForStorage) EncodeRLP

func (l *LogForStorage) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder.

type Receipt

type Receipt struct {
	// Consensus fields
	Status uint   `json:"status"`
	Bloom  Bloom  `json:"logsBloom"         gencodec:"required"`
	Logs   []*Log `json:"logs"              gencodec:"required"`

	// Implementation fields (don't reorder!)
	TxHash          common.Hash    `json:"transactionHash" gencodec:"required"`
	ContractAddress common.Address `json:"contractAddress"`
	GasUsed         uint64         `json:"gasUsed" gencodec:"required"`
}

Receipt represents the results of a transaction.

func NewReceipt

func NewReceipt(status uint, txHash common.Hash, gasUsed uint64) *Receipt

NewReceipt creates a barebone transaction receipt, copying the init fields.

func (*Receipt) DecodeRLP

func (r *Receipt) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and loads the consensus fields of a receipt from an RLP stream.

func (*Receipt) EncodeRLP

func (r *Receipt) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder, and flattens the consensus fields of a receipt into an RLP stream. If no post state is present, byzantium fork is assumed.

func (Receipt) MarshalJSON

func (r Receipt) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Receipt) Size

func (r *Receipt) Size() common.StorageSize

Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.

func (*Receipt) String

func (r *Receipt) String() string

String implements the Stringer interface.

func (*Receipt) UnmarshalJSON

func (r *Receipt) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type ReceiptForStorage

type ReceiptForStorage Receipt

ReceiptForStorage is a wrapper around a Receipt that flattens and parses the entire content of a receipt, as opposed to only the consensus fields originally.

func (*ReceiptForStorage) DecodeRLP

func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and loads both consensus and implementation fields of a receipt from an RLP stream.

func (*ReceiptForStorage) EncodeRLP

func (r *ReceiptForStorage) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder, and flattens all content fields of a receipt into an RLP stream.

type Receipts

type Receipts []*Receipt

Receipts is a wrapper around a Receipt array to implement DerivableList.

func (Receipts) GetRlp

func (r Receipts) GetRlp(i int) []byte

GetRlp returns the RLP encoding of one receipt from the list.

func (Receipts) Len

func (r Receipts) Len() int

Len returns the number of receipts in this list.

type Result

type Result struct {
	Block *Block
	Round int64
}

type Signer

type Signer interface {
	// Sender returns the sender address of the transaction.
	Sender(tx *Transaction) (common.Address, error)
	// SenderPubkey returns the public key derived from tx signature and txhash.
	SenderPubkey(tx *Transaction) ([]*ecdsa.PublicKey, error)
	// SenderFeePayer returns the public key derived from tx signature and txhash.
	SenderFeePayer(tx *Transaction) ([]*ecdsa.PublicKey, error)
	// SignatureValues returns the raw R, S, V values corresponding to the
	// given signature.
	SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error)
	// ChainID returns the chain id.
	ChainID() *big.Int
	// Hash returns 'signature hash', i.e. the transaction hash that is signed by the
	// private key. This hash does not uniquely identify the transaction.
	Hash(tx *Transaction) common.Hash
	// HashFeePayer returns the hash with a fee payer's address to be signed by a fee payer.
	HashFeePayer(tx *Transaction) (common.Hash, error)
	// Equal returns true if the given signer is the same as the receiver.
	Equal(Signer) bool
}

Signer encapsulates transaction signature handling. Note that this interface is not a stable API and may change at any time to accommodate new protocol rules.

func LatestSigner added in v1.8.0

func LatestSigner(config *params.ChainConfig) Signer

LatestSigner returns the 'most permissive' Signer available for the given chain configuration. Specifically, this enables support of EIP-155 replay protection and EIP-2930 access list transactions when their respective forks are scheduled to occur at any block number in the chain config.

Use this in transaction-handling code where the current block number is unknown. If you have the current block number available, use MakeSigner instead.

func LatestSignerForChainID added in v1.8.0

func LatestSignerForChainID(chainID *big.Int) Signer

LatestSignerForChainID returns the 'most permissive' Signer available. Specifically, this enables support for EIP-155 replay protection and all implemented EIP-2718 transaction types if chainID is non-nil.

Use this in transaction-handling code where the current block number and fork configuration are unknown. If you have a ChainConfig, use LatestSigner instead. If you have a ChainConfig and know the current block number, use MakeSigner instead.

func MakeSigner

func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer

MakeSigner returns a Signer based on the given chain config and block number.

func NewEIP2930Signer added in v1.8.0

func NewEIP2930Signer(chainId *big.Int) Signer

NewEIP2930Signer returns a signer that accepts EIP-2930 access list transactions, EIP-155 replay protected transactions, and legacy transactions.

func NewLondonSigner added in v1.8.0

func NewLondonSigner(chainId *big.Int) Signer

NewLondonSigner returns a signer that accepts - EIP-1559 dynamic fee transactions, - EIP-2930 access list transactions and - EIP-155 replay protected transactions.

type StateDB

type StateDB interface {
	IncNonce(common.Address)
	Exist(common.Address) bool
	UpdateKey(addr common.Address, key accountkey.AccountKey, currentBlockNumber uint64) error
	CreateEOA(addr common.Address, humanReadable bool, key accountkey.AccountKey)
	CreateSmartContractAccount(addr common.Address, format params.CodeFormat, r params.Rules)
	CreateSmartContractAccountWithKey(addr common.Address, humanReadable bool, key accountkey.AccountKey, format params.CodeFormat, r params.Rules)
	IsProgramAccount(addr common.Address) bool
	IsContractAvailable(addr common.Address) bool
	IsValidCodeFormat(addr common.Address) bool
	GetKey(addr common.Address) accountkey.AccountKey
}

Since we cannot access the package `blockchain/state` directly, an interface `StateDB` is introduced. TODO-Klaytn-Refactoring: Transaction and related data structures should be a new package.

type Transaction

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

func NewAccountCreationTransactionWithMap

func NewAccountCreationTransactionWithMap(values map[TxValueKeyType]interface{}) (*Transaction, error)

NewAccountCreationTransactionWithMap is a test only function since the accountCreation tx is disabled. The function generates an accountCreation function like 'NewTxInternalDataWithMap()'.

func NewContractCreation

func NewContractCreation(nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction

func NewMessage

func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, checkNonce bool, intrinsicGas uint64) *Transaction

NewMessage returns a `*Transaction` object with the given arguments.

func NewTransaction

func NewTransaction(nonce uint64, to common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction

func NewTransactionWithMap

func NewTransactionWithMap(t TxType, values map[TxValueKeyType]interface{}) (tx *Transaction, retErr error)

NewTransactionWithMap generates a tx from tx field values. One of the return value, retErr, is lastly updated when panic is occurred.

func NewTx added in v1.8.0

func NewTx(data TxInternalData) *Transaction

NewTx creates a new transaction.

func SignTx

func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)

SignTx signs the transaction using the given signer and private key

func SignTxAsFeePayer added in v1.3.0

func SignTxAsFeePayer(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)

SignTxAsFeePayer signs the transaction as a fee payer using the given signer and private key

func (*Transaction) AccessList added in v1.8.0

func (tx *Transaction) AccessList() AccessList

func (*Transaction) AnchoredData

func (tx *Transaction) AnchoredData() ([]byte, error)

AnchoredData returns the anchored data of the chain data anchoring transaction. if the tx is not chain data anchoring transaction, it will return error.

func (*Transaction) AsMessageWithAccountKeyPicker

func (tx *Transaction) AsMessageWithAccountKeyPicker(s Signer, picker AccountKeyPicker, currentBlockNumber uint64) (*Transaction, error)

AsMessageWithAccountKeyPicker returns the transaction as a blockchain.Message.

AsMessageWithAccountKeyPicker requires a signer to derive the sender and AccountKeyPicker.

XXX Rename message to something less arbitrary? TODO-Klaytn: Message is removed and this function will return *Transaction.

func (*Transaction) ChainId

func (tx *Transaction) ChainId() *big.Int

ChainId returns which chain id this transaction was signed for (if at all)

func (*Transaction) CheckNonce

func (tx *Transaction) CheckNonce() bool

func (*Transaction) Cost

func (tx *Transaction) Cost() *big.Int

Cost returns amount + gasprice * gaslimit.

func (*Transaction) Data

func (tx *Transaction) Data() []byte

func (*Transaction) DecodeRLP

func (tx *Transaction) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder

func (*Transaction) EffectiveGasPrice added in v1.8.0

func (tx *Transaction) EffectiveGasPrice(header *Header) *big.Int

func (*Transaction) EffectiveGasTip added in v1.8.0

func (tx *Transaction) EffectiveGasTip(baseFee *big.Int) *big.Int

This function is disabled because klaytn has no gas tip

func (*Transaction) EncodeRLP

func (tx *Transaction) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder

func (*Transaction) Equal

func (tx *Transaction) Equal(tb *Transaction) bool

func (*Transaction) Execute

func (tx *Transaction) Execute(vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) ([]byte, uint64, error)

Execute performs execution of the transaction. This function will be called from StateTransition.TransitionDb(). Since each transaction type performs different execution, this function calls TxInternalData.TransitionDb().

func (*Transaction) Fee

func (tx *Transaction) Fee() *big.Int

func (*Transaction) FeePayer

func (tx *Transaction) FeePayer() (common.Address, error)

FeePayer returns the fee payer address. If the tx is a fee-delegated transaction, it returns the specified fee payer. Otherwise, it returns `from` of the tx.

func (*Transaction) FeeRatio

func (tx *Transaction) FeeRatio() (FeeRatio, bool)

FeeRatio returns the fee ratio of a transaction and a boolean value indicating TxInternalDataFeeRatio implementation. If the transaction does not implement TxInternalDataFeeRatio, it returns MaxFeeRatio which means the fee payer will be paid all tx fee by default.

func (*Transaction) FillContractAddress

func (tx *Transaction) FillContractAddress(from common.Address, r *Receipt)

FillContractAddress fills contract address to receipt. This only works for types deploying a smart contract.

func (*Transaction) From

func (tx *Transaction) From() (common.Address, error)

From returns the from address of the transaction. Since a legacy transaction (TxInternalDataLegacy) does not have the field `from`, calling From() is failed for `TxInternalDataLegacy`.

func (*Transaction) Gas

func (tx *Transaction) Gas() uint64

func (*Transaction) GasFeeCap added in v1.8.0

func (tx *Transaction) GasFeeCap() *big.Int

func (*Transaction) GasPrice

func (tx *Transaction) GasPrice() *big.Int

func (*Transaction) GasTipCap added in v1.8.0

func (tx *Transaction) GasTipCap() *big.Int

func (*Transaction) GetFeePayerSignatures added in v1.3.0

func (tx *Transaction) GetFeePayerSignatures() (TxSignatures, error)

GetFeePayerSignatures returns fee payer signatures of the transaction.

func (*Transaction) GetRoleTypeForValidation

func (tx *Transaction) GetRoleTypeForValidation() accountkey.RoleType

func (*Transaction) GetTxInternalData

func (tx *Transaction) GetTxInternalData() TxInternalData

func (*Transaction) Hash

func (tx *Transaction) Hash() common.Hash

Hash hashes the RLP encoding of tx. It uniquely identifies the transaction.

func (*Transaction) IntrinsicGas

func (tx *Transaction) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*Transaction) IsEthTypedTransaction added in v1.8.0

func (tx *Transaction) IsEthTypedTransaction() bool

func (*Transaction) IsEthereumTransaction added in v1.8.0

func (tx *Transaction) IsEthereumTransaction() bool

func (*Transaction) IsFeeDelegatedTransaction

func (tx *Transaction) IsFeeDelegatedTransaction() bool

IsFeeDelegatedTransaction returns true if the transaction is a fee-delegated transaction. A fee-delegated transaction has an address of the fee payer which can be different from `from` of the tx.

func (*Transaction) IsLegacyTransaction

func (tx *Transaction) IsLegacyTransaction() bool

func (*Transaction) IsMarkedUnexecutable

func (tx *Transaction) IsMarkedUnexecutable() bool

func (*Transaction) MakeRPCOutput

func (tx *Transaction) MakeRPCOutput() map[string]interface{}

func (*Transaction) MarkUnexecutable

func (tx *Transaction) MarkUnexecutable(b bool)

func (*Transaction) MarshalBinary added in v1.8.0

func (tx *Transaction) MarshalBinary() ([]byte, error)

MarshalBinary returns the canonical encoding of the transaction. For legacy transactions, it returns the RLP encoding. For typed transactions, it returns the type and payload.

func (*Transaction) MarshalJSON

func (tx *Transaction) MarshalJSON() ([]byte, error)

MarshalJSON encodes the web3 RPC transaction format.

func (*Transaction) Nonce

func (tx *Transaction) Nonce() uint64

func (*Transaction) Protected added in v1.9.0

func (tx *Transaction) Protected() bool

Protected says whether the transaction is replay-protected.

func (*Transaction) RawSignatureValues

func (tx *Transaction) RawSignatureValues() TxSignatures

func (*Transaction) SenderTxHash

func (tx *Transaction) SenderTxHash() (common.Hash, bool)

SenderTxHash returns (SenderTxHash, true) if the tx is a fee-delegated transaction. Otherwise, it returns (nil hash, false).

func (*Transaction) SenderTxHashAll

func (tx *Transaction) SenderTxHashAll() common.Hash

SenderTxHashAll returns SenderTxHash for all tx types. If it is not a fee-delegated tx, SenderTxHash and TxHash are the same.

func (*Transaction) SetFeePayerSignatures

func (tx *Transaction) SetFeePayerSignatures(s TxSignatures) error

func (*Transaction) SetSignature

func (tx *Transaction) SetSignature(signature TxSignatures)

func (*Transaction) Sign

func (tx *Transaction) Sign(s Signer, prv *ecdsa.PrivateKey) error

Sign signs the tx with the given signer and private key.

func (*Transaction) SignFeePayer

func (tx *Transaction) SignFeePayer(s Signer, prv *ecdsa.PrivateKey) error

SignFeePayer signs the tx with the given signer and private key as a fee payer.

func (*Transaction) SignFeePayerWithKeys

func (tx *Transaction) SignFeePayerWithKeys(s Signer, prv []*ecdsa.PrivateKey) error

SignFeePayerWithKeys signs the tx with the given signer and a slice of private keys as a fee payer.

func (*Transaction) SignWithKeys

func (tx *Transaction) SignWithKeys(s Signer, prv []*ecdsa.PrivateKey) error

SignWithKeys signs the tx with the given signer and a slice of private keys.

func (*Transaction) Size

func (tx *Transaction) Size() common.StorageSize

Size returns the true RLP encoded storage size of the transaction, either by encoding and returning it, or returning a previsouly cached value.

func (*Transaction) String

func (tx *Transaction) String() string

func (*Transaction) Time added in v1.8.3

func (tx *Transaction) Time() time.Time

Time returns the time that transaction was created.

func (*Transaction) To

func (tx *Transaction) To() *common.Address

To returns the recipient address of the transaction. It returns nil if the transaction is a contract creation.

func (*Transaction) Type

func (tx *Transaction) Type() TxType

func (*Transaction) UnmarshalBinary added in v1.8.0

func (tx *Transaction) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes the canonical encoding of transactions. It supports legacy RLP transactions and EIP2718 typed transactions.

func (*Transaction) UnmarshalJSON

func (tx *Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON decodes the web3 RPC transaction format.

func (*Transaction) Validate

func (tx *Transaction) Validate(db StateDB, blockNumber uint64) error

func (*Transaction) ValidateFeePayer

func (tx *Transaction) ValidateFeePayer(signer Signer, p AccountKeyPicker, currentBlockNumber uint64) (uint64, error)

ValidateFeePayer finds a fee payer from a transaction. If the transaction is not a fee-delegated transaction, it returns an error.

func (*Transaction) ValidateMutableValue

func (tx *Transaction) ValidateMutableValue(db StateDB, signer Signer, currentBlockNumber uint64) error

ValidateMutableValue conducts validation of the sender's account key and additional validation for each transaction type.

func (*Transaction) ValidateSender

func (tx *Transaction) ValidateSender(signer Signer, p AccountKeyPicker, currentBlockNumber uint64) (uint64, error)

ValidateSender finds a sender from both legacy and new types of transactions. It returns the senders address and gas used for the tx validation.

func (*Transaction) ValidatedFeePayer

func (tx *Transaction) ValidatedFeePayer() common.Address

func (*Transaction) ValidatedIntrinsicGas

func (tx *Transaction) ValidatedIntrinsicGas() uint64

func (*Transaction) ValidatedSender

func (tx *Transaction) ValidatedSender() common.Address

func (*Transaction) Value

func (tx *Transaction) Value() *big.Int

func (*Transaction) WithFeePayerSignature added in v1.3.0

func (tx *Transaction) WithFeePayerSignature(signer Signer, sig []byte) (*Transaction, error)

WithFeePayerSignature returns a new transaction with the given fee payer signature.

func (*Transaction) WithSignature

func (tx *Transaction) WithSignature(signer Signer, sig []byte) (*Transaction, error)

WithSignature returns a new transaction with the given signature. This signature needs to be formatted as described in the yellow paper (v+27).

type Transactions

type Transactions []*Transaction

Transactions is a Transaction slice type for basic sorting.

func TxDifference

func TxDifference(a, b Transactions) (keep Transactions)

TxDifference returns a new set t which is the difference between a to b.

func (Transactions) GetRlp

func (s Transactions) GetRlp(i int) []byte

GetRlp implements Rlpable and returns the i'th element of s in rlp.

func (Transactions) Len

func (s Transactions) Len() int

Len returns the length of s.

func (Transactions) Swap

func (s Transactions) Swap(i, j int)

Swap swaps the i'th and the j'th element in s.

type TransactionsByTimeAndNonce added in v1.9.0

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

TransactionsByTimeAndNonce represents a set of transactions that can return transactions in a profit-maximizing sorted order, while supporting removing entire batches of transactions for non-executable accounts.

func NewTransactionsByTimeAndNonce added in v1.9.0

func NewTransactionsByTimeAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByTimeAndNonce

NewTransactionsByTimeAndNonce creates a transaction set that can retrieve time sorted transactions in a nonce-honouring way.

Note, the input map is reowned so the caller should not interact any more with if after providing it to the constructor.

func (*TransactionsByTimeAndNonce) Count added in v1.9.0

func (t *TransactionsByTimeAndNonce) Count() (int, int)

############ method for debug

func (*TransactionsByTimeAndNonce) Peek added in v1.9.0

Peek returns the next transaction by time.

func (*TransactionsByTimeAndNonce) Pop added in v1.9.0

func (t *TransactionsByTimeAndNonce) Pop()

Pop removes the best transaction, *not* replacing it with the next one from the same account. This should be used when a transaction cannot be executed and hence all subsequent ones should be discarded from the same account.

func (*TransactionsByTimeAndNonce) Shift added in v1.9.0

func (t *TransactionsByTimeAndNonce) Shift()

Shift replaces the current best head with the next one from the same account.

func (*TransactionsByTimeAndNonce) Txs added in v1.9.0

type TxByNonce

type TxByNonce Transactions

TxByNonce implements the sort interface to allow sorting a list of transactions by their nonces. This is usually only useful for sorting transactions from a single account, otherwise a nonce comparison doesn't make much sense.

func (TxByNonce) Len

func (s TxByNonce) Len() int

func (TxByNonce) Less

func (s TxByNonce) Less(i, j int) bool

func (TxByNonce) Swap

func (s TxByNonce) Swap(i, j int)

type TxByPriceAndTime added in v1.8.3

type TxByPriceAndTime Transactions

TxByPriceAndTime implements both the sort and the heap interface, making it useful for all at once sorting as well as individually adding and removing elements.

func (TxByPriceAndTime) Len added in v1.8.3

func (s TxByPriceAndTime) Len() int

func (TxByPriceAndTime) Less added in v1.8.3

func (s TxByPriceAndTime) Less(i, j int) bool

func (*TxByPriceAndTime) Pop added in v1.8.3

func (s *TxByPriceAndTime) Pop() interface{}

func (*TxByPriceAndTime) Push added in v1.8.3

func (s *TxByPriceAndTime) Push(x interface{})

func (TxByPriceAndTime) Swap added in v1.8.3

func (s TxByPriceAndTime) Swap(i, j int)

type TxByTime added in v1.9.0

type TxByTime Transactions

func (TxByTime) Len added in v1.9.0

func (s TxByTime) Len() int

func (TxByTime) Less added in v1.9.0

func (s TxByTime) Less(i, j int) bool

func (*TxByTime) Pop added in v1.9.0

func (s *TxByTime) Pop() interface{}

func (*TxByTime) Push added in v1.9.0

func (s *TxByTime) Push(x interface{})

func (TxByTime) Swap added in v1.9.0

func (s TxByTime) Swap(i, j int)

type TxInternalData

type TxInternalData interface {
	Type() TxType

	GetAccountNonce() uint64
	GetPrice() *big.Int
	GetGasLimit() uint64
	GetRecipient() *common.Address
	GetAmount() *big.Int
	GetHash() *common.Hash

	SetHash(*common.Hash)
	SetSignature(TxSignatures)

	// RawSignatureValues returns signatures as a slice of `*big.Int`.
	// Due to multi signatures, it is not good to return three values of `*big.Int`.
	// The format would be something like [["V":v, "R":r, "S":s}, {"V":v, "R":r, "S":s}].
	RawSignatureValues() TxSignatures

	// ValidateSignature returns true if the signature is valid.
	ValidateSignature() bool

	// RecoverAddress returns address derived from txhash and signatures(r, s, v).
	// Since EIP155Signer modifies V value during recovering while other signers don't, it requires vfunc for the treatment.
	RecoverAddress(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) (common.Address, error)

	// RecoverPubkey returns a public key derived from txhash and signatures(r, s, v).
	// Since EIP155Signer modifies V value during recovering while other signers don't, it requires vfunc for the treatment.
	RecoverPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

	// ChainId returns which chain id this transaction was signed for (if at all)
	ChainId() *big.Int

	// Equal returns true if all attributes are the same.
	Equal(t TxInternalData) bool

	// IntrinsicGas computes additional 'intrinsic gas' based on tx types.
	IntrinsicGas(currentBlockNumber uint64) (uint64, error)

	// SerializeForSign returns a slice containing attributes to make its tx signature.
	SerializeForSign() []interface{}

	// SenderTxHash returns a hash of the tx without the fee payer's address and signature.
	SenderTxHash() common.Hash

	// Validate returns nil if tx is validated with the given stateDB and currentBlockNumber.
	// Otherwise, it returns an error.
	// This function is called in TxPool.validateTx() and TxInternalData.Execute().
	Validate(stateDB StateDB, currentBlockNumber uint64) error

	// ValidateMutableValue returns nil if tx is validated. Otherwise, it returns an error.
	// The function validates tx values associated with mutable values in the state.
	// MutableValues: accountKey, the existence of creating address, feePayer's balance, etc.
	ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

	// IsLegacyTransaction returns true if the tx type is a legacy transaction (TxInternalDataLegacy) object.
	IsLegacyTransaction() bool

	// GetRoleTypeForValidation returns RoleType to validate this transaction.
	GetRoleTypeForValidation() accountkey.RoleType

	// String returns a string containing information about the fields of the object.
	String() string

	// Execute performs execution of the transaction according to the transaction type.
	Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

	MakeRPCOutput() map[string]interface{}
}

TxInternalData is an interface for an internal data structure of a Transaction

func NewTxInternalData

func NewTxInternalData(t TxType) (TxInternalData, error)

func NewTxInternalDataWithMap

func NewTxInternalDataWithMap(t TxType, values map[TxValueKeyType]interface{}) (TxInternalData, error)

type TxInternalDataAccountCreation

type TxInternalDataAccountCreation struct {
	AccountNonce  uint64
	Price         *big.Int
	GasLimit      uint64
	Recipient     common.Address
	Amount        *big.Int
	From          common.Address
	HumanReadable bool
	Key           accountkey.AccountKey

	TxSignatures

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataAccountCreation represents a transaction creating an account.

func (*TxInternalDataAccountCreation) DecodeRLP

func (t *TxInternalDataAccountCreation) DecodeRLP(s *rlp.Stream) error

func (*TxInternalDataAccountCreation) EncodeRLP

func (t *TxInternalDataAccountCreation) EncodeRLP(w io.Writer) error

func (*TxInternalDataAccountCreation) Equal

func (*TxInternalDataAccountCreation) Execute

func (t *TxInternalDataAccountCreation) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataAccountCreation) GetAccountNonce

func (t *TxInternalDataAccountCreation) GetAccountNonce() uint64

func (*TxInternalDataAccountCreation) GetAmount

func (t *TxInternalDataAccountCreation) GetAmount() *big.Int

func (*TxInternalDataAccountCreation) GetFrom

func (*TxInternalDataAccountCreation) GetGasLimit

func (t *TxInternalDataAccountCreation) GetGasLimit() uint64

func (*TxInternalDataAccountCreation) GetHash

func (*TxInternalDataAccountCreation) GetPrice

func (t *TxInternalDataAccountCreation) GetPrice() *big.Int

func (*TxInternalDataAccountCreation) GetRecipient

func (t *TxInternalDataAccountCreation) GetRecipient() *common.Address

func (*TxInternalDataAccountCreation) GetRoleTypeForValidation

func (t *TxInternalDataAccountCreation) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataAccountCreation) IntrinsicGas

func (t *TxInternalDataAccountCreation) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataAccountCreation) IsLegacyTransaction

func (t *TxInternalDataAccountCreation) IsLegacyTransaction() bool

func (*TxInternalDataAccountCreation) MakeRPCOutput

func (t *TxInternalDataAccountCreation) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataAccountCreation) MarshalJSON

func (t *TxInternalDataAccountCreation) MarshalJSON() ([]byte, error)

func (*TxInternalDataAccountCreation) SenderTxHash

func (t *TxInternalDataAccountCreation) SenderTxHash() common.Hash

func (*TxInternalDataAccountCreation) SerializeForSign

func (t *TxInternalDataAccountCreation) SerializeForSign() []interface{}

func (*TxInternalDataAccountCreation) SerializeForSignToBytes

func (t *TxInternalDataAccountCreation) SerializeForSignToBytes() []byte

func (*TxInternalDataAccountCreation) SetHash

func (t *TxInternalDataAccountCreation) SetHash(h *common.Hash)

func (*TxInternalDataAccountCreation) SetSignature

func (t *TxInternalDataAccountCreation) SetSignature(s TxSignatures)

func (*TxInternalDataAccountCreation) String

func (*TxInternalDataAccountCreation) Type

func (*TxInternalDataAccountCreation) UnmarshalJSON

func (t *TxInternalDataAccountCreation) UnmarshalJSON(b []byte) error

func (*TxInternalDataAccountCreation) Validate

func (t *TxInternalDataAccountCreation) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataAccountCreation) ValidateMutableValue

func (t *TxInternalDataAccountCreation) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataAccountCreationJSON

type TxInternalDataAccountCreationJSON struct {
	Type          TxType           `json:"typeInt"`
	TypeStr       string           `json:"type"`
	AccountNonce  hexutil.Uint64   `json:"nonce"`
	Price         *hexutil.Big     `json:"gasPrice"`
	GasLimit      hexutil.Uint64   `json:"gas"`
	Recipient     common.Address   `json:"to"`
	Amount        *hexutil.Big     `json:"value"`
	From          common.Address   `json:"from"`
	HumanReadable bool             `json:"humanReadable"`
	Key           hexutil.Bytes    `json:"key"`
	TxSignatures  TxSignaturesJSON `json:"signatures"`
	Hash          *common.Hash     `json:"hash"`
}

type TxInternalDataAccountUpdate

type TxInternalDataAccountUpdate struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address
	Key          accountkey.AccountKey

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`

	TxSignatures
}

TxInternalDataAccountUpdate represents a transaction updating a key of an account.

func (*TxInternalDataAccountUpdate) DecodeRLP

func (t *TxInternalDataAccountUpdate) DecodeRLP(s *rlp.Stream) error

func (*TxInternalDataAccountUpdate) EncodeRLP

func (t *TxInternalDataAccountUpdate) EncodeRLP(w io.Writer) error

func (*TxInternalDataAccountUpdate) Equal

func (*TxInternalDataAccountUpdate) Execute

func (t *TxInternalDataAccountUpdate) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataAccountUpdate) GetAccountNonce

func (t *TxInternalDataAccountUpdate) GetAccountNonce() uint64

func (*TxInternalDataAccountUpdate) GetAmount

func (t *TxInternalDataAccountUpdate) GetAmount() *big.Int

func (*TxInternalDataAccountUpdate) GetFrom

func (*TxInternalDataAccountUpdate) GetGasLimit

func (t *TxInternalDataAccountUpdate) GetGasLimit() uint64

func (*TxInternalDataAccountUpdate) GetHash

func (t *TxInternalDataAccountUpdate) GetHash() *common.Hash

func (*TxInternalDataAccountUpdate) GetPrice

func (t *TxInternalDataAccountUpdate) GetPrice() *big.Int

func (*TxInternalDataAccountUpdate) GetRecipient

func (t *TxInternalDataAccountUpdate) GetRecipient() *common.Address

func (*TxInternalDataAccountUpdate) GetRoleTypeForValidation

func (t *TxInternalDataAccountUpdate) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataAccountUpdate) IntrinsicGas

func (t *TxInternalDataAccountUpdate) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataAccountUpdate) IsLegacyTransaction

func (t *TxInternalDataAccountUpdate) IsLegacyTransaction() bool

func (*TxInternalDataAccountUpdate) MakeRPCOutput

func (t *TxInternalDataAccountUpdate) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataAccountUpdate) MarshalJSON

func (t *TxInternalDataAccountUpdate) MarshalJSON() ([]byte, error)

func (*TxInternalDataAccountUpdate) SenderTxHash

func (t *TxInternalDataAccountUpdate) SenderTxHash() common.Hash

func (*TxInternalDataAccountUpdate) SerializeForSign

func (t *TxInternalDataAccountUpdate) SerializeForSign() []interface{}

func (*TxInternalDataAccountUpdate) SerializeForSignToBytes

func (t *TxInternalDataAccountUpdate) SerializeForSignToBytes() []byte

func (*TxInternalDataAccountUpdate) SetHash

func (t *TxInternalDataAccountUpdate) SetHash(h *common.Hash)

func (*TxInternalDataAccountUpdate) SetSignature

func (t *TxInternalDataAccountUpdate) SetSignature(s TxSignatures)

func (*TxInternalDataAccountUpdate) String

func (t *TxInternalDataAccountUpdate) String() string

func (*TxInternalDataAccountUpdate) Type

func (*TxInternalDataAccountUpdate) UnmarshalJSON

func (t *TxInternalDataAccountUpdate) UnmarshalJSON(b []byte) error

func (*TxInternalDataAccountUpdate) Validate

func (t *TxInternalDataAccountUpdate) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataAccountUpdate) ValidateMutableValue

func (t *TxInternalDataAccountUpdate) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataAccountUpdateJSON

type TxInternalDataAccountUpdateJSON struct {
	Type         TxType           `json:"typeInt"`
	TypeStr      string           `json:"type"`
	AccountNonce hexutil.Uint64   `json:"nonce"`
	Price        *hexutil.Big     `json:"gasPrice"`
	GasLimit     hexutil.Uint64   `json:"gas"`
	From         common.Address   `json:"from"`
	Key          hexutil.Bytes    `json:"key"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataBaseFee added in v1.8.0

type TxInternalDataBaseFee interface {
	GetGasTipCap() *big.Int
	GetGasFeeCap() *big.Int
}

TxInternalDataBaseFee has a function related to EIP-1559 Ethereum typed transaction.

type TxInternalDataCancel

type TxInternalDataCancel struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`

	TxSignatures
}

TxInternalDataCancel is a transaction that cancels a transaction previously submitted into txpool by replacement. Since Klaytn defines fixed gas price for all transactions, a transaction cannot be replaced with another transaction with higher gas price. To provide tx replacement, TxInternalDataCancel is introduced. To replace a previously added tx, send a TxInternalCancel transaction with the same nonce.

func (*TxInternalDataCancel) Equal

func (*TxInternalDataCancel) Execute

func (t *TxInternalDataCancel) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataCancel) GetAccountNonce

func (t *TxInternalDataCancel) GetAccountNonce() uint64

func (*TxInternalDataCancel) GetAmount

func (t *TxInternalDataCancel) GetAmount() *big.Int

func (*TxInternalDataCancel) GetFrom

func (t *TxInternalDataCancel) GetFrom() common.Address

func (*TxInternalDataCancel) GetGasLimit

func (t *TxInternalDataCancel) GetGasLimit() uint64

func (*TxInternalDataCancel) GetHash

func (t *TxInternalDataCancel) GetHash() *common.Hash

func (*TxInternalDataCancel) GetPrice

func (t *TxInternalDataCancel) GetPrice() *big.Int

func (*TxInternalDataCancel) GetRecipient

func (t *TxInternalDataCancel) GetRecipient() *common.Address

func (*TxInternalDataCancel) GetRoleTypeForValidation

func (t *TxInternalDataCancel) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataCancel) IntrinsicGas

func (t *TxInternalDataCancel) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataCancel) IsLegacyTransaction

func (t *TxInternalDataCancel) IsLegacyTransaction() bool

func (*TxInternalDataCancel) MakeRPCOutput

func (t *TxInternalDataCancel) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataCancel) MarshalJSON

func (t *TxInternalDataCancel) MarshalJSON() ([]byte, error)

func (*TxInternalDataCancel) SenderTxHash

func (t *TxInternalDataCancel) SenderTxHash() common.Hash

func (*TxInternalDataCancel) SerializeForSign

func (t *TxInternalDataCancel) SerializeForSign() []interface{}

func (*TxInternalDataCancel) SerializeForSignToBytes

func (t *TxInternalDataCancel) SerializeForSignToBytes() []byte

func (*TxInternalDataCancel) SetHash

func (t *TxInternalDataCancel) SetHash(h *common.Hash)

func (*TxInternalDataCancel) SetSignature

func (t *TxInternalDataCancel) SetSignature(s TxSignatures)

func (*TxInternalDataCancel) String

func (t *TxInternalDataCancel) String() string

func (*TxInternalDataCancel) Type

func (t *TxInternalDataCancel) Type() TxType

func (*TxInternalDataCancel) UnmarshalJSON

func (t *TxInternalDataCancel) UnmarshalJSON(b []byte) error

func (*TxInternalDataCancel) Validate

func (t *TxInternalDataCancel) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataCancel) ValidateMutableValue

func (t *TxInternalDataCancel) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataCancelJSON

type TxInternalDataCancelJSON struct {
	Type         TxType           `json:"typeInt"`
	TypeStr      string           `json:"type"`
	AccountNonce hexutil.Uint64   `json:"nonce"`
	Price        *hexutil.Big     `json:"gasPrice"`
	GasLimit     hexutil.Uint64   `json:"gas"`
	From         common.Address   `json:"from"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataChainDataAnchoring

type TxInternalDataChainDataAnchoring struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address
	Payload      []byte

	TxSignatures

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataChainDataAnchoring represents the transaction anchoring child chain data.

func (*TxInternalDataChainDataAnchoring) Equal

func (*TxInternalDataChainDataAnchoring) Execute

func (t *TxInternalDataChainDataAnchoring) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataChainDataAnchoring) GetAccountNonce

func (t *TxInternalDataChainDataAnchoring) GetAccountNonce() uint64

func (*TxInternalDataChainDataAnchoring) GetAmount

func (t *TxInternalDataChainDataAnchoring) GetAmount() *big.Int

func (*TxInternalDataChainDataAnchoring) GetFrom

func (*TxInternalDataChainDataAnchoring) GetGasLimit

func (t *TxInternalDataChainDataAnchoring) GetGasLimit() uint64

func (*TxInternalDataChainDataAnchoring) GetHash

func (*TxInternalDataChainDataAnchoring) GetPayload

func (t *TxInternalDataChainDataAnchoring) GetPayload() []byte

func (*TxInternalDataChainDataAnchoring) GetPrice

func (t *TxInternalDataChainDataAnchoring) GetPrice() *big.Int

func (*TxInternalDataChainDataAnchoring) GetRecipient

func (t *TxInternalDataChainDataAnchoring) GetRecipient() *common.Address

func (*TxInternalDataChainDataAnchoring) GetRoleTypeForValidation

func (t *TxInternalDataChainDataAnchoring) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataChainDataAnchoring) IntrinsicGas

func (t *TxInternalDataChainDataAnchoring) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataChainDataAnchoring) IsLegacyTransaction

func (t *TxInternalDataChainDataAnchoring) IsLegacyTransaction() bool

func (*TxInternalDataChainDataAnchoring) MakeRPCOutput

func (t *TxInternalDataChainDataAnchoring) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataChainDataAnchoring) MarshalJSON

func (t *TxInternalDataChainDataAnchoring) MarshalJSON() ([]byte, error)

func (*TxInternalDataChainDataAnchoring) SenderTxHash

func (t *TxInternalDataChainDataAnchoring) SenderTxHash() common.Hash

func (*TxInternalDataChainDataAnchoring) SerializeForSign

func (t *TxInternalDataChainDataAnchoring) SerializeForSign() []interface{}

func (*TxInternalDataChainDataAnchoring) SerializeForSignToBytes

func (t *TxInternalDataChainDataAnchoring) SerializeForSignToBytes() []byte

func (*TxInternalDataChainDataAnchoring) SetHash

func (*TxInternalDataChainDataAnchoring) SetSignature

func (*TxInternalDataChainDataAnchoring) String

func (*TxInternalDataChainDataAnchoring) Type

func (*TxInternalDataChainDataAnchoring) UnmarshalJSON

func (t *TxInternalDataChainDataAnchoring) UnmarshalJSON(b []byte) error

func (*TxInternalDataChainDataAnchoring) Validate

func (t *TxInternalDataChainDataAnchoring) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataChainDataAnchoring) ValidateMutableValue

func (t *TxInternalDataChainDataAnchoring) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataChainDataAnchoringJSON

type TxInternalDataChainDataAnchoringJSON struct {
	Type         TxType           `json:"typeInt"`
	TypeStr      string           `json:"type"`
	AccountNonce hexutil.Uint64   `json:"nonce"`
	Price        *hexutil.Big     `json:"gasPrice"`
	GasLimit     hexutil.Uint64   `json:"gas"`
	From         common.Address   `json:"from"`
	Payload      hexutil.Bytes    `json:"input"`
	InputJson    interface{}      `json:"inputJSON"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataContractAddressFiller

type TxInternalDataContractAddressFiller interface {
	// FillContractAddress fills contract address to receipt. This only works for types deploying a smart contract.
	FillContractAddress(from common.Address, r *Receipt)
}

type TxInternalDataEthTyped added in v1.8.0

type TxInternalDataEthTyped interface {
	GetAccessList() AccessList
	TxHash() common.Hash
	// contains filtered or unexported methods
}

TxInternalDataEthTyped has a function related to EIP-2718 Ethereum typed transaction. For supporting new typed transaction defined EIP-2718, We provide an interface `TxInternalDataEthTyped `

type TxInternalDataEthereumAccessList added in v1.8.0

type TxInternalDataEthereumAccessList struct {
	ChainID      *big.Int
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    *common.Address `rlp:"nil"` // nil means contract creation.
	Amount       *big.Int
	Payload      []byte
	AccessList   AccessList

	// Signature values
	V *big.Int
	R *big.Int
	S *big.Int

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataEthereumAccessList is the data of EIP-2930 access list transactions.

func (*TxInternalDataEthereumAccessList) ChainId added in v1.8.0

func (*TxInternalDataEthereumAccessList) Equal added in v1.8.0

func (*TxInternalDataEthereumAccessList) Execute added in v1.8.0

func (t *TxInternalDataEthereumAccessList) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataEthereumAccessList) FillContractAddress added in v1.8.0

func (t *TxInternalDataEthereumAccessList) FillContractAddress(from common.Address, r *Receipt)

func (*TxInternalDataEthereumAccessList) GetAccessList added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetAccessList() AccessList

func (*TxInternalDataEthereumAccessList) GetAccountNonce added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetAccountNonce() uint64

func (*TxInternalDataEthereumAccessList) GetAmount added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetAmount() *big.Int

func (*TxInternalDataEthereumAccessList) GetGasLimit added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetGasLimit() uint64

func (*TxInternalDataEthereumAccessList) GetHash added in v1.8.0

func (*TxInternalDataEthereumAccessList) GetPayload added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetPayload() []byte

func (*TxInternalDataEthereumAccessList) GetPrice added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetPrice() *big.Int

func (*TxInternalDataEthereumAccessList) GetRecipient added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetRecipient() *common.Address

func (*TxInternalDataEthereumAccessList) GetRoleTypeForValidation added in v1.8.0

func (t *TxInternalDataEthereumAccessList) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataEthereumAccessList) IntrinsicGas added in v1.8.0

func (t *TxInternalDataEthereumAccessList) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataEthereumAccessList) IsLegacyTransaction added in v1.8.0

func (t *TxInternalDataEthereumAccessList) IsLegacyTransaction() bool

func (*TxInternalDataEthereumAccessList) MakeRPCOutput added in v1.8.0

func (t *TxInternalDataEthereumAccessList) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataEthereumAccessList) MarshalJSON added in v1.8.0

func (t *TxInternalDataEthereumAccessList) MarshalJSON() ([]byte, error)

func (*TxInternalDataEthereumAccessList) RawSignatureValues added in v1.8.0

func (t *TxInternalDataEthereumAccessList) RawSignatureValues() TxSignatures

func (*TxInternalDataEthereumAccessList) RecoverAddress added in v1.8.0

func (t *TxInternalDataEthereumAccessList) RecoverAddress(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) (common.Address, error)

func (*TxInternalDataEthereumAccessList) RecoverPubkey added in v1.8.0

func (t *TxInternalDataEthereumAccessList) RecoverPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

func (*TxInternalDataEthereumAccessList) SenderTxHash added in v1.8.0

func (t *TxInternalDataEthereumAccessList) SenderTxHash() common.Hash

func (*TxInternalDataEthereumAccessList) SerializeForSign added in v1.8.0

func (t *TxInternalDataEthereumAccessList) SerializeForSign() []interface{}

func (*TxInternalDataEthereumAccessList) SetHash added in v1.8.0

func (t *TxInternalDataEthereumAccessList) SetHash(hash *common.Hash)

func (*TxInternalDataEthereumAccessList) SetSignature added in v1.8.0

func (t *TxInternalDataEthereumAccessList) SetSignature(signatures TxSignatures)

func (*TxInternalDataEthereumAccessList) String added in v1.8.0

func (*TxInternalDataEthereumAccessList) TxHash added in v1.8.0

func (*TxInternalDataEthereumAccessList) Type added in v1.8.0

func (*TxInternalDataEthereumAccessList) UnmarshalJSON added in v1.8.0

func (t *TxInternalDataEthereumAccessList) UnmarshalJSON(bytes []byte) error

func (*TxInternalDataEthereumAccessList) Validate added in v1.8.0

func (t *TxInternalDataEthereumAccessList) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataEthereumAccessList) ValidateMutableValue added in v1.8.0

func (t *TxInternalDataEthereumAccessList) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataEthereumAccessList) ValidateSignature added in v1.8.0

func (t *TxInternalDataEthereumAccessList) ValidateSignature() bool

type TxInternalDataEthereumAccessListJSON added in v1.8.0

type TxInternalDataEthereumAccessListJSON struct {
	Type         TxType           `json:"typeInt"`
	TypeStr      string           `json:"type"`
	ChainID      *hexutil.Big     `json:"chainId"`
	AccountNonce hexutil.Uint64   `json:"nonce"`
	Price        *hexutil.Big     `json:"gasPrice"`
	GasLimit     hexutil.Uint64   `json:"gas"`
	Recipient    *common.Address  `json:"to"`
	Amount       *hexutil.Big     `json:"value"`
	Payload      hexutil.Bytes    `json:"input"`
	AccessList   AccessList       `json:"accessList"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataEthereumDynamicFee added in v1.8.0

type TxInternalDataEthereumDynamicFee struct {
	ChainID      *big.Int
	AccountNonce uint64
	GasTipCap    *big.Int // a.k.a. maxPriorityFeePerGas
	GasFeeCap    *big.Int // a.k.a. maxFeePerGas
	GasLimit     uint64
	Recipient    *common.Address `rlp:"nil"` // nil means contract creation
	Amount       *big.Int
	Payload      []byte
	AccessList   AccessList

	// Signature values
	V *big.Int `json:"v" gencodec:"required"`
	R *big.Int `json:"r" gencodec:"required"`
	S *big.Int `json:"s" gencodec:"required"`

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

func (*TxInternalDataEthereumDynamicFee) ChainId added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) Equal added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) Execute added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataEthereumDynamicFee) FillContractAddress added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) FillContractAddress(from common.Address, r *Receipt)

func (*TxInternalDataEthereumDynamicFee) GetAccessList added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetAccessList() AccessList

func (*TxInternalDataEthereumDynamicFee) GetAccountNonce added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetAccountNonce() uint64

func (*TxInternalDataEthereumDynamicFee) GetAmount added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetAmount() *big.Int

func (*TxInternalDataEthereumDynamicFee) GetGasFeeCap added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetGasFeeCap() *big.Int

func (*TxInternalDataEthereumDynamicFee) GetGasLimit added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetGasLimit() uint64

func (*TxInternalDataEthereumDynamicFee) GetGasTipCap added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetGasTipCap() *big.Int

func (*TxInternalDataEthereumDynamicFee) GetHash added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) GetPayload added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetPayload() []byte

func (*TxInternalDataEthereumDynamicFee) GetPrice added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetPrice() *big.Int

func (*TxInternalDataEthereumDynamicFee) GetRecipient added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetRecipient() *common.Address

func (*TxInternalDataEthereumDynamicFee) GetRoleTypeForValidation added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataEthereumDynamicFee) IntrinsicGas added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataEthereumDynamicFee) IsLegacyTransaction added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) IsLegacyTransaction() bool

func (*TxInternalDataEthereumDynamicFee) MakeRPCOutput added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataEthereumDynamicFee) MarshalJSON added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) MarshalJSON() ([]byte, error)

func (*TxInternalDataEthereumDynamicFee) RawSignatureValues added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) RawSignatureValues() TxSignatures

func (*TxInternalDataEthereumDynamicFee) RecoverAddress added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) RecoverAddress(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) (common.Address, error)

func (*TxInternalDataEthereumDynamicFee) RecoverPubkey added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) RecoverPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

func (*TxInternalDataEthereumDynamicFee) SenderTxHash added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) SenderTxHash() common.Hash

func (*TxInternalDataEthereumDynamicFee) SerializeForSign added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) SerializeForSign() []interface{}

func (*TxInternalDataEthereumDynamicFee) SetHash added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) SetHash(hash *common.Hash)

func (*TxInternalDataEthereumDynamicFee) SetSignature added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) SetSignature(signatures TxSignatures)

func (*TxInternalDataEthereumDynamicFee) String added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) TxHash added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) Type added in v1.8.0

func (*TxInternalDataEthereumDynamicFee) UnmarshalJSON added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) UnmarshalJSON(bytes []byte) error

func (*TxInternalDataEthereumDynamicFee) Validate added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataEthereumDynamicFee) ValidateMutableValue added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataEthereumDynamicFee) ValidateSignature added in v1.8.0

func (t *TxInternalDataEthereumDynamicFee) ValidateSignature() bool

type TxInternalDataEthereumDynamicFeeJSON added in v1.8.0

type TxInternalDataEthereumDynamicFeeJSON struct {
	Type                 TxType           `json:"typeInt"`
	TypeStr              string           `json:"type"`
	ChainID              *hexutil.Big     `json:"chainId"`
	AccountNonce         hexutil.Uint64   `json:"nonce"`
	MaxPriorityFeePerGas *hexutil.Big     `json:"maxPriorityFeePerGas"`
	MaxFeePerGas         *hexutil.Big     `json:"maxFeePerGas"`
	GasLimit             hexutil.Uint64   `json:"gas"`
	Recipient            *common.Address  `json:"to"`
	Amount               *hexutil.Big     `json:"value"`
	Payload              hexutil.Bytes    `json:"input"`
	AccessList           AccessList       `json:"accessList"`
	TxSignatures         TxSignaturesJSON `json:"signatures"`
	Hash                 *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedAccountUpdate

type TxInternalDataFeeDelegatedAccountUpdate struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address
	Key          accountkey.AccountKey

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataFeeDelegatedAccountUpdate represents a fee-delegated transaction updating a key of an account.

func (*TxInternalDataFeeDelegatedAccountUpdate) DecodeRLP

func (*TxInternalDataFeeDelegatedAccountUpdate) EncodeRLP

func (*TxInternalDataFeeDelegatedAccountUpdate) Equal

func (*TxInternalDataFeeDelegatedAccountUpdate) Execute

func (t *TxInternalDataFeeDelegatedAccountUpdate) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataFeeDelegatedAccountUpdate) GetAccountNonce

func (t *TxInternalDataFeeDelegatedAccountUpdate) GetAccountNonce() uint64

func (*TxInternalDataFeeDelegatedAccountUpdate) GetAmount

func (*TxInternalDataFeeDelegatedAccountUpdate) GetFeePayer

func (*TxInternalDataFeeDelegatedAccountUpdate) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedAccountUpdate) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedAccountUpdate) GetFrom

func (*TxInternalDataFeeDelegatedAccountUpdate) GetGasLimit

func (*TxInternalDataFeeDelegatedAccountUpdate) GetHash

func (*TxInternalDataFeeDelegatedAccountUpdate) GetPrice

func (*TxInternalDataFeeDelegatedAccountUpdate) GetRecipient

func (*TxInternalDataFeeDelegatedAccountUpdate) GetRoleTypeForValidation

func (t *TxInternalDataFeeDelegatedAccountUpdate) GetRoleTypeForValidation() accountkey.RoleType

func (*TxInternalDataFeeDelegatedAccountUpdate) IntrinsicGas

func (t *TxInternalDataFeeDelegatedAccountUpdate) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataFeeDelegatedAccountUpdate) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedAccountUpdate) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedAccountUpdate) MakeRPCOutput

func (t *TxInternalDataFeeDelegatedAccountUpdate) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataFeeDelegatedAccountUpdate) MarshalJSON

func (t *TxInternalDataFeeDelegatedAccountUpdate) MarshalJSON() ([]byte, error)

func (*TxInternalDataFeeDelegatedAccountUpdate) RecoverFeePayerPubkey

func (t *TxInternalDataFeeDelegatedAccountUpdate) RecoverFeePayerPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

func (*TxInternalDataFeeDelegatedAccountUpdate) SenderTxHash

func (*TxInternalDataFeeDelegatedAccountUpdate) SerializeForSign

func (t *TxInternalDataFeeDelegatedAccountUpdate) SerializeForSign() []interface{}

func (*TxInternalDataFeeDelegatedAccountUpdate) SerializeForSignToBytes

func (t *TxInternalDataFeeDelegatedAccountUpdate) SerializeForSignToBytes() []byte

func (*TxInternalDataFeeDelegatedAccountUpdate) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedAccountUpdate) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedAccountUpdate) SetHash

func (*TxInternalDataFeeDelegatedAccountUpdate) SetSignature

func (*TxInternalDataFeeDelegatedAccountUpdate) String

func (*TxInternalDataFeeDelegatedAccountUpdate) Type

func (*TxInternalDataFeeDelegatedAccountUpdate) UnmarshalJSON

func (t *TxInternalDataFeeDelegatedAccountUpdate) UnmarshalJSON(b []byte) error

func (*TxInternalDataFeeDelegatedAccountUpdate) Validate

func (t *TxInternalDataFeeDelegatedAccountUpdate) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataFeeDelegatedAccountUpdate) ValidateMutableValue

func (t *TxInternalDataFeeDelegatedAccountUpdate) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataFeeDelegatedAccountUpdateJSON

type TxInternalDataFeeDelegatedAccountUpdateJSON struct {
	Type               TxType           `json:"typeInt"`
	TypeStr            string           `json:"type"`
	AccountNonce       hexutil.Uint64   `json:"nonce"`
	Price              *hexutil.Big     `json:"gasPrice"`
	GasLimit           hexutil.Uint64   `json:"gas"`
	From               common.Address   `json:"from"`
	Key                hexutil.Bytes    `json:"key"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedAccountUpdateWithRatio

type TxInternalDataFeeDelegatedAccountUpdateWithRatio struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address
	Key          accountkey.AccountKey
	FeeRatio     FeeRatio

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataFeeDelegatedAccountUpdateWithRatio represents a fee-delegated transaction updating a key of an account with a specified fee ratio between the sender and the fee payer. The ratio is a fee payer's ratio in percentage. For example, if it is 20, 20% of tx fee will be paid by the fee payer. 80% of tx fee will be paid by the sender.

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) DecodeRLP

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) EncodeRLP

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) Equal

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) Execute

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) Execute(sender ContractRef, vm VM, stateDB StateDB, currentBlockNumber uint64, gas uint64, value *big.Int) (ret []byte, usedGas uint64, err error)

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetHash

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) IntrinsicGas

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) IntrinsicGas(currentBlockNumber uint64) (uint64, error)

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) MakeRPCOutput

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) MakeRPCOutput() map[string]interface{}

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) RecoverFeePayerPubkey

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) RecoverFeePayerPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SerializeForSign

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) SerializeForSign() []interface{}

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SerializeForSignToBytes

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) SerializeForSignToBytes() []byte

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SetHash

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) String

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) Type

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) Validate

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) Validate(stateDB StateDB, currentBlockNumber uint64) error

func (*TxInternalDataFeeDelegatedAccountUpdateWithRatio) ValidateMutableValue

func (t *TxInternalDataFeeDelegatedAccountUpdateWithRatio) ValidateMutableValue(stateDB StateDB, currentBlockNumber uint64) error

type TxInternalDataFeeDelegatedAccountUpdateWithRatioJSON

type TxInternalDataFeeDelegatedAccountUpdateWithRatioJSON struct {
	Type               TxType           `json:"typeInt"`
	TypeStr            string           `json:"type"`
	AccountNonce       hexutil.Uint64   `json:"nonce"`
	Price              *hexutil.Big     `json:"gasPrice"`
	GasLimit           hexutil.Uint64   `json:"gas"`
	From               common.Address   `json:"from"`
	Key                hexutil.Bytes    `json:"key"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedCancel

type TxInternalDataFeeDelegatedCancel struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	From         common.Address

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

	// This is only used when marshaling to JSON.
	Hash *common.Hash `json:"hash" rlp:"-"`
}

TxInternalDataFeeDelegatedCancel is a fee-delegated transaction that cancels a transaction previously submitted into txpool by replacement. Since Klaytn defines fixed gas price for all transactions, a transaction cannot be replaced with another transaction with higher gas price. To provide tx replacement, TxInternalDataFeeDelegatedCancel is introduced. To replace a previously added tx, send a TxInternalFeeDelegatedCancel transaction with the same nonce.

func (*TxInternalDataFeeDelegatedCancel) Equal