common

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidData = errors.New("Invalid data returned by the CacheQuery func")

ErrInvalidData is returned if the CacheQuery function returns a null result

Functions

func GeneralProxyHashExtractor

func GeneralProxyHashExtractor(ctx context.Context, qAddr common.Address, blockNo *uint64) *common.Hash

GeneralProxyHashExtractor retrieves if it exists the proxy hash func passed through the context.

func MastenodeEnode

func MastenodeEnode(ipv4address uint32, pubkey [2][32]byte, cfg *params.ChainConfig) *enode.Node

func SWVersionIntToString added in v0.7.4

func SWVersionIntToString(semver *big.Int) string

SWVersionIntToString returns a string from the provided software version int.

func SWVersionToInt added in v0.7.4

func SWVersionToInt() *big.Int

SWVersionToInt converts the current semantic software version to an integer.

Types

type CacheChain

type CacheChain interface {
	CurrentBlock() *eth_types.Block
}

CacheChain defines the method(s) needed by the cache implementation to access the chain data.

type CacheQuery

type CacheQuery func(block_num *big.Int) (interface{}, error)

CacheQuery is the function that allow a fresh data query if the previous data held is considered to have expired or the cache was empty in the first place.

type CacheStorage

type CacheStorage struct {
	// contains filtered or unexported fields
}

CacheStorage is a storage that is held by the client that wants to cache specific data.

func NewCacheStorage

func NewCacheStorage() *CacheStorage

NewCacheStorage creates a new CacheStorage instance.

func (*CacheStorage) Get

func (c *CacheStorage) Get(chain CacheChain, source CacheQuery) (interface{}, error)

Get returns the cached data entry if it hasn't expired(new blockhash generated). An error is returned if a nil cache instance is used or the cache query function returns nil data.

type GeneralProxyHashFunc

type GeneralProxyHashFunc func(addr common.Address, blockheight *uint64) *common.Hash

GeneralProxyHashFunc provides the function that helps check for governed proxy contracts filtered logs.

func GeneralProxyHashGen

func GeneralProxyHashGen(blockchain *core.BlockChain) GeneralProxyHashFunc

GeneralProxyHashGen returns a function that helps retrieve the governed proxy contract hash.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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