2021-02-23 15:17:07 +00:00
|
|
|
package slashings
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2021-07-23 16:11:21 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
2021-07-21 21:34:07 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2021-02-23 15:17:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// PoolMock is a fake implementation of PoolManager.
|
|
|
|
type PoolMock struct {
|
2021-02-24 15:29:25 +00:00
|
|
|
PendingAttSlashings []*ethpb.AttesterSlashing
|
|
|
|
PendingPropSlashings []*ethpb.ProposerSlashing
|
2021-02-23 15:17:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PendingAttesterSlashings --
|
2021-07-23 16:11:21 +00:00
|
|
|
func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.AttesterSlashing {
|
2021-02-23 15:17:07 +00:00
|
|
|
return m.PendingAttSlashings
|
|
|
|
}
|
|
|
|
|
|
|
|
// PendingProposerSlashings --
|
2021-07-23 16:11:21 +00:00
|
|
|
func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.ProposerSlashing {
|
2021-02-24 15:29:25 +00:00
|
|
|
return m.PendingPropSlashings
|
2021-02-23 15:17:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// InsertAttesterSlashing --
|
2021-07-23 16:11:21 +00:00
|
|
|
func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error {
|
2021-02-25 17:14:04 +00:00
|
|
|
m.PendingAttSlashings = append(m.PendingAttSlashings, slashing)
|
|
|
|
return nil
|
2021-02-23 15:17:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// InsertProposerSlashing --
|
2021-09-29 02:27:21 +00:00
|
|
|
func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.ProposerSlashing) error {
|
2021-03-01 16:08:39 +00:00
|
|
|
m.PendingPropSlashings = append(m.PendingPropSlashings, slashing)
|
|
|
|
return nil
|
2021-02-23 15:17:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MarkIncludedAttesterSlashing --
|
2021-09-29 02:27:21 +00:00
|
|
|
func (_ *PoolMock) MarkIncludedAttesterSlashing(_ *ethpb.AttesterSlashing) {
|
2021-02-23 15:17:07 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarkIncludedProposerSlashing --
|
2021-09-29 02:27:21 +00:00
|
|
|
func (_ *PoolMock) MarkIncludedProposerSlashing(_ *ethpb.ProposerSlashing) {
|
2021-02-23 15:17:07 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|