mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
9edba29f64
* slashing simulator * add in necessary items for slasher sim * sim item * fix up * fixed build * rev * slasher sim in testing * testonly * gaz * gaz * fix viz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: prestonvanloon <preston@prysmaticlabs.com>
47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
package slashings
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// PoolMock is a fake implementation of PoolManager.
|
|
type PoolMock struct {
|
|
PendingAttSlashings []*ethpb.AttesterSlashing
|
|
PendingPropSlashings []*ethpb.ProposerSlashing
|
|
}
|
|
|
|
// PendingAttesterSlashings --
|
|
func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.AttesterSlashing {
|
|
return m.PendingAttSlashings
|
|
}
|
|
|
|
// PendingProposerSlashings --
|
|
func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.ProposerSlashing {
|
|
return m.PendingPropSlashings
|
|
}
|
|
|
|
// InsertAttesterSlashing --
|
|
func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error {
|
|
m.PendingAttSlashings = append(m.PendingAttSlashings, slashing)
|
|
return nil
|
|
}
|
|
|
|
// InsertProposerSlashing --
|
|
func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.ProposerSlashing) error {
|
|
m.PendingPropSlashings = append(m.PendingPropSlashings, slashing)
|
|
return nil
|
|
}
|
|
|
|
// MarkIncludedAttesterSlashing --
|
|
func (_ *PoolMock) MarkIncludedAttesterSlashing(_ *ethpb.AttesterSlashing) {
|
|
panic("implement me")
|
|
}
|
|
|
|
// MarkIncludedProposerSlashing --
|
|
func (_ *PoolMock) MarkIncludedProposerSlashing(_ *ethpb.ProposerSlashing) {
|
|
panic("implement me")
|
|
}
|