-
Notifications
You must be signed in to change notification settings - Fork 198
/
indexerMock.go
67 lines (53 loc) · 1.73 KB
/
indexerMock.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package mock
import (
"github.com/ElrondNetwork/elrond-go/core/indexer/workItems"
"github.com/ElrondNetwork/elrond-go/core/statistics"
"github.com/ElrondNetwork/elrond-go/data"
"github.com/ElrondNetwork/elrond-go/data/block"
"github.com/ElrondNetwork/elrond-go/data/state"
"github.com/ElrondNetwork/elrond-go/process"
)
// IndexerMock is a mock implementation fot the Indexer interface
type IndexerMock struct {
SaveBlockCalled func(body *block.Body, header *block.Header)
}
// SaveBlock -
func (im *IndexerMock) SaveBlock(_ data.BodyHandler, _ data.HeaderHandler, _ map[string]data.TransactionHandler, _ []uint64, _ []string, _ []byte) {
panic("implement me")
}
// Close will do nothing
func (im *IndexerMock) Close() error {
return nil
}
// SetTxLogsProcessor will do nothing
func (im *IndexerMock) SetTxLogsProcessor(_ process.TransactionLogProcessorDatabase) {
}
// UpdateTPS -
func (im *IndexerMock) UpdateTPS(_ statistics.TPSBenchmark) {
panic("implement me")
}
// SaveRoundsInfo -
func (im *IndexerMock) SaveRoundsInfo(_ []workItems.RoundInfo) {
panic("implement me")
}
// SaveValidatorsRating --
func (im *IndexerMock) SaveValidatorsRating(_ string, _ []workItems.ValidatorRatingInfo) {
}
// SaveValidatorsPubKeys -
func (im *IndexerMock) SaveValidatorsPubKeys(_ map[uint32][][]byte, _ uint32) {
panic("implement me")
}
// RevertIndexedBlock -
func (im *IndexerMock) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler) {
}
// SaveAccounts -
func (im *IndexerMock) SaveAccounts(_ []state.UserAccountHandler) {
}
// IsInterfaceNil returns true if there is no value under the interface
func (im *IndexerMock) IsInterfaceNil() bool {
return im == nil
}
// IsNilIndexer -
func (im *IndexerMock) IsNilIndexer() bool {
return false
}