-
Notifications
You must be signed in to change notification settings - Fork 95
/
mock.go
38 lines (29 loc) · 990 Bytes
/
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
package consensus
import (
"github.com/vitelabs/go-vite/common/types"
"github.com/vitelabs/go-vite/ledger"
"github.com/vitelabs/go-vite/log15"
)
var mockLogger = log15.New("module", "consensusMock")
type MockConsensus struct {
}
func (*MockConsensus) SubscribeProducers(gid types.Gid, id string, fn func(event ProducersEvent)) {
panic("implement me")
}
func (*MockConsensus) UnSubscribeProducers(gid types.Gid, id string) {
panic("implement me")
}
func (*MockConsensus) Subscribe(gid types.Gid, id string, addr *types.Address, fn func(Event)) {
mockLogger.Info("Subscribe")
}
func (*MockConsensus) UnSubscribe(gid types.Gid, id string) {
mockLogger.Info("UnSubscribe")
}
func (*MockConsensus) VerifyAccountProducer(block *ledger.AccountBlock) (bool, error) {
mockLogger.Info("VerifyAccountProducer")
return true, nil
}
func (*MockConsensus) VerifySnapshotProducer(block *ledger.SnapshotBlock) (bool, error) {
mockLogger.Info("VerifySnapshotProducer")
return true, nil
}