types

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package types contains all the types used across the repo

Index

Constants

View Source
const (
	BloomByteLength = 256
	BloomBitLength  = 8 * BloomByteLength
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessList added in v1.2.3

type AccessList []AccessTuple

AccessList is an EIP-2930 access list.

type AccessTuple added in v1.2.3

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

AccessTuple is the element type of an access list.

type AccountBalanceUpdate

type AccountBalanceUpdate struct {
	Address []byte
	Balance []byte
	Nonce   int64
}

func NewAccountBalanceUpdate

func NewAccountBalanceUpdate() *AccountBalanceUpdate

func (*AccountBalanceUpdate) Schema

func (o *AccountBalanceUpdate) Schema() avro.Schema

type AccountRead added in v1.2.3

type AccountRead struct {
	Address  common.Address
	Nonce    uint64
	Balance  *BigInt
	CodeHash common.Hash
}

type BigInt added in v1.2.3

type BigInt struct {
	*big.Int
}

BigInt is a big.Int wrapper which marshals/unmarshals into byte arrays

func (*BigInt) DecodeRLP added in v1.2.3

func (x *BigInt) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder

func (*BigInt) MarshalJSON added in v1.2.3

func (x *BigInt) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*BigInt) MarshalText added in v1.2.3

func (x *BigInt) MarshalText() (text []byte, err error)

MarshalText implements TextMarshaler

func (*BigInt) SetUint64 added in v1.2.3

func (x *BigInt) SetUint64(value uint64) *BigInt

SetUint64 sets BigInt from a uint64 value

func (*BigInt) UnmarshalJSON added in v1.2.3

func (x *BigInt) UnmarshalJSON(text []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*BigInt) UnmarshalText added in v1.2.3

func (x *BigInt) UnmarshalText(text []byte) error

UnmarshalText implements TextUnmarshaler

type BlobTxSidecar added in v1.7.0

type BlobTxSidecar struct {
	Blobs       []kzg4844.Blob       // Blobs needed by the blob pool
	Commitments []kzg4844.Commitment // Commitments needed by the blob pool
	Proofs      []kzg4844.Proof      // Proofs needed by the blob pool
}

BlobTxSidecar contains the blobs of a blob transaction.

type Block

type Block struct {
	Nonce                 int64
	Round                 int64
	Epoch                 int32
	Hash                  []byte
	MiniBlocks            []*MiniBlock
	NotarizedBlocksHashes [][]byte
	Proposer              int64
	Validators            []int64
	PubKeysBitmap         []byte
	Size                  int64
	Timestamp             int64
	StateRootHash         []byte
	PrevHash              []byte
	ShardID               int32
	TxCount               int32
	AccumulatedFees       []byte
	DeveloperFees         []byte
	EpochStartBlock       bool
	EpochStartInfo        *EpochStartInfo
}

func NewBlock

func NewBlock() *Block

func (*Block) Schema

func (o *Block) Schema() avro.Schema

type BlockNonce

type BlockNonce [8]byte

type BlockReplica

type BlockReplica struct {
	Type            string
	NetworkId       uint64
	Hash            common.Hash
	TotalDifficulty *BigInt
	Header          *Header
	Transactions    []*Transaction
	Uncles          []*Header `json:"uncles,omitempty"`
	Receipts        []*Receipt
	Senders         []common.Address
	State           *StateSpecimen `json:"State"`
	Withdrawals     []*Withdrawal
	BlobTxSidecars  []*BlobTxSidecar
}

type BlockhashRead added in v1.2.3

type BlockhashRead struct {
	BlockNumber uint64
	BlockHash   common.Hash
}

type Bloom

type Bloom [BloomByteLength]byte

type CodeRead added in v1.2.3

type CodeRead struct {
	Hash common.Hash
	Code []byte
}

type ElrondBlockReplica

type ElrondBlockReplica struct {
	Block        *Block
	Transactions []*ElrondTransaction
	SCResults    []*SCResult
	Receipts     []*ElrondReceipt
	Logs         []*Log
	StateChanges []*AccountBalanceUpdate
}

func NewBlockResult

func NewBlockResult() *ElrondBlockReplica

func (*ElrondBlockReplica) Schema

func (o *ElrondBlockReplica) Schema() avro.Schema

type ElrondReceipt

type ElrondReceipt struct {
	Hash      []byte
	Value     []byte
	Sender    []byte
	Data      []byte
	TxHash    []byte
	Timestamp int64
}

func NewReceipt

func NewReceipt() *ElrondReceipt

func (*ElrondReceipt) Schema

func (o *ElrondReceipt) Schema() avro.Schema

type ElrondTransaction

type ElrondTransaction struct {
	Hash             []byte
	MiniBlockHash    []byte
	BlockHash        []byte
	Nonce            int64
	Round            int64
	Value            []byte
	Receiver         []byte
	Sender           []byte
	ReceiverShard    int32
	SenderShard      int32
	GasPrice         int64
	GasLimit         int64
	Data             []byte
	Signature        []byte
	Timestamp        int64
	SenderUserName   []byte
	ReceiverUserName []byte
}

func NewTransaction

func NewTransaction() *ElrondTransaction

func (*ElrondTransaction) Schema

func (o *ElrondTransaction) Schema() avro.Schema

type EpochStartInfo

type EpochStartInfo struct {
	TotalSupply                      []byte
	TotalToDistribute                []byte
	TotalNewlyMinted                 []byte
	RewardsPerBlock                  []byte
	RewardsForProtocolSustainability []byte
	NodePrice                        []byte
	PrevEpochStartRound              int32
	PrevEpochStartHash               []byte
}

func NewEpochStartInfo

