-
Notifications
You must be signed in to change notification settings - Fork 0
/
enableEpochsHandlerStub.go
48 lines (41 loc) · 1.36 KB
/
enableEpochsHandlerStub.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
package mock
import "github.com/multiversx/mx-chain-core-go/core"
// EnableEpochsHandlerStub -
type EnableEpochsHandlerStub struct {
IsFlagDefinedCalled func(flag core.EnableEpochFlag) bool
IsFlagEnabledCalled func(flag core.EnableEpochFlag) bool
IsFlagEnabledInEpochCalled func(flag core.EnableEpochFlag, epoch uint32) bool
GetActivationEpochCalled func(flag core.EnableEpochFlag) uint32
}
// IsFlagDefined -
func (stub *EnableEpochsHandlerStub) IsFlagDefined(flag core.EnableEpochFlag) bool {
if stub.IsFlagDefinedCalled != nil {
return stub.IsFlagDefinedCalled(flag)
}
return true
}
// IsFlagEnabled -
func (stub *EnableEpochsHandlerStub) IsFlagEnabled(flag core.EnableEpochFlag) bool {
if stub.IsFlagEnabledCalled != nil {
return stub.IsFlagEnabledCalled(flag)
}
return false
}
// IsFlagEnabledInEpoch -
func (stub *EnableEpochsHandlerStub) IsFlagEnabledInEpoch(flag core.EnableEpochFlag, epoch uint32) bool {
if stub.IsFlagEnabledInEpochCalled != nil {
return stub.IsFlagEnabledInEpochCalled(flag, epoch)
}
return false
}
// GetActivationEpoch -
func (stub *EnableEpochsHandlerStub) GetActivationEpoch(flag core.EnableEpochFlag) uint32 {
if stub.GetActivationEpochCalled != nil {
return stub.GetActivationEpochCalled(flag)
}
return 0
}
// IsInterfaceNil -
func (stub *EnableEpochsHandlerStub) IsInterfaceNil() bool {
return stub == nil
}