-
Notifications
You must be signed in to change notification settings - Fork 199
/
interimProcessorContainerMock.go
59 lines (48 loc) · 1.49 KB
/
interimProcessorContainerMock.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
package mock
import (
"github.com/multiversx/mx-chain-core-go/data/block"
"github.com/multiversx/mx-chain-go/process"
)
// InterimProcessorContainerMock -
type InterimProcessorContainerMock struct {
GetCalled func(key block.Type) (process.IntermediateTransactionHandler, error)
KeysCalled func() []block.Type
}
// Get -
func (ipcm *InterimProcessorContainerMock) Get(key block.Type) (process.IntermediateTransactionHandler, error) {
if ipcm.GetCalled == nil {
return &IntermediateTransactionHandlerMock{}, nil
}
return ipcm.GetCalled(key)
}
// Add -
func (ipcm *InterimProcessorContainerMock) Add(_ block.Type, _ process.IntermediateTransactionHandler) error {
panic("implement me")
}
// AddMultiple -
func (ipcm *InterimProcessorContainerMock) AddMultiple(_ []block.Type, _ []process.IntermediateTransactionHandler) error {
panic("implement me")
}
// Replace -
func (ipcm *InterimProcessorContainerMock) Replace(_ block.Type, _ process.IntermediateTransactionHandler) error {
panic("implement me")
}
// Remove -
func (ipcm *InterimProcessorContainerMock) Remove(_ block.Type) {
panic("implement me")
}
// Len -
func (ipcm *InterimProcessorContainerMock) Len() int {
panic("implement me")
}
// Keys -
func (ipcm *InterimProcessorContainerMock) Keys() []block.Type {
if ipcm.KeysCalled == nil {
return nil
}
return ipcm.KeysCalled()
}
// IsInterfaceNil returns true if there is no value under the interface
func (ipcm *InterimProcessorContainerMock) IsInterfaceNil() bool {
return ipcm == nil
}