func NewEpochStartInfo() *EpochStartInfo

func (*EpochStartInfo) Schema

func (o *EpochStartInfo) Schema() avro.Schema

type Event

type Event struct {
	Address    []byte
	Identifier []byte
	Topics     [][]byte
	Data       []byte
}

func NewEvent

func NewEvent() *Event

func (*Event) Schema

func (o *Event) Schema() avro.Schema
type Header struct {
	ParentHash       common.Hash    `json:"parentHash"`
	UncleHash        common.Hash    `json:"sha3Uncles"`
	Coinbase         common.Address `json:"miner"`
	Root             common.Hash    `json:"stateRoot"`
	TxHash           common.Hash    `json:"transactionsRoot"`
	ReceiptHash      common.Hash    `json:"receiptsRoot"`
	Bloom            Bloom          `json:"logsBloom"`
	Difficulty       *BigInt        `json:"difficulty"`
	Number           *BigInt        `json:"number"`
	GasLimit         uint64         `json:"gasLimit"`
	GasUsed          uint64         `json:"gasUsed"`
	Time             uint64         `json:"timestamp"`
	Extra            []byte         `json:"extraData"`
	MixDigest        common.Hash    `json:"mixHash"`
	Nonce            BlockNonce     `json:"nonce"`
	BaseFee          *BigInt        `json:"baseFeePerGas"`
	WithdrawalsHash  *common.Hash   `json:"withdrawalsRoot" rlp:"nil,optional"`
	BlobGasUsed      *uint64        `json:"blobGasUsed" rlp:"optional"`
	ExcessBlobGas    *uint64        `json:"excessBlobGas" rlp:"optional"`
	ParentBeaconRoot *common.Hash   `json:"parentBeaconBlockRoot" rlp:"optional"`
}

type Log

type Log struct {
	ID      []byte
	Address []byte
	Events  []*Event
}

func NewLog

func NewLog() *Log

func (*Log) Schema

func (o *Log) Schema() avro.Schema

type Logs

type Logs struct {
	Address     common.Address `json:"address"`
	Topics      []common.Hash  `json:"topics"`
	Data        []byte         `json:"data"`
	BlockNumber uint64         `json:"blockNumber"`
	TxHash      common.Hash    `json:"transactionHash"`
	TxIndex     uint           `json:"transactionIndex"`
	BlockHash   common.Hash    `json:"blockHash"`
	Index       uint           `json:"logIndex"`
	Removed     bool           `json:"removed"`
}

type MiniBlock

type MiniBlock struct {
	Hash            []byte
	SenderShardID   int32
	ReceiverShardID int32
	Type            int32
	Timestamp       int64
	TxHashes        [][]byte
}

func NewMiniBlock

func NewMiniBlock() *MiniBlock

func (*MiniBlock) Schema

func (o *MiniBlock) Schema() avro.Schema

type Receipt

type Receipt struct {
	PostStateOrStatus []byte
	CumulativeGasUsed uint64
	TxHash            common.Hash
	ContractAddress   common.Address
	Logs              []*Logs
	GasUsed           uint64
}

type SCResult

type SCResult struct {
	Hash           []byte
	Nonce          int64
	GasLimit       int64
	GasPrice       int64
	Value          []byte
	Sender         []byte
	Receiver       []byte
	RelayerAddr    []byte
	RelayedValue   []byte
	Code           []byte
	Data           []byte
	PrevTxHash     []byte
	OriginalTxHash []byte
	CallType       int32
	CodeMetadata   []byte
	ReturnMessage  []byte
	Timestamp      int64
}

func NewSCResult

func NewSCResult() *SCResult

func (*SCResult) Schema

func (o *SCResult) Schema() avro.Schema

type StateSpecimen

type StateSpecimen struct {
	AccountRead   []*AccountRead
	StorageRead   []*StorageRead
	CodeRead      []*CodeRead
	BlockhashRead []*BlockhashRead
}

type StorageRead added in v1.2.3

type StorageRead struct {
	Account common.Address
	SlotKey common.Hash
	Value   common.Hash
}

type Transaction

type Transaction struct {
	Type         byte            `json:"type"`
	AccessList   AccessList      `json:"accessList"`
	ChainId      *BigInt         `json:"chainId"`
	AccountNonce uint64          `json:"nonce"`
	Price        *BigInt         `json:"gasPrice"`
	GasLimit     uint64          `json:"gas"`
	GasTipCap    *BigInt         `json:"gasTipCap"`
	GasFeeCap    *BigInt         `json:"gasFeeCap"`
	Sender       *common.Address `json:"from" rlp:"nil"`
	Recipient    *common.Address `json:"to" rlp:"nil"` // nil means contract creation
	Amount       *BigInt         `json:"value"`
	Payload      []byte          `json:"input"`
	V            *BigInt         `json:"v" rlp:"nilString"`
	R            *BigInt         `json:"r" rlp:"nilString"`
	S            *BigInt         `json:"s" rlp:"nilString"`
	BlobFeeCap   *BigInt         `json:"blobFeeCap" rlp:"optional"`
	BlobHashes   []common.Hash   `json:"blobHashes" rlp:"optional"`
	BlobGas      uint64          `json:"blobGas" rlp:"optional"`
}

type Withdrawal added in v1.4.2

type Withdrawal struct {
	Index     uint64         `json:"index"`          // monotonically increasing identifier issued by consensus layer
	Validator uint64         `json:"validatorIndex"` // index of validator associated with withdrawal
	Address   common.Address `json:"address"`        // target address for withdrawn ether
	Amount    uint64         `json:"amount"`         // value of withdrawal in Gwei
}

Jump to

Keyboard shortcuts

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