Documentation ¶
Index ¶
- type BeaconMockManager
- func (m *BeaconMockManager) AddValidator(pubkey beacon.ValidatorPubkey, withdrawalCredentials common.Hash) (*db.Validator, error)
- func (m *BeaconMockManager) Beacon_FinalityCheckpoints(ctx context.Context, stateId string) (client.FinalityCheckpointsResponse, error)
- func (m *BeaconMockManager) Beacon_Genesis(ctx context.Context) (client.GenesisResponse, error)
- func (m *BeaconMockManager) Beacon_Validators(ctx context.Context, stateId string, ids []string) (client.ValidatorsResponse, error)
- func (m *BeaconMockManager) CommitBlock(slotValidated bool)
- func (m *BeaconMockManager) Config_DepositContract(ctx context.Context) (client.Eth2DepositContractResponse, error)
- func (m *BeaconMockManager) Config_Spec(ctx context.Context) (client.Eth2ConfigResponse, error)
- func (m *BeaconMockManager) GetConfig() *db.Config
- func (m *BeaconMockManager) GetCurrentSlot() uint64
- func (m *BeaconMockManager) GetHighestSlot() uint64
- func (m *BeaconMockManager) GetValidator(id string) (*db.Validator, error)
- func (m *BeaconMockManager) GetValidators(ids []string) ([]*db.Validator, error)
- func (m *BeaconMockManager) Node_Syncing(ctx context.Context) (client.SyncStatusResponse, error)
- func (m *BeaconMockManager) RevertToSnapshot(name string) error
- func (m *BeaconMockManager) SetDatabase(db *db.Database)
- func (m *BeaconMockManager) SetHighestSlot(slot uint64)
- func (m *BeaconMockManager) TakeSnapshot(name string)
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 (m *BeaconMockManager) Config_Spec(ctx context.Context) (client.Eth2ConfigResponse, error)
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 (m *BeaconMockManager) Node_Syncing(ctx context.Context) (client.SyncStatusResponse, error)
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