-
Notifications
You must be signed in to change notification settings - Fork 5
/
mock.go
46 lines (37 loc) · 1.43 KB
/
mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package mock
import (
"context"
"github.com/theQRL/qrysm/v4/beacon-chain/state"
zondpb "github.com/theQRL/qrysm/v4/proto/prysm/v1alpha1"
)
// PoolMock is a fake implementation of PoolManager.
type PoolMock struct {
PendingAttSlashings []*zondpb.AttesterSlashing
PendingPropSlashings []*zondpb.ProposerSlashing
}
// PendingAttesterSlashings --
func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*zondpb.AttesterSlashing {
return m.PendingAttSlashings
}
// PendingProposerSlashings --
func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*zondpb.ProposerSlashing {
return m.PendingPropSlashings
}
// InsertAttesterSlashing --
func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *zondpb.AttesterSlashing) error {
m.PendingAttSlashings = append(m.PendingAttSlashings, slashing)
return nil
}
// InsertProposerSlashing --
func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *zondpb.ProposerSlashing) error {
m.PendingPropSlashings = append(m.PendingPropSlashings, slashing)
return nil
}
// MarkIncludedAttesterSlashing --
func (*PoolMock) MarkIncludedAttesterSlashing(_ *zondpb.AttesterSlashing) {
panic("implement me")
}
// MarkIncludedProposerSlashing --
func (*PoolMock) MarkIncludedProposerSlashing(_ *zondpb.ProposerSlashing) {
panic("implement me")
}