types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package types contains data types related to Klatyn consensus.

Index

Constants

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 SubTxTypeBits uint = 3

Variables

View Source
var (
	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 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 DeriveSha

func DeriveSha(list DerivableList) common.Hash

func InitDeriveSha

func InitDeriveSha(i IDeriveSha)

func IntrinsicGas

func IntrinsicGas(data []byte, contractCreation, homestead bool) (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 a legacy 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 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 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) DeprecatedTd

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

DeprecatedTd is an old relic for extracting the TD of a block. It is in the code solely to facilitate upgrading the database from the old format to the new, after which it should be deleted. Do not use!

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 ChainHashes

type ChainHashes struct {
	BlockHash     common.Hash
	TxHash        common.Hash
	ParentHash    common.Hash
	ReceiptHash   common.Hash
	StateRootHash common.Hash
	BlockNumber   *big.Int
}

func NewChainHashes

func NewChainHashes(block *Block) *ChainHashes

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) 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(sig []byte) (R, S, V *big.Int, err error)

WithSignature 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 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"`
}

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) 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) 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 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(sig []byte) (r, s, v *big.Int, err error)
	// Hash returns the hash to be signed.
	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 MakeSigner

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

TODO-Klaytn-RemoveLater Remove the second parameter blockNumber MakeSigner returns a Signer based on the given chain config and block number.

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)
	CreateSmartContractAccountWithKey(addr common.Address, humanReadable bool, key accountkey.AccountKey, format params.CodeFormat)
	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 StorageBlock

type StorageBlock Block

[deprecated by klay/63] StorageBlock defines the RLP encoding of a Block stored in the state database. The StorageBlock encoding contains fields that would otherwise need to be recomputed.

func (*StorageBlock) DecodeRLP

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

[deprecated by klay/63]

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{}) (*Transaction, error)

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 (*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) 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) GasPrice

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

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) 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) MarshalJSON

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

MarshalJSON encodes the web3 RPC transaction format.

func (*Transaction) Nonce

func (tx *Transaction) Nonce() uint64

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) 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) 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) 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 TransactionsByPriceAndNonce

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

TransactionsByPriceAndNonce 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 NewTransactionsByPriceAndNonce

func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce

NewTransactionsByPriceAndNonce creates a transaction set that can retrieve price 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 (*TransactionsByPriceAndNonce) Count

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

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

func (*TransactionsByPriceAndNonce) Peek

Peek returns the next transaction by price.

func (*TransactionsByPriceAndNonce) Pop

func (t *TransactionsByPriceAndNonce) 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 (*TransactionsByPriceAndNonce) Shift

func (t *TransactionsByPriceAndNonce) Shift()

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

func (*TransactionsByPriceAndNonce) Txs

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 TxByPrice

type TxByPrice Transactions

TxByPrice 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 (TxByPrice) Len

func (s TxByPrice) Len() int

func (TxByPrice) Less

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

func (*TxByPrice) Pop

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

func (*TxByPrice) Push

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

func (TxByPrice) Swap

func (s TxByPrice) 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 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"`
	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 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

func (*TxInternalDataFeeDelegatedCancel) Execute

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

func (*TxInternalDataFeeDelegatedCancel) GetAccountNonce

func (t *TxInternalDataFeeDelegatedCancel) GetAccountNonce() uint64

func (*TxInternalDataFeeDelegatedCancel) GetAmount

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

func (*TxInternalDataFeeDelegatedCancel) GetFeePayer

func (*TxInternalDataFeeDelegatedCancel) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedCancel) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedCancel) GetFrom

func (*TxInternalDataFeeDelegatedCancel) GetGasLimit

func (t *TxInternalDataFeeDelegatedCancel) GetGasLimit() uint64

func (*TxInternalDataFeeDelegatedCancel) GetHash

func (*TxInternalDataFeeDelegatedCancel) GetPrice

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

func (*TxInternalDataFeeDelegatedCancel) GetRecipient

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

func (*TxInternalDataFeeDelegatedCancel) GetRoleTypeForValidation

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

func (*TxInternalDataFeeDelegatedCancel) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedCancel) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedCancel) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedCancel) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedCancel) MarshalJSON

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

func (*TxInternalDataFeeDelegatedCancel) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedCancel) SenderTxHash

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

func (*TxInternalDataFeeDelegatedCancel) SerializeForSign

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

func (*TxInternalDataFeeDelegatedCancel) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedCancel) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedCancel) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedCancel) SetHash

func (*TxInternalDataFeeDelegatedCancel) SetSignature

func (*TxInternalDataFeeDelegatedCancel) String

func (*TxInternalDataFeeDelegatedCancel) Type

func (*TxInternalDataFeeDelegatedCancel) UnmarshalJSON

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

func (*TxInternalDataFeeDelegatedCancel) Validate

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

func (*TxInternalDataFeeDelegatedCancel) ValidateMutableValue

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

type TxInternalDataFeeDelegatedCancelJSON

