github.com/lino-network/lino@v0.6.11/x/vote/mocks/VoteKeeper.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 linotypes "github.com/lino-network/lino/types" 7 amino "github.com/tendermint/go-amino" 8 9 mock "github.com/stretchr/testify/mock" 10 11 model "github.com/lino-network/lino/x/vote/model" 12 13 types "github.com/cosmos/cosmos-sdk/types" 14 15 votetypes "github.com/lino-network/lino/x/vote/types" 16 ) 17 18 // VoteKeeper is an autogenerated mock type for the VoteKeeper type 19 type VoteKeeper struct { 20 mock.Mock 21 } 22 23 // AssignDuty provides a mock function with given fields: ctx, username, duty, frozenAmount 24 func (_m *VoteKeeper) AssignDuty(ctx types.Context, username linotypes.AccountKey, duty votetypes.VoterDuty, frozenAmount linotypes.Coin) types.Error { 25 ret := _m.Called(ctx, username, duty, frozenAmount) 26 27 var r0 types.Error 28 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, votetypes.VoterDuty, linotypes.Coin) types.Error); ok { 29 r0 = rf(ctx, username, duty, frozenAmount) 30 } else { 31 if ret.Get(0) != nil { 32 r0 = ret.Get(0).(types.Error) 33 } 34 } 35 36 return r0 37 } 38 39 // ClaimInterest provides a mock function with given fields: ctx, username 40 func (_m *VoteKeeper) ClaimInterest(ctx types.Context, username linotypes.AccountKey) types.Error { 41 ret := _m.Called(ctx, username) 42 43 var r0 types.Error 44 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) types.Error); ok { 45 r0 = rf(ctx, username) 46 } else { 47 if ret.Get(0) != nil { 48 r0 = ret.Get(0).(types.Error) 49 } 50 } 51 52 return r0 53 } 54 55 // DailyAdvanceLinoStakeStats provides a mock function with given fields: ctx 56 func (_m *VoteKeeper) DailyAdvanceLinoStakeStats(ctx types.Context) types.Error { 57 ret := _m.Called(ctx) 58 59 var r0 types.Error 60 if rf, ok := ret.Get(0).(func(types.Context) types.Error); ok { 61 r0 = rf(ctx) 62 } else { 63 if ret.Get(0) != nil { 64 r0 = ret.Get(0).(types.Error) 65 } 66 } 67 68 return r0 69 } 70 71 // DoesVoterExist provides a mock function with given fields: ctx, username 72 func (_m *VoteKeeper) DoesVoterExist(ctx types.Context, username linotypes.AccountKey) bool { 73 ret := _m.Called(ctx, username) 74 75 var r0 bool 76 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) bool); ok { 77 r0 = rf(ctx, username) 78 } else { 79 r0 = ret.Get(0).(bool) 80 } 81 82 return r0 83 } 84 85 // ExecUnassignDutyEvent provides a mock function with given fields: ctx, event 86 func (_m *VoteKeeper) ExecUnassignDutyEvent(ctx types.Context, event votetypes.UnassignDutyEvent) types.Error { 87 ret := _m.Called(ctx, event) 88 89 var r0 types.Error 90 if rf, ok := ret.Get(0).(func(types.Context, votetypes.UnassignDutyEvent) types.Error); ok { 91 r0 = rf(ctx, event) 92 } else { 93 if ret.Get(0) != nil { 94 r0 = ret.Get(0).(types.Error) 95 } 96 } 97 98 return r0 99 } 100 101 // ExportToFile provides a mock function with given fields: ctx, cdc, filepath 102 func (_m *VoteKeeper) ExportToFile(ctx types.Context, cdc *amino.Codec, filepath string) error { 103 ret := _m.Called(ctx, cdc, filepath) 104 105 var r0 error 106 if rf, ok := ret.Get(0).(func(types.Context, *amino.Codec, string) error); ok { 107 r0 = rf(ctx, cdc, filepath) 108 } else { 109 r0 = ret.Error(0) 110 } 111 112 return r0 113 } 114 115 // GetLinoStake provides a mock function with given fields: ctx, username 116 func (_m *VoteKeeper) GetLinoStake(ctx types.Context, username linotypes.AccountKey) (linotypes.Coin, types.Error) { 117 ret := _m.Called(ctx, username) 118 119 var r0 linotypes.Coin 120 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) linotypes.Coin); ok { 121 r0 = rf(ctx, username) 122 } else { 123 r0 = ret.Get(0).(linotypes.Coin) 124 } 125 126 var r1 types.Error 127 if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey) types.Error); ok { 128 r1 = rf(ctx, username) 129 } else { 130 if ret.Get(1) != nil { 131 r1 = ret.Get(1).(types.Error) 132 } 133 } 134 135 return r0, r1 136 } 137 138 // GetStakeStatsOfDay provides a mock function with given fields: ctx, day 139 func (_m *VoteKeeper) GetStakeStatsOfDay(ctx types.Context, day int64) (*model.LinoStakeStat, types.Error) { 140 ret := _m.Called(ctx, day) 141 142 var r0 *model.LinoStakeStat 143 if rf, ok := ret.Get(0).(func(types.Context, int64) *model.LinoStakeStat); ok { 144 r0 = rf(ctx, day) 145 } else { 146 if ret.Get(0) != nil { 147 r0 = ret.Get(0).(*model.LinoStakeStat) 148 } 149 } 150 151 var r1 types.Error 152 if rf, ok := ret.Get(1).(func(types.Context, int64) types.Error); ok { 153 r1 = rf(ctx, day) 154 } else { 155 if ret.Get(1) != nil { 156 r1 = ret.Get(1).(types.Error) 157 } 158 } 159 160 return r0, r1 161 } 162 163 // GetVoter provides a mock function with given fields: ctx, username 164 func (_m *VoteKeeper) GetVoter(ctx types.Context, username linotypes.AccountKey) (*model.Voter, types.Error) { 165 ret := _m.Called(ctx, username) 166 167 var r0 *model.Voter 168 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) *model.Voter); ok { 169 r0 = rf(ctx, username) 170 } else { 171 if ret.Get(0) != nil { 172 r0 = ret.Get(0).(*model.Voter) 173 } 174 } 175 176 var r1 types.Error 177 if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey) types.Error); ok { 178 r1 = rf(ctx, username) 179 } else { 180 if ret.Get(1) != nil { 181 r1 = ret.Get(1).(types.Error) 182 } 183 } 184 185 return r0, r1 186 } 187 188 // GetVoterDuty provides a mock function with given fields: ctx, username 189 func (_m *VoteKeeper) GetVoterDuty(ctx types.Context, username linotypes.AccountKey) (votetypes.VoterDuty, types.Error) { 190 ret := _m.Called(ctx, username) 191 192 var r0 votetypes.VoterDuty 193 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) votetypes.VoterDuty); ok { 194 r0 = rf(ctx, username) 195 } else { 196 r0 = ret.Get(0).(votetypes.VoterDuty) 197 } 198 199 var r1 types.Error 200 if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey) types.Error); ok { 201 r1 = rf(ctx, username) 202 } else { 203 if ret.Get(1) != nil { 204 r1 = ret.Get(1).(types.Error) 205 } 206 } 207 208 return r0, r1 209 } 210 211 // ImportFromFile provides a mock function with given fields: ctx, cdc, filepath 212 func (_m *VoteKeeper) ImportFromFile(ctx types.Context, cdc *amino.Codec, filepath string) error { 213 ret := _m.Called(ctx, cdc, filepath) 214 215 var r0 error 216 if rf, ok := ret.Get(0).(func(types.Context, *amino.Codec, string) error); ok { 217 r0 = rf(ctx, cdc, filepath) 218 } else { 219 r0 = ret.Error(0) 220 } 221 222 return r0 223 } 224 225 // InitGenesis provides a mock function with given fields: ctx 226 func (_m *VoteKeeper) InitGenesis(ctx types.Context) { 227 _m.Called(ctx) 228 } 229 230 // RecordFriction provides a mock function with given fields: ctx, friction 231 func (_m *VoteKeeper) RecordFriction(ctx types.Context, friction linotypes.Coin) types.Error { 232 ret := _m.Called(ctx, friction) 233 234 var r0 types.Error 235 if rf, ok := ret.Get(0).(func(types.Context, linotypes.Coin) types.Error); ok { 236 r0 = rf(ctx, friction) 237 } else { 238 if ret.Get(0) != nil { 239 r0 = ret.Get(0).(types.Error) 240 } 241 } 242 243 return r0 244 } 245 246 // SlashStake provides a mock function with given fields: ctx, username, amount, destPool 247 func (_m *VoteKeeper) SlashStake(ctx types.Context, username linotypes.AccountKey, amount linotypes.Coin, destPool linotypes.PoolName) (linotypes.Coin, types.Error) { 248 ret := _m.Called(ctx, username, amount, destPool) 249 250 var r0 linotypes.Coin 251 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.Coin, linotypes.PoolName) linotypes.Coin); ok { 252 r0 = rf(ctx, username, amount, destPool) 253 } else { 254 r0 = ret.Get(0).(linotypes.Coin) 255 } 256 257 var r1 types.Error 258 if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey, linotypes.Coin, linotypes.PoolName) types.Error); ok { 259 r1 = rf(ctx, username, amount, destPool) 260 } else { 261 if ret.Get(1) != nil { 262 r1 = ret.Get(1).(types.Error) 263 } 264 } 265 266 return r0, r1 267 } 268 269 // StakeIn provides a mock function with given fields: ctx, username, amount 270 func (_m *VoteKeeper) StakeIn(ctx types.Context, username linotypes.AccountKey, amount linotypes.Coin) types.Error { 271 ret := _m.Called(ctx, username, amount) 272 273 var r0 types.Error 274 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.Coin) types.Error); ok { 275 r0 = rf(ctx, username, amount) 276 } else { 277 if ret.Get(0) != nil { 278 r0 = ret.Get(0).(types.Error) 279 } 280 } 281 282 return r0 283 } 284 285 // StakeInFor provides a mock function with given fields: ctx, sender, receiver, amount 286 func (_m *VoteKeeper) StakeInFor(ctx types.Context, sender linotypes.AccountKey, receiver linotypes.AccountKey, amount linotypes.Coin) types.Error { 287 ret := _m.Called(ctx, sender, receiver, amount) 288 289 var r0 types.Error 290 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.AccountKey, linotypes.Coin) types.Error); ok { 291 r0 = rf(ctx, sender, receiver, amount) 292 } else { 293 if ret.Get(0) != nil { 294 r0 = ret.Get(0).(types.Error) 295 } 296 } 297 298 return r0 299 } 300 301 // StakeOut provides a mock function with given fields: ctx, username, amount 302 func (_m *VoteKeeper) StakeOut(ctx types.Context, username linotypes.AccountKey, amount linotypes.Coin) types.Error { 303 ret := _m.Called(ctx, username, amount) 304 305 var r0 types.Error 306 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.Coin) types.Error); ok { 307 r0 = rf(ctx, username, amount) 308 } else { 309 if ret.Get(0) != nil { 310 r0 = ret.Get(0).(types.Error) 311 } 312 } 313 314 return r0 315 } 316 317 // UnassignDuty provides a mock function with given fields: ctx, username, waitingPeriodSec 318 func (_m *VoteKeeper) UnassignDuty(ctx types.Context, username linotypes.AccountKey, waitingPeriodSec int64) types.Error { 319 ret := _m.Called(ctx, username, waitingPeriodSec) 320 321 var r0 types.Error 322 if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, int64) types.Error); ok { 323 r0 = rf(ctx, username, waitingPeriodSec) 324 } else { 325 if ret.Get(0) != nil { 326 r0 = ret.Get(0).(types.Error) 327 } 328 } 329 330 return r0 331 }