This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
PriceKeeper.go
182 lines (148 loc) · 4.62 KB
/
PriceKeeper.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import (
linotypes "github.com/lino-network/lino/types"
mock "github.com/stretchr/testify/mock"
model "github.com/lino-network/lino/x/price/model"
types "github.com/cosmos/cosmos-sdk/types"
)
// PriceKeeper is an autogenerated mock type for the PriceKeeper type
type PriceKeeper struct {
mock.Mock
}
// CoinToMiniDollar provides a mock function with given fields: ctx, coin
func (_m *PriceKeeper) CoinToMiniDollar(ctx types.Context, coin linotypes.Coin) (linotypes.MiniDollar, types.Error) {
ret := _m.Called(ctx, coin)
var r0 linotypes.MiniDollar
if rf, ok := ret.Get(0).(func(types.Context, linotypes.Coin) linotypes.MiniDollar); ok {
r0 = rf(ctx, coin)
} else {
r0 = ret.Get(0).(linotypes.MiniDollar)
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context, linotypes.Coin) types.Error); ok {
r1 = rf(ctx, coin)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// CurrPrice provides a mock function with given fields: ctx
func (_m *PriceKeeper) CurrPrice(ctx types.Context) (linotypes.MiniDollar, types.Error) {
ret := _m.Called(ctx)
var r0 linotypes.MiniDollar
if rf, ok := ret.Get(0).(func(types.Context) linotypes.MiniDollar); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(linotypes.MiniDollar)
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context) types.Error); ok {
r1 = rf(ctx)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// FeedPrice provides a mock function with given fields: ctx, validator, _a2
func (_m *PriceKeeper) FeedPrice(ctx types.Context, validator linotypes.AccountKey, _a2 linotypes.MiniDollar) types.Error {
ret := _m.Called(ctx, validator, _a2)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.MiniDollar) types.Error); ok {
r0 = rf(ctx, validator, _a2)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// HistoryPrice provides a mock function with given fields: ctx
func (_m *PriceKeeper) HistoryPrice(ctx types.Context) []model.FeedHistory {
ret := _m.Called(ctx)
var r0 []model.FeedHistory
if rf, ok := ret.Get(0).(func(types.Context) []model.FeedHistory); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]model.FeedHistory)
}
}
return r0
}
// InitGenesis provides a mock function with given fields: ctx, initPrice
func (_m *PriceKeeper) InitGenesis(ctx types.Context, initPrice linotypes.MiniDollar) types.Error {
ret := _m.Called(ctx, initPrice)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.MiniDollar) types.Error); ok {
r0 = rf(ctx, initPrice)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// LastFeed provides a mock function with given fields: ctx, validator
func (_m *PriceKeeper) LastFeed(ctx types.Context, validator linotypes.AccountKey) (*model.FedPrice, types.Error) {
ret := _m.Called(ctx, validator)
var r0 *model.FedPrice
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) *model.FedPrice); ok {
r0 = rf(ctx, validator)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.FedPrice)
}
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey) types.Error); ok {
r1 = rf(ctx, validator)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// MiniDollarToCoin provides a mock function with given fields: ctx, dollar
func (_m *PriceKeeper) MiniDollarToCoin(ctx types.Context, dollar linotypes.MiniDollar) (linotypes.Coin, linotypes.MiniDollar, types.Error) {
ret := _m.Called(ctx, dollar)
var r0 linotypes.Coin
if rf, ok := ret.Get(0).(func(types.Context, linotypes.MiniDollar) linotypes.Coin); ok {
r0 = rf(ctx, dollar)
} else {
r0 = ret.Get(0).(linotypes.Coin)
}
var r1 linotypes.MiniDollar
if rf, ok := ret.Get(1).(func(types.Context, linotypes.MiniDollar) linotypes.MiniDollar); ok {
r1 = rf(ctx, dollar)
} else {
r1 = ret.Get(1).(linotypes.MiniDollar)
}
var r2 types.Error
if rf, ok := ret.Get(2).(func(types.Context, linotypes.MiniDollar) types.Error); ok {
r2 = rf(ctx, dollar)
} else {
if ret.Get(2) != nil {
r2 = ret.Get(2).(types.Error)
}
}
return r0, r1, r2
}
// UpdatePrice provides a mock function with given fields: ctx
func (_m *PriceKeeper) UpdatePrice(ctx types.Context) types.Error {
ret := _m.Called(ctx)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context) types.Error); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}