contract

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// How many validator sets are stored in the cache
	// Cache 3 validator sets for 3 epochs
	DefaultValidatorSetCacheSize = 3
)

Variables

View Source
var (
	ErrSignerNotFound                 = errors.New("signer not found")
	ErrInvalidValidatorsTypeAssertion = errors.New("invalid type assertion for Validators")
)

Functions

func FetchBLSValidators

func FetchBLSValidators(
	transition *state.Transition,
	from types.Address,
) (validators.Validators, error)

FetchBLSValidators queries a contract for validator addresses & BLS Public Keys and returns ECDSAValidators

func FetchECDSAValidators

func FetchECDSAValidators(
	transition *state.Transition,
	from types.Address,
) (validators.Validators, error)

FetchECDSAValidators queries a contract for validator addresses and returns ECDSAValidators

func FetchValidators

func FetchValidators(
	validatorType validators.ValidatorType,
	transition *state.Transition,
	from types.Address,
) (validators.Validators, error)

FetchValidators fetches validators from a contract switched by validator type

Types

type ContractValidatorStore

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

func NewContractValidatorStore

func NewContractValidatorStore(
	logger hclog.Logger,
	blockchain store.HeaderGetter,
	executor Executor,
	validatorSetCacheSize int,
) (*ContractValidatorStore, error)

func (*ContractValidatorStore) GetValidatorsByHeight

func (s *ContractValidatorStore) GetValidatorsByHeight(
	validatorType validators.ValidatorType,
	height uint64,
) (validators.Validators, error)

func (*ContractValidatorStore) SourceType

func (s *ContractValidatorStore) SourceType() store.SourceType

type Executor

type Executor interface {
	BeginTxn(types.Hash, *types.Header, types.Address) (*state.Transition, error)
}

Jump to

Keyboard shortcuts

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