type TxInternalDataFeeDelegatedCancelJSON 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"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedCancelWithRatio

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

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedCancelWithRatio 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, TxInternalDataFeeDelegatedCancelWithRatio is introduced. To replace a previously added tx, send a TxInternalFeeDelegatedCancelWithRatio transaction with the same nonce. TxInternalDataFeeDelegatedCancelWithRatio has 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 (*TxInternalDataFeeDelegatedCancelWithRatio) Equal

func (*TxInternalDataFeeDelegatedCancelWithRatio) Execute

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedCancelWithRatio) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetHash

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedCancelWithRatio) GetRoleTypeForValidation

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedCancelWithRatio) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedCancelWithRatio) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedCancelWithRatio) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedCancelWithRatio) SerializeForSign

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedCancelWithRatio) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedCancelWithRatio) SetHash

func (*TxInternalDataFeeDelegatedCancelWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedCancelWithRatio) String

func (*TxInternalDataFeeDelegatedCancelWithRatio) Type

func (*TxInternalDataFeeDelegatedCancelWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedCancelWithRatio) Validate

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

func (*TxInternalDataFeeDelegatedCancelWithRatio) ValidateMutableValue

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

type TxInternalDataFeeDelegatedCancelWithRatioJSON

type TxInternalDataFeeDelegatedCancelWithRatioJSON 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"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedSmartContractDeploy

type TxInternalDataFeeDelegatedSmartContractDeploy struct {
	AccountNonce  uint64
	Price         *big.Int
	GasLimit      uint64
	Recipient     *common.Address `rlp:"nil"`
	Amount        *big.Int
	From          common.Address
	Payload       []byte
	HumanReadable bool
	CodeFormat    params.CodeFormat

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedSmartContractDeploy represents a fee-delegated transaction creating a smart contract.

func (*TxInternalDataFeeDelegatedSmartContractDeploy) Equal

func (*TxInternalDataFeeDelegatedSmartContractDeploy) Execute

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) FillContractAddress

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetAccountNonce

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetAmount

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetCodeFormat

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetFeePayer

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedSmartContractDeploy) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetFrom

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetGasLimit

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetHash

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetPayload

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetPrice

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetRecipient

func (*TxInternalDataFeeDelegatedSmartContractDeploy) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedSmartContractDeploy) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedSmartContractDeploy) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedSmartContractDeploy) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) MarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractDeploy) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SenderTxHash

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SerializeForSign

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedSmartContractDeploy) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SetHash

func (*TxInternalDataFeeDelegatedSmartContractDeploy) SetSignature

func (*TxInternalDataFeeDelegatedSmartContractDeploy) String

func (*TxInternalDataFeeDelegatedSmartContractDeploy) Type

func (*TxInternalDataFeeDelegatedSmartContractDeploy) UnmarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractDeploy) Validate

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

func (*TxInternalDataFeeDelegatedSmartContractDeploy) ValidateMutableValue

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

type TxInternalDataFeeDelegatedSmartContractDeployJSON

