-
Notifications
You must be signed in to change notification settings - Fork 202
/
nilHistoryRepository.go
47 lines (37 loc) · 1.33 KB
/
nilHistoryRepository.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
package dblookupext
import (
"github.com/ElrondNetwork/elrond-go-core/data"
)
type nilHistoryRepository struct {
}
// NewNilHistoryRepository returns a not implemented history repository
func NewNilHistoryRepository() (*nilHistoryRepository, error) {
return new(nilHistoryRepository), nil
}
// RecordBlock returns a not implemented error
func (nhr *nilHistoryRepository) RecordBlock(_ []byte, _ data.HeaderHandler, _ data.BodyHandler, _, _ map[string]data.TransactionHandler) error {
return nil
}
// OnNotarizedBlocks does nothing
func (nhr *nilHistoryRepository) OnNotarizedBlocks(_ uint32, _ []data.HeaderHandler, _ [][]byte) {
}
// GetMiniblockMetadataByTxHash does nothing
func (nhr *nilHistoryRepository) GetMiniblockMetadataByTxHash(_ []byte) (*MiniblockMetadata, error) {
return nil, nil
}
// GetEpochByHash returns a not implemented error
func (nhr *nilHistoryRepository) GetEpochByHash(_ []byte) (uint32, error) {
return 0, nil
}
// IsEnabled returns false
func (nhr *nilHistoryRepository) IsEnabled() bool {
return false
}
// GetResultsHashesByTxHash -
func (nhr *nilHistoryRepository) GetResultsHashesByTxHash(_ []byte, _ uint32) (*ResultsHashesByTxHash, error) {
return nil, nil
}
// IsInterfaceNil returns true if there is no value under the interface
func (nhr *nilHistoryRepository) IsInterfaceNil() bool {
return nhr == nil
}