types

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ExpectedRowLength = 5

Variables

View Source
var ErrKeyNotFound = errors.New("unknown storage key")

Functions

func HexToKeccak256Hash

func HexToKeccak256Hash(hex string) common.Hash

Types

type ErrContractNotFound

type ErrContractNotFound struct {
	Contract string
}

func (ErrContractNotFound) Error

func (e ErrContractNotFound) Error() string

type ErrMetadataMalformed

type ErrMetadataMalformed struct {
	MissingData Key
}

func (ErrMetadataMalformed) Error

func (e ErrMetadataMalformed) Error() string

type ErrRowMalformed

type ErrRowMalformed struct {
	Length int
}

func (ErrRowMalformed) Error

func (e ErrRowMalformed) Error() string

type Key

type Key string

type PersistedDiff

type PersistedDiff struct {
	RawDiff
	Status       string
	FromBackfill bool `db:"from_backfill"`
	ID           int64
	HeaderID     int64 `db:"header_id"`
	EthNodeID    int64 `db:"eth_node_id"`
}

type RawDiff

type RawDiff struct {
	Address      common.Address `db:"address"`
	BlockHash    common.Hash    `db:"block_hash"`
	BlockHeight  int            `db:"block_height"`
	StorageKey   common.Hash    `db:"storage_key"`
	StorageValue common.Hash    `db:"storage_value"`
}

func FromGethStateDiff

func FromGethStateDiff(account filters.AccountDiff, stateDiff *filters.StateDiff, storage filters.StorageDiff) (RawDiff, error)

func FromParityCsvRow

func FromParityCsvRow(csvRow []string) (RawDiff, error)

type ValueMetadata

type ValueMetadata struct {
	Name        string
	Keys        map[Key]string
	Type        ValueType
	PackedNames map[int]string    //zero indexed position in map => name of packed item
	PackedTypes map[int]ValueType //zero indexed position in map => type of packed item
}

func GetValueMetadata

func GetValueMetadata(name string, keys map[Key]string, valueType ValueType) ValueMetadata

func GetValueMetadataForPackedSlot

func GetValueMetadataForPackedSlot(name string, keys map[Key]string, valueType ValueType, packedNames map[int]string, packedTypes map[int]ValueType) ValueMetadata

type ValueType

type ValueType int
const (
	Uint256 ValueType = iota
	Uint8
	Uint32
	Uint48
	Uint64
	Uint96
	Uint192
	Uint128
	Bytes32
	Address
	PackedSlot
)

Jump to

Keyboard shortcuts

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