model

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: GPL-3.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const Continues string = "continues"

Continues is the latest Indexed Block Round.

View Source
const LastRetained string = "lastRetain"

LastRetained is the block with minimum height maintained.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessList

type AccessList []AccessTuple

type AccessTuple

type AccessTuple struct {
	Address     string
	StorageKeys []string
}

AccessTuple is the element of an AccessList.

type Block

type Block struct {
	Hash         string `bun:",pk"`
	Round        uint64
	Header       *Header
	Transactions []*Transaction `bun:"rel:has-many,join:hash=block_hash"`
}

Block represents ethereum block.

type Header struct {
	ParentHash  string
	UncleHash   string
	Coinbase    string
	Root        string
	TxHash      string
	ReceiptHash string
	Bloom       string
	Difficulty  string
	Number      uint64
	GasLimit    uint64
	GasUsed     uint64
	Time        uint64
	Extra       string
	MixDigest   string
	Nonce       uint64
	BaseFee     string
}

Header represents ethereum block header.

type IndexedRoundWithTip

type IndexedRoundWithTip struct {
	Tip   string `bun:",pk"`
	Round uint64
}

type Log

type Log struct {
	Address   string
	Topics    []string
	Data      string
	Round     uint64 // BlockNumber
	BlockHash string
	TxHash    string `bun:",pk"`
	TxIndex   uint
	Index     uint `bun:",pk,allowzero"`
	Removed   bool
}

Log represents ethereum log in db.

type Receipt

type Receipt struct {
	Status            uint
	CumulativeGasUsed uint64
	LogsBloom         string
	Logs              []*Log `bun:"rel:has-many,join:transaction_hash=tx_hash"`
	TransactionHash   string `bun:",pk"`
	BlockHash         string
	GasUsed           uint64
	Type              uint
	Round             uint64 // BlockNumber
	TransactionIndex  uint64
	FromAddr          string
	ToAddr            string
	ContractAddress   string
}

type Transaction

type Transaction struct {
	Hash       string `bun:",pk"`
	Type       uint8
	Status     uint // tx/receipt status
	ChainID    string
	BlockHash  string
	Round      uint64
	Index      uint32
	Gas        uint64
	GasPrice   string
	GasTipCap  string
	GasFeeCap  string
	Nonce      uint64
	FromAddr   string
	ToAddr     string
	Value      string
	Data       string
	AccessList AccessList
	V, R, S    string
}

Transaction is ethereum transaction.

Jump to

Keyboard shortcuts

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