2022-01-26 14:48:20 +00:00
|
|
|
package mock
|
2021-02-23 15:17:07 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/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-12-01 18:56:07 +00:00
|
|
|
func (*PoolMock) MarkIncludedAttesterSlashing(_ *ethpb.AttesterSlashing) {
|
2021-02-23 15:17:07 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarkIncludedProposerSlashing --
|
2021-12-01 18:56:07 +00:00
|
|
|
func (*PoolMock) MarkIncludedProposerSlashing(_ *ethpb.ProposerSlashing) {
|
2021-02-23 15:17:07 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|