-
Notifications
You must be signed in to change notification settings - Fork 199
/
gasScheduleNotifierMock.go
41 lines (33 loc) · 1.03 KB
/
gasScheduleNotifierMock.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
package mock
import "github.com/ElrondNetwork/elrond-go-core/core"
// GasScheduleNotifierMock -
type GasScheduleNotifierMock struct {
GasSchedule map[string]map[string]uint64
RegisterNotifyHandlerCalled func(handler core.GasScheduleSubscribeHandler)
}
// NewGasScheduleNotifierMock -
func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock {
g := &GasScheduleNotifierMock{
GasSchedule: gasSchedule,
}
return g
}
// RegisterNotifyHandler -
func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler) {
if g.RegisterNotifyHandlerCalled != nil {
g.RegisterNotifyHandlerCalled(handler)
return
}
handler.GasScheduleChange(g.GasSchedule)
}
// LatestGasSchedule -
func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64 {
return g.GasSchedule
}
// UnRegisterAll -
func (g *GasScheduleNotifierMock) UnRegisterAll() {
}
// IsInterfaceNil -
func (g *GasScheduleNotifierMock) IsInterfaceNil() bool {
return g == nil
}