type TxInternalDataFeeDelegatedSmartContractDeployJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	HumanReadable      bool             `json:"humanReadable"`
	CodeFormat         hexutil.Uint     `json:"codeFormat"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedSmartContractDeployWithRatio

type TxInternalDataFeeDelegatedSmartContractDeployWithRatio struct {
	AccountNonce  uint64
	Price         *big.Int
	GasLimit      uint64
	Recipient     *common.Address `rlp:"nil"`
	Amount        *big.Int
	From          common.Address
	Payload       []byte
	HumanReadable bool
	FeeRatio      FeeRatio
	CodeFormat    params.CodeFormat

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedSmartContractDeployWithRatio represents a fee-delegated transaction creating a smart contract 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 (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) Equal

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) Execute

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) FillContractAddress

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetCodeFormat

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetHash

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetPayload

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) IsLegacyTransaction

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SerializeForSign

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SetHash

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) String

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) Type

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) Validate

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

func (*TxInternalDataFeeDelegatedSmartContractDeployWithRatio) ValidateMutableValue

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

type TxInternalDataFeeDelegatedSmartContractDeployWithRatioJSON

type TxInternalDataFeeDelegatedSmartContractDeployWithRatioJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	HumanReadable      bool             `json:"humanReadable"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	CodeFormat         hexutil.Uint     `json:"codeFormat"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedSmartContractExecution

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

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedSmartContractExecution represents a fee-delegated transaction executing a smart contract.

func (*TxInternalDataFeeDelegatedSmartContractExecution) Equal

func (*TxInternalDataFeeDelegatedSmartContractExecution) Execute

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetAccountNonce

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetAmount

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetFeePayer

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedSmartContractExecution) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetFrom

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetGasLimit

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetHash

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetPayload

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetPrice

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetRecipient

func (*TxInternalDataFeeDelegatedSmartContractExecution) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedSmartContractExecution) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedSmartContractExecution) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedSmartContractExecution) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) MarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractExecution) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) SenderTxHash

func (*TxInternalDataFeeDelegatedSmartContractExecution) SerializeForSign

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedSmartContractExecution) SetHash

func (*TxInternalDataFeeDelegatedSmartContractExecution) SetSignature

func (*TxInternalDataFeeDelegatedSmartContractExecution) String

func (*TxInternalDataFeeDelegatedSmartContractExecution) Type

func (*TxInternalDataFeeDelegatedSmartContractExecution) UnmarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractExecution) Validate

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

func (*TxInternalDataFeeDelegatedSmartContractExecution) ValidateMutableValue

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

type TxInternalDataFeeDelegatedSmartContractExecutionJSON

type TxInternalDataFeeDelegatedSmartContractExecutionJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedSmartContractExecutionWithRatio

type TxInternalDataFeeDelegatedSmartContractExecutionWithRatio struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    common.Address
	Amount       *big.Int
	From         common.Address
	Payload      []byte
	FeeRatio     FeeRatio

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedSmartContractExecutionWithRatio represents a fee-delegated transaction executing a smart contract 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 (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) Equal

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) Execute

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetFeePayerRawSignatureValues

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetHash

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetPayload

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) IsLegacyTransaction

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SerializeForSign

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SetHash

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) String

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) Type

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) Validate

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

func (*TxInternalDataFeeDelegatedSmartContractExecutionWithRatio) ValidateMutableValue

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

type TxInternalDataFeeDelegatedSmartContractExecutionWithRatioJSON

type TxInternalDataFeeDelegatedSmartContractExecutionWithRatioJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedValueTransfer

type TxInternalDataFeeDelegatedValueTransfer struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    common.Address
	Amount       *big.Int
	From         common.Address

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedValueTransfer represents a fee-delegated transaction transferring KLAY with a fee payer. FeePayer should be RLP-encoded after the signature of the sender.

func (*TxInternalDataFeeDelegatedValueTransfer) Equal

func (*TxInternalDataFeeDelegatedValueTransfer) Execute

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

func (*TxInternalDataFeeDelegatedValueTransfer) GetAccountNonce

func (t *TxInternalDataFeeDelegatedValueTransfer) GetAccountNonce() uint64

func (*TxInternalDataFeeDelegatedValueTransfer) GetAmount

func (*TxInternalDataFeeDelegatedValueTransfer) GetFeePayer

func (*TxInternalDataFeeDelegatedValueTransfer) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedValueTransfer) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedValueTransfer) GetFrom

func (*TxInternalDataFeeDelegatedValueTransfer) GetGasLimit

func (*TxInternalDataFeeDelegatedValueTransfer) GetHash

func (*TxInternalDataFeeDelegatedValueTransfer) GetPrice

func (*TxInternalDataFeeDelegatedValueTransfer) GetRecipient

func (*TxInternalDataFeeDelegatedValueTransfer) GetRoleTypeForValidation

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

func (*TxInternalDataFeeDelegatedValueTransfer) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedValueTransfer) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedValueTransfer) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedValueTransfer) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedValueTransfer) MarshalJSON

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

func (*TxInternalDataFeeDelegatedValueTransfer) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedValueTransfer) SenderTxHash

func (*TxInternalDataFeeDelegatedValueTransfer) SerializeForSign

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

func (*TxInternalDataFeeDelegatedValueTransfer) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedValueTransfer) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedValueTransfer) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedValueTransfer) SetHash

func (*TxInternalDataFeeDelegatedValueTransfer) SetSignature

func (*TxInternalDataFeeDelegatedValueTransfer) String

func (*TxInternalDataFeeDelegatedValueTransfer) Type

func (*TxInternalDataFeeDelegatedValueTransfer) UnmarshalJSON

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

func (*TxInternalDataFeeDelegatedValueTransfer) Validate

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

func (*TxInternalDataFeeDelegatedValueTransfer) ValidateMutableValue

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

type TxInternalDataFeeDelegatedValueTransferJSON

type TxInternalDataFeeDelegatedValueTransferJSON 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"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedValueTransferMemo

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

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedValueTransferMemo represents a fee-delegated transaction transferring KLAY.

func (*TxInternalDataFeeDelegatedValueTransferMemo) Equal

func (*TxInternalDataFeeDelegatedValueTransferMemo) Execute

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetAccountNonce

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetAmount

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetFeePayer

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedValueTransferMemo) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetFrom

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetGasLimit

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetHash

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetPayload

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetPrice

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetRecipient

func (*TxInternalDataFeeDelegatedValueTransferMemo) GetRoleTypeForValidation

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedValueTransferMemo) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedValueTransferMemo) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) MarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferMemo) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) SenderTxHash

func (*TxInternalDataFeeDelegatedValueTransferMemo) SerializeForSign

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) SetFeePayerSignatures

func (t *TxInternalDataFeeDelegatedValueTransferMemo) SetFeePayerSignatures(s TxSignatures)

func (*TxInternalDataFeeDelegatedValueTransferMemo) SetHash

func (*TxInternalDataFeeDelegatedValueTransferMemo) SetSignature

func (*TxInternalDataFeeDelegatedValueTransferMemo) String

func (*TxInternalDataFeeDelegatedValueTransferMemo) Type

func (*TxInternalDataFeeDelegatedValueTransferMemo) UnmarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferMemo) Validate

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

func (*TxInternalDataFeeDelegatedValueTransferMemo) ValidateMutableValue

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

type TxInternalDataFeeDelegatedValueTransferMemoJSON

type TxInternalDataFeeDelegatedValueTransferMemoJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedValueTransferMemoWithRatio

type TxInternalDataFeeDelegatedValueTransferMemoWithRatio struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    common.Address
	Amount       *big.Int
	From         common.Address
	Payload      []byte
	FeeRatio     FeeRatio

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedValueTransferMemoWithRatio represents a fee-delegated transaction transferring KLAY 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 (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) Equal

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) Execute

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetHash

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetPayload

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) IsLegacyTransaction

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SerializeForSign

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SetHash

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) String

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) Type

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) Validate

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

func (*TxInternalDataFeeDelegatedValueTransferMemoWithRatio) ValidateMutableValue

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

type TxInternalDataFeeDelegatedValueTransferMemoWithRatioJSON

type TxInternalDataFeeDelegatedValueTransferMemoWithRatioJSON 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"`
	Payload            hexutil.Bytes    `json:"input"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeeDelegatedValueTransferWithRatio

type TxInternalDataFeeDelegatedValueTransferWithRatio struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    common.Address
	Amount       *big.Int
	From         common.Address
	FeeRatio     FeeRatio

	TxSignatures

	FeePayer           common.Address
	FeePayerSignatures TxSignatures

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

TxInternalDataFeeDelegatedValueTransferWithRatio represents a fee-delegated value transfer transaction 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 NewTxInternalDataFeeDelegatedValueTransferWithRatio

func NewTxInternalDataFeeDelegatedValueTransferWithRatio() *TxInternalDataFeeDelegatedValueTransferWithRatio

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) Equal

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) Execute

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetAccountNonce

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetAmount

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetFeePayer

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetFeePayerRawSignatureValues

func (t *TxInternalDataFeeDelegatedValueTransferWithRatio) GetFeePayerRawSignatureValues() TxSignatures

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetFeeRatio

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetFrom

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetGasLimit

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetHash

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetPrice

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetRecipient

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) GetRoleTypeForValidation

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) IntrinsicGas

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) IsLegacyTransaction

func (t *TxInternalDataFeeDelegatedValueTransferWithRatio) IsLegacyTransaction() bool

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) MakeRPCOutput

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) MarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) RecoverFeePayerPubkey

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SenderTxHash

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SerializeForSign

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SerializeForSignToBytes

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SetFeePayerSignatures

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SetHash

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) SetSignature

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) String

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) Type

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) UnmarshalJSON

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) Validate

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

func (*TxInternalDataFeeDelegatedValueTransferWithRatio) ValidateMutableValue

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

type TxInternalDataFeeDelegatedValueTransferWithRatioJSON

type TxInternalDataFeeDelegatedValueTransferWithRatioJSON 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"`
	FeeRatio           hexutil.Uint     `json:"feeRatio"`
	TxSignatures       TxSignaturesJSON `json:"signatures"`
	FeePayer           common.Address   `json:"feePayer"`
	FeePayerSignatures TxSignaturesJSON `json:"feePayerSignatures"`
	Hash               *common.Hash     `json:"hash"`
}

