types

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 3 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 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 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 *big.Int
	Header          *Header
	Transactions    []*Transaction
	Uncles          []*Header
	Receipts        []*Receipt
	Senders         []common.Address
	State           *StateSpecimen
}

type Bloom

type Bloom [BloomByteLength]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  *big.Int       `json:"difficulty"`
	Number      *big.Int       `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     *big.Int       `json:"baseFeePerGas"`
}

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
}

type Transaction

type Transaction struct {
	AccountNonce uint64          `json:"nonce"`
	Price        *big.Int        `json:"gasPrice"`
	GasLimit     uint64          `json:"gas"`
	Sender       common.Address  `json:"from"`
	Recipient    *common.Address `json:"to,omitempty" rlp:"nil"` // nil means contract creation
	Amount       *big.Int        `json:"value"`
	Payload      []byte          `json:"input"`
}

Jump to

Keyboard shortcuts

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