utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: AGPL-3.0 Imports: 5 Imported by: 21

Documentation

Index

Constants

View Source
const ExpectedRowLength = 5

Variables

View Source
var ErrRowExists = errors.New("parsed row for storage diff already exists")

Functions

func Decode

func Decode(row StorageDiffRow, metadata StorageValueMetadata) (interface{}, error)

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 ErrStorageKeyNotFound

type ErrStorageKeyNotFound struct {
	Key string
}

func (ErrStorageKeyNotFound) Error

func (e ErrStorageKeyNotFound) Error() string

type Key

type Key string

type StorageDiffRow

type StorageDiffRow struct {
	Id           int
	Contract     common.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 FromStrings

func FromStrings(csvRow []string) (StorageDiffRow, error)

type StorageValueMetadata

type StorageValueMetadata struct {
	Name string
	Keys map[Key]string
	Type ValueType
}

func GetStorageValueMetadata

func GetStorageValueMetadata(name string, keys map[Key]string, t ValueType) StorageValueMetadata

type ValueType

type ValueType int
const (
	Uint256 ValueType = iota
	Uint48
	Bytes32
	Address
)

Jump to

Keyboard shortcuts

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