manager

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconMockManager

type BeaconMockManager struct {
	client.IBeaconApiProvider
	// contains filtered or unexported fields
}

Beacon mock manager

func NewBeaconMockManager

func NewBeaconMockManager(logger *slog.Logger, config *db.Config) *BeaconMockManager

Create a new beacon mock manager instance

func (*BeaconMockManager) AddValidator

func (m *BeaconMockManager) AddValidator(pubkey beacon.ValidatorPubkey, withdrawalCredentials common.Hash) (*db.Validator, error)

Add a validator to the Beacon chain

func (*BeaconMockManager) Beacon_FinalityCheckpoints

func (m *BeaconMockManager) Beacon_FinalityCheckpoints(ctx context.Context, stateId string) (client.FinalityCheckpointsResponse, error)

Temp until finality is implemented

func (*BeaconMockManager) Beacon_Genesis

func (m *BeaconMockManager) Beacon_Genesis(ctx context.Context) (client.GenesisResponse, error)

func (*BeaconMockManager) Beacon_Validators

func (m *BeaconMockManager) Beacon_Validators(ctx context.Context, stateId string, ids []string) (client.ValidatorsResponse, error)

func (*BeaconMockManager) CommitBlock

func (m *BeaconMockManager) CommitBlock(slotValidated bool)

Increments the Beacon chain slot, committing a new "block" to the chain Set slotValidated to true to "propose a block" for the current slot, linking it to the next Execution block's index. Set it to false to "miss" the slot, so there was not block proposed for it.

func (*BeaconMockManager) Config_DepositContract

func (m *BeaconMockManager) Config_DepositContract(ctx context.Context) (client.Eth2DepositContractResponse, error)

func (*BeaconMockManager) Config_Spec

func (*BeaconMockManager) GetConfig

func (m *BeaconMockManager) GetConfig() *db.Config

Returns the manager's Beacon config

func (*BeaconMockManager) GetCurrentSlot

func (m *BeaconMockManager) GetCurrentSlot() uint64

Returns the current Beacon chain slot

func (*BeaconMockManager) GetHighestSlot

func (m *BeaconMockManager) GetHighestSlot() uint64

Returns the highest Beacon chain slot (top of the chain head)

func (*BeaconMockManager) GetValidator

func (m *BeaconMockManager) GetValidator(id string) (*db.Validator, error)

Gets a validator by its index or pubkey

func (*BeaconMockManager) GetValidators

func (m *BeaconMockManager) GetValidators(ids []string) ([]*db.Validator, error)

Gets multiple validators by their indices or pubkeys

func (*BeaconMockManager) Node_Syncing

func (*BeaconMockManager) RevertToSnapshot

func (m *BeaconMockManager) RevertToSnapshot(name string) error

Revert to a snapshot of the database state

func (*BeaconMockManager) SetDatabase

func (m *BeaconMockManager) SetDatabase(db *db.Database)

Set the database for the manager directly if you need to custom provision it

func (*BeaconMockManager) SetHighestSlot

func (m *BeaconMockManager) SetHighestSlot(slot uint64)

Sets the highest slot on the chain - useful for simulating syncing conditions

func (*BeaconMockManager) TakeSnapshot

func (m *BeaconMockManager) TakeSnapshot(name string)

Take a snapshot of the current database state

Jump to

Keyboard shortcuts

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