type TxInternalDataFeePayer

type TxInternalDataFeePayer interface {
	GetFeePayer() common.Address

	// GetFeePayerRawSignatureValues returns fee payer's 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}].
	GetFeePayerRawSignatureValues() TxSignatures

	// RecoverFeePayerPubkey returns the fee payer's public key derived from txhash and signatures(r, s, v).
	RecoverFeePayerPubkey(txhash common.Hash, homestead bool, vfunc func(*big.Int) *big.Int) ([]*ecdsa.PublicKey, error)

	SetFeePayerSignatures(s TxSignatures)
}

TxInternalDataFeePayer has functions related to fee delegated transactions.

type TxInternalDataFeeRatio

type TxInternalDataFeeRatio interface {
	// GetFeeRatio returns a ratio of tx fee paid by the fee payer in percentage.
	// For example, if it is 30, 30% of tx fee will be paid by the fee payer.
	// 70% will be paid by the sender.
	GetFeeRatio() FeeRatio
}

TxInternalDataFeeRatio has a function `GetFeeRatio`.

type TxInternalDataFrom

type TxInternalDataFrom interface {
	GetFrom() common.Address
}

TxInternalDataFrom has a function `GetFrom()`. All other transactions to be implemented will have `from` field, but `TxInternalDataLegacy` (a legacy transaction type) does not have the field. Hence, this function is defined in another interface TxInternalDataFrom.

type TxInternalDataLegacy

