Documentation ¶
Index ¶
- Constants
- func AddHashedKeys(currentMappings map[common.Hash]StorageValueMetadata) map[common.Hash]StorageValueMetadata
- func Decode(diff StorageDiff, metadata StorageValueMetadata) (interface{}, error)
- func GetIncrementedStorageKey(original common.Hash, incrementBy int64) common.Hash
- func GetStorageKeyForMapping(indexOnContract, key string) common.Hash
- func GetStorageKeyForNestedMapping(indexOnContract, primaryKey, secondaryKey string) common.Hash
- func HexToKeccak256Hash(hex string) common.Hash
- type ErrContractNotFound
- type ErrMetadataMalformed
- type ErrRowMalformed
- type ErrStorageKeyNotFound
- type Key
- type StorageDiff
- type StorageValueMetadata
- type ValueType
Constants ¶
View Source
const ( IndexZero = "0000000000000000000000000000000000000000000000000000000000000000" IndexOne = "0000000000000000000000000000000000000000000000000000000000000001" IndexTwo = "0000000000000000000000000000000000000000000000000000000000000002" IndexThree = "0000000000000000000000000000000000000000000000000000000000000003" IndexFour = "0000000000000000000000000000000000000000000000000000000000000004" IndexFive = "0000000000000000000000000000000000000000000000000000000000000005" IndexSix = "0000000000000000000000000000000000000000000000000000000000000006" IndexSeven = "0000000000000000000000000000000000000000000000000000000000000007" IndexEight = "0000000000000000000000000000000000000000000000000000000000000008" IndexNine = "0000000000000000000000000000000000000000000000000000000000000009" IndexTen = "000000000000000000000000000000000000000000000000000000000000000a" IndexEleven = "000000000000000000000000000000000000000000000000000000000000000b" )
View Source
const ExpectedRowLength = 5
Variables ¶
This section is empty.
Functions ¶
func AddHashedKeys ¶ added in v0.0.9
func AddHashedKeys(currentMappings map[common.Hash]StorageValueMetadata) map[common.Hash]StorageValueMetadata
func Decode ¶
func Decode(diff StorageDiff, metadata StorageValueMetadata) (interface{}, error)
func GetIncrementedStorageKey ¶ added in v0.0.9
func GetStorageKeyForMapping ¶ added in v0.0.9
func GetStorageKeyForNestedMapping ¶ added in v0.0.9
func HexToKeccak256Hash ¶ added in v0.0.8
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 StorageDiff ¶ added in v0.0.8
type StorageDiff struct { Id int HashedAddress common.Hash `db:"contract"` 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 ¶ added in v0.0.8
func FromGethStateDiff(account statediff.AccountDiff, stateDiff *statediff.StateDiff, storage statediff.StorageDiff) (StorageDiff, error)
func FromParityCsvRow ¶ added in v0.0.8
func FromParityCsvRow(csvRow []string) (StorageDiff, error)
type StorageValueMetadata ¶
type StorageValueMetadata 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 GetStorageValueMetadata ¶
func GetStorageValueMetadata(name string, keys map[Key]string, valueType ValueType) StorageValueMetadata
Click to show internal directories.
Click to hide internal directories.