confp

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockForks

func BlockForks(conf ctypes.ChainConfigurator) []uint64

BlockForks returns non-nil, non <maxUin64>, unique sorted forks defined by block number for a ChainConfigurator.

func CloneChainConfigurator

func CloneChainConfigurator(from ctypes.ChainConfigurator) (ctypes.ChainConfigurator, error)

CloneChainConfigurator creates a copy of the given ChainConfigurator.

func Crush

func Crush(dest, source interface{}, crushZeroValues bool) error

Crush passes the Getter values from source to the Setters in dest, doing so for all interface types that together compose the relevant Configurator interface. Interfaces must be either ChainConfigurator or GenesisBlocker.

func Equivalent

func Equivalent(a, b ctypes.ChainConfigurator) error

func Identical

func Identical(a, b ctypes.ChainConfigurator, fields []string) bool

Identical determines if chain fields are of the same identity; comparing equivalence of only essential network and chain parameters. This allows for identity comparison independent of potential or realized chain upgrades.

func IsEmpty

func IsEmpty(anything interface{}) bool

func TimeForks

func TimeForks(conf ctypes.ChainConfigurator, genesis uint64) []uint64

TimeForks returns non-nil, non <maxUin64>, unique sorted forks defined by block time for a ChainConfigurator.

func Transitions

func Transitions(conf ctypes.ChainConfigurator) (fns []func() *uint64, names []string)

Transitions gets all available transition (fork) functions and their names for a ChainConfigurator.

func Uint64Ptr2Big

func Uint64Ptr2Big(x *uint64) *big.Int

Uint64Ptr2Big converts a *uint64 to a *big.Int. It returns nil if the input is nil.

Types

type ConfigCompatError

type ConfigCompatError struct {
	What string

	// block numbers of the stored and new configurations if block based forking
	StoredBlock, NewBlock *big.Int

	// timestamps of the stored and new configurations if time based forking
	StoredTime, NewTime *uint64

	// the block number to which the local chain must be rewound to correct the error
	RewindToBlock uint64

	// the timestamp to which the local chain must be rewound to correct the error
	RewindToTime uint64
}

ConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.

func Compatible

func Compatible(headBlock *big.Int, headTime *uint64, a, b ctypes.ChainConfigurator) *ConfigCompatError

Compatible checks whether the two configurations are compatible with each other. It returns an error if the configurations are incompatible, or nil if they are. If headBlock is nil, it will only check the time-based fork configurations. If headBlock is not nil, it will check the block-based fork configurations.

func (*ConfigCompatError) Error

func (err *ConfigCompatError) Error() string

type ConfigValidError

type ConfigValidError struct {
	What string
	A, B interface{}
}

func IsValid

func IsValid(conf ctypes.ChainConfigurator, head *uint64) *ConfigValidError

func NewValidErr

func NewValidErr(what string, a, b interface{}) *ConfigValidError

func (*ConfigValidError) Error

func (err *ConfigValidError) Error() string

type DiffT

type DiffT struct {
	Field string
	A     interface{}
	B     interface{}
}

func Equal

func Equal(k reflect.Type, a, b interface{}) (diffs []DiffT)

func (DiffT) String

func (d DiffT) String() string

Directories

Path Synopsis
Package generic implements logic that should be applied for all data types available as configuration parameter implementations.
Package generic implements logic that should be applied for all data types available as configuration parameter implementations.
Package tconvert and included logic should be removed eventually.
Package tconvert and included logic should be removed eventually.

Jump to

Keyboard shortcuts

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