type TxInternalDataLegacy struct {
	AccountNonce uint64          `json:"nonce"    gencodec:"required"`
	Price        *big.Int        `json:"gasPrice" gencodec:"required"`
	GasLimit     uint64          `json:"gas"      gencodec:"required"`
	Recipient    *common.Address `json:"to"       rlp:"nil"` // nil means contract creation
	Amount       *big.Int        `json:"value"    gencodec:"required"`
	Payload      []byte          `json:"input"    gencodec:"required"`

	// 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 (*TxInternalDataLegacy) ChainId

func (t *TxInternalDataLegacy) ChainId() *big.Int

func (*TxInternalDataLegacy) Equal

func (*TxInternalDataLegacy) Execute

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

func (*TxInternalDataLegacy) FillContractAddress

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

func (*TxInternalDataLegacy) GetAccountNonce

func (t *TxInternalDataLegacy) GetAccountNonce() uint64

func (*TxInternalDataLegacy) GetAmount

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

func (*TxInternalDataLegacy) GetGasLimit

func (t *TxInternalDataLegacy) GetGasLimit() uint64

func (*TxInternalDataLegacy) GetHash

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

func (*TxInternalDataLegacy) GetPayload

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

func (*TxInternalDataLegacy) GetPrice

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

func (*TxInternalDataLegacy) GetRecipient

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

func (*TxInternalDataLegacy) GetRoleTypeForValidation

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

func (*TxInternalDataLegacy) IntrinsicGas

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

func (*TxInternalDataLegacy) IsLegacyTransaction

func (t *TxInternalDataLegacy) IsLegacyTransaction() bool

func (*TxInternalDataLegacy) MakeRPCOutput

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

func (*TxInternalDataLegacy) MarshalJSON

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

func (*TxInternalDataLegacy) RawSignatureValues

func (t *TxInternalDataLegacy) RawSignatureValues() TxSignatures

func (*TxInternalDataLegacy) RecoverAddress

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

func (*TxInternalDataLegacy) RecoverPubkey

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

func (*TxInternalDataLegacy) SenderTxHash

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

func (*TxInternalDataLegacy) SerializeForSign

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

func (*TxInternalDataLegacy) SetHash

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

func (*TxInternalDataLegacy) SetSignature

func (t *TxInternalDataLegacy) SetSignature(s TxSignatures)

func (*TxInternalDataLegacy) String

func (t *TxInternalDataLegacy) String() string

func (*TxInternalDataLegacy) Type

func (t *TxInternalDataLegacy) Type() TxType

func (*TxInternalDataLegacy) UnmarshalJSON

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

func (*TxInternalDataLegacy) Validate

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

func (*TxInternalDataLegacy) ValidateMutableValue

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

func (*TxInternalDataLegacy) ValidateSignature

func (t *TxInternalDataLegacy) ValidateSignature() bool

type TxInternalDataLegacyJSON

type TxInternalDataLegacyJSON struct {
	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"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataPayload

type TxInternalDataPayload interface {
	GetPayload() []byte
}

TxInternalDataPayload has a function `GetPayload()`. Since the payload field is not a common field for all tx types, we provide an interface `TxInternalDataPayload` to obtain the payload.

type TxInternalDataSerializeForSignToByte

type TxInternalDataSerializeForSignToByte interface {
	SerializeForSignToBytes() []byte
}

type TxInternalDataSerializer

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

TxInternalDataSerializer serializes an object that implements `TxInternalData`.

func (*TxInternalDataSerializer) DecodeRLP

func (serializer *TxInternalDataSerializer) DecodeRLP(s *rlp.Stream) error

func (*TxInternalDataSerializer) EncodeRLP

func (serializer *TxInternalDataSerializer) EncodeRLP(w io.Writer) error

func (*TxInternalDataSerializer) MarshalJSON

func (serializer *TxInternalDataSerializer) MarshalJSON() ([]byte, error)

func (*TxInternalDataSerializer) UnmarshalJSON

func (serializer *TxInternalDataSerializer) UnmarshalJSON(b []byte) error

type TxInternalDataSmartContractDeploy

type TxInternalDataSmartContractDeploy struct {
	AccountNonce  uint64
	Price         *big.Int
	GasLimit      uint64
	Recipient     *common.Address `rlp:"nil"`
	Amount        *big.Int
	From          common.Address
	Payload       []byte
	HumanReadable bool
	CodeFormat    params.CodeFormat

	TxSignatures

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

TxInternalDataSmartContractDeploy represents a transaction creating a smart contract.

func (*TxInternalDataSmartContractDeploy) Equal

func (*TxInternalDataSmartContractDeploy) Execute

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

func (*TxInternalDataSmartContractDeploy) FillContractAddress

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

func (*TxInternalDataSmartContractDeploy) GetAccountNonce

func (t *TxInternalDataSmartContractDeploy) GetAccountNonce() uint64

func (*TxInternalDataSmartContractDeploy) GetAmount

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

func (*TxInternalDataSmartContractDeploy) GetCodeFormat

func (*TxInternalDataSmartContractDeploy) GetFrom

func (*TxInternalDataSmartContractDeploy) GetGasLimit

func (t *TxInternalDataSmartContractDeploy) GetGasLimit() uint64

func (*TxInternalDataSmartContractDeploy) GetHash

func (*TxInternalDataSmartContractDeploy) GetPayload

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

func (*TxInternalDataSmartContractDeploy) GetPrice

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

func (*TxInternalDataSmartContractDeploy) GetRecipient

func (*TxInternalDataSmartContractDeploy) GetRoleTypeForValidation

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

func (*TxInternalDataSmartContractDeploy) IntrinsicGas

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

func (*TxInternalDataSmartContractDeploy) IsLegacyTransaction

func (t *TxInternalDataSmartContractDeploy) IsLegacyTransaction() bool

func (*TxInternalDataSmartContractDeploy) MakeRPCOutput

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

func (*TxInternalDataSmartContractDeploy) MarshalJSON

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

func (*TxInternalDataSmartContractDeploy) SenderTxHash

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

func (*TxInternalDataSmartContractDeploy) SerializeForSign

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

func (*TxInternalDataSmartContractDeploy) SerializeForSignToBytes

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

func (*TxInternalDataSmartContractDeploy) SetHash

func (*TxInternalDataSmartContractDeploy) SetSignature

func (*TxInternalDataSmartContractDeploy) String

func (*TxInternalDataSmartContractDeploy) Type

func (*TxInternalDataSmartContractDeploy) UnmarshalJSON

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

func (*TxInternalDataSmartContractDeploy) Validate

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

func (*TxInternalDataSmartContractDeploy) ValidateMutableValue

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

type TxInternalDataSmartContractDeployJSON

type TxInternalDataSmartContractDeployJSON 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"`
	Payload       hexutil.Bytes    `json:"input"`
	HumanReadable bool             `json:"humanReadable"`
	CodeFormat    hexutil.Uint     `json:"codeFormat"`
	TxSignatures  TxSignaturesJSON `json:"signatures"`
	Hash          *common.Hash     `json:"hash"`
}

type TxInternalDataSmartContractExecution

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

	TxSignatures

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

TxInternalDataSmartContractExecution represents a transaction executing a smart contract.

func (*TxInternalDataSmartContractExecution) Equal

func (*TxInternalDataSmartContractExecution) Execute

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

func (*TxInternalDataSmartContractExecution) GetAccountNonce

func (t *TxInternalDataSmartContractExecution) GetAccountNonce() uint64

func (*TxInternalDataSmartContractExecution) GetAmount

func (*TxInternalDataSmartContractExecution) GetFrom

func (*TxInternalDataSmartContractExecution) GetGasLimit

func (*TxInternalDataSmartContractExecution) GetHash

func (*TxInternalDataSmartContractExecution) GetPayload

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

func (*TxInternalDataSmartContractExecution) GetPrice

func (*TxInternalDataSmartContractExecution) GetRecipient

func (*TxInternalDataSmartContractExecution) GetRoleTypeForValidation

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

func (*TxInternalDataSmartContractExecution) IntrinsicGas

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

func (*TxInternalDataSmartContractExecution) IsLegacyTransaction

func (t *TxInternalDataSmartContractExecution) IsLegacyTransaction() bool

func (*TxInternalDataSmartContractExecution) MakeRPCOutput

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

func (*TxInternalDataSmartContractExecution) MarshalJSON

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

func (*TxInternalDataSmartContractExecution) SenderTxHash

func (*TxInternalDataSmartContractExecution) SerializeForSign

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

func (*TxInternalDataSmartContractExecution) SerializeForSignToBytes

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

func (*TxInternalDataSmartContractExecution) SetHash

func (*TxInternalDataSmartContractExecution) SetSignature

func (*TxInternalDataSmartContractExecution) String

func (*TxInternalDataSmartContractExecution) Type

func (*TxInternalDataSmartContractExecution) UnmarshalJSON

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

func (*TxInternalDataSmartContractExecution) Validate

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

func (*TxInternalDataSmartContractExecution) ValidateMutableValue

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

type TxInternalDataSmartContractExecutionJSON

type TxInternalDataSmartContractExecutionJSON 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"`
	Payload      hexutil.Bytes    `json:"input"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataValueTransfer

type TxInternalDataValueTransfer struct {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     uint64
	Recipient    common.Address
	Amount       *big.Int
	From         common.Address

	TxSignatures

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

TxInternalDataValueTransfer represents a transaction transferring KLAY. No more attributes required than attributes in TxInternalDataCommon.

func (*TxInternalDataValueTransfer) Equal

func (*TxInternalDataValueTransfer) Execute

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

func (*TxInternalDataValueTransfer) GetAccountNonce

func (t *TxInternalDataValueTransfer) GetAccountNonce() uint64

func (*TxInternalDataValueTransfer) GetAmount

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

func (*TxInternalDataValueTransfer) GetFrom

func (*TxInternalDataValueTransfer) GetGasLimit

func (t *TxInternalDataValueTransfer) GetGasLimit() uint64

func (*TxInternalDataValueTransfer) GetHash

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

func (*TxInternalDataValueTransfer) GetPrice

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

func (*TxInternalDataValueTransfer) GetRecipient

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

func (*TxInternalDataValueTransfer) GetRoleTypeForValidation

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

func (*TxInternalDataValueTransfer) IntrinsicGas

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

func (*TxInternalDataValueTransfer) IsLegacyTransaction

func (t *TxInternalDataValueTransfer) IsLegacyTransaction() bool

func (*TxInternalDataValueTransfer) MakeRPCOutput

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

func (*TxInternalDataValueTransfer) MarshalJSON

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

func (*TxInternalDataValueTransfer) SenderTxHash

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

func (*TxInternalDataValueTransfer) SerializeForSign

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

func (*TxInternalDataValueTransfer) SerializeForSignToBytes

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

func (*TxInternalDataValueTransfer) SetHash

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

func (*TxInternalDataValueTransfer) SetSignature

func (t *TxInternalDataValueTransfer) SetSignature(s TxSignatures)

func (*TxInternalDataValueTransfer) String

func (t *TxInternalDataValueTransfer) String() string

func (*TxInternalDataValueTransfer) Type

func (*TxInternalDataValueTransfer) UnmarshalJSON

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

func (*TxInternalDataValueTransfer) Validate

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

func (*TxInternalDataValueTransfer) ValidateMutableValue

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

type TxInternalDataValueTransferJSON

type TxInternalDataValueTransferJSON 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"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxInternalDataValueTransferMemo

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

	TxSignatures

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

TxInternalDataValueTransferMemo represents a transaction with payload data transferring KLAY.

func (*TxInternalDataValueTransferMemo) Equal

func (*TxInternalDataValueTransferMemo) Execute

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

func (*TxInternalDataValueTransferMemo) GetAccountNonce

func (t *TxInternalDataValueTransferMemo) GetAccountNonce() uint64

func (*TxInternalDataValueTransferMemo) GetAmount

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

func (*TxInternalDataValueTransferMemo) GetFrom

func (*TxInternalDataValueTransferMemo) GetGasLimit

func (t *TxInternalDataValueTransferMemo) GetGasLimit() uint64

func (*TxInternalDataValueTransferMemo) GetHash

func (*TxInternalDataValueTransferMemo) GetPayload

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

func (*TxInternalDataValueTransferMemo) GetPrice

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

func (*TxInternalDataValueTransferMemo) GetRecipient

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

func (*TxInternalDataValueTransferMemo) GetRoleTypeForValidation

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

func (*TxInternalDataValueTransferMemo) IntrinsicGas

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

func (*TxInternalDataValueTransferMemo) IsLegacyTransaction

func (t *TxInternalDataValueTransferMemo) IsLegacyTransaction() bool

func (*TxInternalDataValueTransferMemo) MakeRPCOutput

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

func (*TxInternalDataValueTransferMemo) MarshalJSON

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

func (*TxInternalDataValueTransferMemo) SenderTxHash

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

func (*TxInternalDataValueTransferMemo) SerializeForSign

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

func (*TxInternalDataValueTransferMemo) SerializeForSignToBytes

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

func (*TxInternalDataValueTransferMemo) SetHash

func (*TxInternalDataValueTransferMemo) SetSignature

func (t *TxInternalDataValueTransferMemo) SetSignature(s TxSignatures)

func (*TxInternalDataValueTransferMemo) String

func (*TxInternalDataValueTransferMemo) Type

func (*TxInternalDataValueTransferMemo) UnmarshalJSON

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

func (*TxInternalDataValueTransferMemo) Validate

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

func (*TxInternalDataValueTransferMemo) ValidateMutableValue

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

type TxInternalDataValueTransferMemoJSON

type TxInternalDataValueTransferMemoJSON 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"`
	Payload      hexutil.Bytes    `json:"input"`
	TxSignatures TxSignaturesJSON `json:"signatures"`
	Hash         *common.Hash     `json:"hash"`
}

type TxSignature

type TxSignature struct {
	V *big.Int
	R *big.Int
	S *big.Int
}

TxSignature contains a signature of tx (V, R, S).

func NewTxSignature

func NewTxSignature() *TxSignature

func NewTxSignatureWithValues

func NewTxSignatureWithValues(signer Signer, txhash common.Hash, prv *ecdsa.PrivateKey) (*TxSignature, error)

func (*TxSignature) ChainId

func (t *TxSignature) ChainId() *big.Int

func (*TxSignature) RawSignatureValues

func (t *TxSignature) RawSignatureValues() *TxSignature

func (*TxSignature) RecoverAddress

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

RecoverAddress returns an address with given parameters. txhash: a hash generated by tx.Hash(). homestead: true if Homestead or later. vfunc: V in the signature is treated differently by Signer. This function is for the treatment.

func (*TxSignature) RecoverPubkey

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

RecoverPubKey returns a list of public keys with given parameters. txhash: a hash generated by tx.Hash(). homestead: true if Homestead or later. vfunc: V in the signature is treated differently by Signer. This function is for the treatment.

func (*TxSignature) ValidateSignature

func (t *TxSignature) ValidateSignature() bool

type TxSignatureJSON

type TxSignatureJSON struct {
	V *hexutil.Big
	R *hexutil.Big
	S *hexutil.Big
}

TxSignature contains a signature of tx (V, R, S) as types of hexutil.Big.

type TxSignatures

type TxSignatures []*TxSignature

TxSignatures is a slice of TxSignature. It is created to support multi-sig accounts. Note that this structure also processes txs having a single signature. TODO-Klaytn-Accounts: replace TxSignature with TxSignatures to all newly implemented tx types.

func NewTxSignatures

func NewTxSignatures() TxSignatures

func NewTxSignaturesWithValues

func NewTxSignaturesWithValues(signer Signer, txhash common.Hash, prv []*ecdsa.PrivateKey) (TxSignatures, error)

func (TxSignatures) ChainId

func (t TxSignatures) ChainId() *big.Int

func (TxSignatures) RawSignatureValues

func (t TxSignatures) RawSignatureValues() TxSignatures

func (TxSignatures) RecoverAddress

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

func (TxSignatures) RecoverPubkey

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

func (TxSignatures) ToJSON

func (t TxSignatures) ToJSON() TxSignaturesJSON

func (TxSignatures) ValidateSignature

func (t TxSignatures) ValidateSignature() bool

type TxSignaturesJSON

type TxSignaturesJSON []*TxSignatureJSON

TxSignaturesJSON is an array of *TxSignatureJSON. This structure is for JSON marshalling.

func (TxSignaturesJSON) ToTxSignatures

func (t TxSignaturesJSON) ToTxSignatures() TxSignatures

type TxType

type TxType uint8
const (
	// TxType declarations
	// There are three type declarations at each line:
	//   <base type>, <fee-delegated type>, and <fee-delegated type with a fee ratio>
	// If types other than <base type> are not useful, they are declared with underscore(_).
	// Each base type is self-descriptive.
	TxTypeLegacyTransaction, TxTypeFeeDelegatedTransactions, TxTypeFeeDelegatedWithRatioTransactions TxType = iota << SubTxTypeBits, iota<<SubTxTypeBits + 1, iota<<SubTxTypeBits + 2
	TxTypeValueTransfer, TxTypeFeeDelegatedValueTransfer, TxTypeFeeDelegatedValueTransferWithRatio
	TxTypeValueTransferMemo, TxTypeFeeDelegatedValueTransferMemo, TxTypeFeeDelegatedValueTransferMemoWithRatio
	TxTypeAccountCreation, _, _
	TxTypeAccountUpdate, TxTypeFeeDelegatedAccountUpdate, TxTypeFeeDelegatedAccountUpdateWithRatio
	TxTypeSmartContractDeploy, TxTypeFeeDelegatedSmartContractDeploy, TxTypeFeeDelegatedSmartContractDeployWithRatio
	TxTypeSmartContractExecution, TxTypeFeeDelegatedSmartContractExecution, TxTypeFeeDelegatedSmartContractExecutionWithRatio
	TxTypeCancel, TxTypeFeeDelegatedCancel, TxTypeFeeDelegatedCancelWithRatio
	TxTypeBatch, _, _
	TxTypeChainDataAnchoring, _, _
	TxTypeLast, _, _
)

func (TxType) IsAccountCreation

func (t TxType) IsAccountCreation() bool

func (TxType) IsAccountUpdate

func (t TxType) IsAccountUpdate() bool

func (TxType) IsCancelTransaction

func (t TxType) IsCancelTransaction() bool

func (TxType) IsContractDeploy

func (t TxType) IsContractDeploy() bool

func (TxType) IsFeeDelegatedTransaction

func (t TxType) IsFeeDelegatedTransaction() bool

func (TxType) IsFeeDelegatedWithRatioTransaction

func (t TxType) IsFeeDelegatedWithRatioTransaction() bool

func (TxType) IsLegacyTransaction

func (t TxType) IsLegacyTransaction() bool

func (TxType) IsRPCExcluded

func (t TxType) IsRPCExcluded() bool

IsRPCExcluded returns true if the submission of such tx type is excluded via RPC.

func (TxType) String

func (t TxType) String() string

type TxValueKeyType

type TxValueKeyType uint
const (
	TxValueKeyNonce TxValueKeyType = iota
	TxValueKeyTo
	TxValueKeyAmount
	TxValueKeyGasLimit
	TxValueKeyGasPrice
	TxValueKeyData
	TxValueKeyFrom
	TxValueKeyAnchoredData
	TxValueKeyHumanReadable
	TxValueKeyAccountKey
	TxValueKeyFeePayer
	TxValueKeyFeeRatioOfFeePayer
	TxValueKeyCodeFormat
)

func (TxValueKeyType) String

func (t TxValueKeyType) String() string

type VM

type VM interface {
	Create(caller ContractRef, code []byte, gas uint64, value *big.Int, codeFormat params.CodeFormat) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error)
	CreateWithAddress(caller ContractRef, code []byte, gas uint64, value *big.Int, contractAddr common.Address, humanReadable bool, codeFormat params.CodeFormat) ([]byte, common.Address, uint64, error)
	Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, err error)
}

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

Directories

Path Synopsis
Package account contains types related to Klaytn accounts.
Package account contains types related to Klaytn accounts.
Package accountkey contains types related to keys in Klaytn accounts.
Package accountkey contains types related to keys in Klaytn accounts.

Jump to

Keyboard shortcuts

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