storage

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: 10 Imported by: 24

Documentation

Index

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"
	IndexTwelve = "000000000000000000000000000000000000000000000000000000000000000c"
)

Variables

View Source
var (
	New          = `new`
	Pending      = `pending`
	Noncanonical = `noncanonical`
	Transformed  = `transformed`
	Unrecognized = `unrecognized`
	Unwatched    = `unwatched`
)

Functions

func Decode added in v0.1.0

func Decode(diff types.PersistedDiff, metadata types.ValueMetadata) interface{}

func GetIncrementedKey

func GetIncrementedKey(original common.Hash, incrementBy int64) common.Hash

func GetKeyForMapping added in v0.1.0

func GetKeyForMapping(indexOnContract, key string) common.Hash

func GetKeyForNestedMapping added in v0.1.0

func GetKeyForNestedMapping(indexOnContract, primaryKey, secondaryKey string) common.Hash

func NewDiffRepository added in v0.1.0

func NewDiffRepository(db *postgres.DB) diffRepository

Types

type DiffExtractor added in v0.1.0

type DiffExtractor struct {
	StorageDiffRepository DiffRepository
	StorageFetcher        fetcher.IStorageFetcher
}

func NewDiffExtractor added in v0.1.0

func NewDiffExtractor(fetcher fetcher.IStorageFetcher, db *postgres.DB) DiffExtractor

func (DiffExtractor) ExtractDiffs added in v0.1.0

func (extractor DiffExtractor) ExtractDiffs() error

type DiffRepository added in v0.1.0

type DiffRepository interface {
	CreateStorageDiff(rawDiff types.RawDiff) (int64, error)
	CreateBackFilledStorageValue(rawDiff types.RawDiff) error
	GetNewDiffs(minID, limit int) ([]types.PersistedDiff, error)
	GetUnrecognizedDiffs(minID, limit int) ([]types.PersistedDiff, error)
	GetPendingDiffs(minID, limit int) ([]types.PersistedDiff, error)
	MarkTransformed(id int64) error
	MarkNoncanonical(id int64) error
	MarkNoncanonicalDiffsAsNew(blockNumber int64) error
	MarkUnrecognized(id int64) error
	MarkUnwatched(id int64) error
	MarkPending(id int64) error
	GetFirstDiffIDForBlockHeight(blockHeight int64) (int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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