github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/fvm/environment/mock/accounts.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 atree "github.com/onflow/atree" 7 8 flow "github.com/onflow/flow-go/model/flow" 9 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // Accounts is an autogenerated mock type for the Accounts type 14 type Accounts struct { 15 mock.Mock 16 } 17 18 // AllocateSlabIndex provides a mock function with given fields: address 19 func (_m *Accounts) AllocateSlabIndex(address flow.Address) (atree.SlabIndex, error) { 20 ret := _m.Called(address) 21 22 var r0 atree.SlabIndex 23 var r1 error 24 if rf, ok := ret.Get(0).(func(flow.Address) (atree.SlabIndex, error)); ok { 25 return rf(address) 26 } 27 if rf, ok := ret.Get(0).(func(flow.Address) atree.SlabIndex); ok { 28 r0 = rf(address) 29 } else { 30 if ret.Get(0) != nil { 31 r0 = ret.Get(0).(atree.SlabIndex) 32 } 33 } 34 35 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 36 r1 = rf(address) 37 } else { 38 r1 = ret.Error(1) 39 } 40 41 return r0, r1 42 } 43 44 // AppendPublicKey provides a mock function with given fields: address, key 45 func (_m *Accounts) AppendPublicKey(address flow.Address, key flow.AccountPublicKey) error { 46 ret := _m.Called(address, key) 47 48 var r0 error 49 if rf, ok := ret.Get(0).(func(flow.Address, flow.AccountPublicKey) error); ok { 50 r0 = rf(address, key) 51 } else { 52 r0 = ret.Error(0) 53 } 54 55 return r0 56 } 57 58 // ContractExists provides a mock function with given fields: contractName, address 59 func (_m *Accounts) ContractExists(contractName string, address flow.Address) (bool, error) { 60 ret := _m.Called(contractName, address) 61 62 var r0 bool 63 var r1 error 64 if rf, ok := ret.Get(0).(func(string, flow.Address) (bool, error)); ok { 65 return rf(contractName, address) 66 } 67 if rf, ok := ret.Get(0).(func(string, flow.Address) bool); ok { 68 r0 = rf(contractName, address) 69 } else { 70 r0 = ret.Get(0).(bool) 71 } 72 73 if rf, ok := ret.Get(1).(func(string, flow.Address) error); ok { 74 r1 = rf(contractName, address) 75 } else { 76 r1 = ret.Error(1) 77 } 78 79 return r0, r1 80 } 81 82 // Create provides a mock function with given fields: publicKeys, newAddress 83 func (_m *Accounts) Create(publicKeys []flow.AccountPublicKey, newAddress flow.Address) error { 84 ret := _m.Called(publicKeys, newAddress) 85 86 var r0 error 87 if rf, ok := ret.Get(0).(func([]flow.AccountPublicKey, flow.Address) error); ok { 88 r0 = rf(publicKeys, newAddress) 89 } else { 90 r0 = ret.Error(0) 91 } 92 93 return r0 94 } 95 96 // DeleteContract provides a mock function with given fields: contractName, address 97 func (_m *Accounts) DeleteContract(contractName string, address flow.Address) error { 98 ret := _m.Called(contractName, address) 99 100 var r0 error 101 if rf, ok := ret.Get(0).(func(string, flow.Address) error); ok { 102 r0 = rf(contractName, address) 103 } else { 104 r0 = ret.Error(0) 105 } 106 107 return r0 108 } 109 110 // Exists provides a mock function with given fields: address 111 func (_m *Accounts) Exists(address flow.Address) (bool, error) { 112 ret := _m.Called(address) 113 114 var r0 bool 115 var r1 error 116 if rf, ok := ret.Get(0).(func(flow.Address) (bool, error)); ok { 117 return rf(address) 118 } 119 if rf, ok := ret.Get(0).(func(flow.Address) bool); ok { 120 r0 = rf(address) 121 } else { 122 r0 = ret.Get(0).(bool) 123 } 124 125 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 126 r1 = rf(address) 127 } else { 128 r1 = ret.Error(1) 129 } 130 131 return r0, r1 132 } 133 134 // GenerateAccountLocalID provides a mock function with given fields: address 135 func (_m *Accounts) GenerateAccountLocalID(address flow.Address) (uint64, error) { 136 ret := _m.Called(address) 137 138 var r0 uint64 139 var r1 error 140 if rf, ok := ret.Get(0).(func(flow.Address) (uint64, error)); ok { 141 return rf(address) 142 } 143 if rf, ok := ret.Get(0).(func(flow.Address) uint64); ok { 144 r0 = rf(address) 145 } else { 146 r0 = ret.Get(0).(uint64) 147 } 148 149 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 150 r1 = rf(address) 151 } else { 152 r1 = ret.Error(1) 153 } 154 155 return r0, r1 156 } 157 158 // Get provides a mock function with given fields: address 159 func (_m *Accounts) Get(address flow.Address) (*flow.Account, error) { 160 ret := _m.Called(address) 161 162 var r0 *flow.Account 163 var r1 error 164 if rf, ok := ret.Get(0).(func(flow.Address) (*flow.Account, error)); ok { 165 return rf(address) 166 } 167 if rf, ok := ret.Get(0).(func(flow.Address) *flow.Account); ok { 168 r0 = rf(address) 169 } else { 170 if ret.Get(0) != nil { 171 r0 = ret.Get(0).(*flow.Account) 172 } 173 } 174 175 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 176 r1 = rf(address) 177 } else { 178 r1 = ret.Error(1) 179 } 180 181 return r0, r1 182 } 183 184 // GetContract provides a mock function with given fields: contractName, address 185 func (_m *Accounts) GetContract(contractName string, address flow.Address) ([]byte, error) { 186 ret := _m.Called(contractName, address) 187 188 var r0 []byte 189 var r1 error 190 if rf, ok := ret.Get(0).(func(string, flow.Address) ([]byte, error)); ok { 191 return rf(contractName, address) 192 } 193 if rf, ok := ret.Get(0).(func(string, flow.Address) []byte); ok { 194 r0 = rf(contractName, address) 195 } else { 196 if ret.Get(0) != nil { 197 r0 = ret.Get(0).([]byte) 198 } 199 } 200 201 if rf, ok := ret.Get(1).(func(string, flow.Address) error); ok { 202 r1 = rf(contractName, address) 203 } else { 204 r1 = ret.Error(1) 205 } 206 207 return r0, r1 208 } 209 210 // GetContractNames provides a mock function with given fields: address 211 func (_m *Accounts) GetContractNames(address flow.Address) ([]string, error) { 212 ret := _m.Called(address) 213 214 var r0 []string 215 var r1 error 216 if rf, ok := ret.Get(0).(func(flow.Address) ([]string, error)); ok { 217 return rf(address) 218 } 219 if rf, ok := ret.Get(0).(func(flow.Address) []string); ok { 220 r0 = rf(address) 221 } else { 222 if ret.Get(0) != nil { 223 r0 = ret.Get(0).([]string) 224 } 225 } 226 227 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 228 r1 = rf(address) 229 } else { 230 r1 = ret.Error(1) 231 } 232 233 return r0, r1 234 } 235 236 // GetPublicKey provides a mock function with given fields: address, keyIndex 237 func (_m *Accounts) GetPublicKey(address flow.Address, keyIndex uint64) (flow.AccountPublicKey, error) { 238 ret := _m.Called(address, keyIndex) 239 240 var r0 flow.AccountPublicKey 241 var r1 error 242 if rf, ok := ret.Get(0).(func(flow.Address, uint64) (flow.AccountPublicKey, error)); ok { 243 return rf(address, keyIndex) 244 } 245 if rf, ok := ret.Get(0).(func(flow.Address, uint64) flow.AccountPublicKey); ok { 246 r0 = rf(address, keyIndex) 247 } else { 248 r0 = ret.Get(0).(flow.AccountPublicKey) 249 } 250 251 if rf, ok := ret.Get(1).(func(flow.Address, uint64) error); ok { 252 r1 = rf(address, keyIndex) 253 } else { 254 r1 = ret.Error(1) 255 } 256 257 return r0, r1 258 } 259 260 // GetPublicKeyCount provides a mock function with given fields: address 261 func (_m *Accounts) GetPublicKeyCount(address flow.Address) (uint64, error) { 262 ret := _m.Called(address) 263 264 var r0 uint64 265 var r1 error 266 if rf, ok := ret.Get(0).(func(flow.Address) (uint64, error)); ok { 267 return rf(address) 268 } 269 if rf, ok := ret.Get(0).(func(flow.Address) uint64); ok { 270 r0 = rf(address) 271 } else { 272 r0 = ret.Get(0).(uint64) 273 } 274 275 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 276 r1 = rf(address) 277 } else { 278 r1 = ret.Error(1) 279 } 280 281 return r0, r1 282 } 283 284 // GetStorageUsed provides a mock function with given fields: address 285 func (_m *Accounts) GetStorageUsed(address flow.Address) (uint64, error) { 286 ret := _m.Called(address) 287 288 var r0 uint64 289 var r1 error 290 if rf, ok := ret.Get(0).(func(flow.Address) (uint64, error)); ok { 291 return rf(address) 292 } 293 if rf, ok := ret.Get(0).(func(flow.Address) uint64); ok { 294 r0 = rf(address) 295 } else { 296 r0 = ret.Get(0).(uint64) 297 } 298 299 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 300 r1 = rf(address) 301 } else { 302 r1 = ret.Error(1) 303 } 304 305 return r0, r1 306 } 307 308 // GetValue provides a mock function with given fields: id 309 func (_m *Accounts) GetValue(id flow.RegisterID) ([]byte, error) { 310 ret := _m.Called(id) 311 312 var r0 []byte 313 var r1 error 314 if rf, ok := ret.Get(0).(func(flow.RegisterID) ([]byte, error)); ok { 315 return rf(id) 316 } 317 if rf, ok := ret.Get(0).(func(flow.RegisterID) []byte); ok { 318 r0 = rf(id) 319 } else { 320 if ret.Get(0) != nil { 321 r0 = ret.Get(0).([]byte) 322 } 323 } 324 325 if rf, ok := ret.Get(1).(func(flow.RegisterID) error); ok { 326 r1 = rf(id) 327 } else { 328 r1 = ret.Error(1) 329 } 330 331 return r0, r1 332 } 333 334 // SetContract provides a mock function with given fields: contractName, address, contract 335 func (_m *Accounts) SetContract(contractName string, address flow.Address, contract []byte) error { 336 ret := _m.Called(contractName, address, contract) 337 338 var r0 error 339 if rf, ok := ret.Get(0).(func(string, flow.Address, []byte) error); ok { 340 r0 = rf(contractName, address, contract) 341 } else { 342 r0 = ret.Error(0) 343 } 344 345 return r0 346 } 347 348 // SetPublicKey provides a mock function with given fields: address, keyIndex, publicKey 349 func (_m *Accounts) SetPublicKey(address flow.Address, keyIndex uint64, publicKey flow.AccountPublicKey) ([]byte, error) { 350 ret := _m.Called(address, keyIndex, publicKey) 351 352 var r0 []byte 353 var r1 error 354 if rf, ok := ret.Get(0).(func(flow.Address, uint64, flow.AccountPublicKey) ([]byte, error)); ok { 355 return rf(address, keyIndex, publicKey) 356 } 357 if rf, ok := ret.Get(0).(func(flow.Address, uint64, flow.AccountPublicKey) []byte); ok { 358 r0 = rf(address, keyIndex, publicKey) 359 } else { 360 if ret.Get(0) != nil { 361 r0 = ret.Get(0).([]byte) 362 } 363 } 364 365 if rf, ok := ret.Get(1).(func(flow.Address, uint64, flow.AccountPublicKey) error); ok { 366 r1 = rf(address, keyIndex, publicKey) 367 } else { 368 r1 = ret.Error(1) 369 } 370 371 return r0, r1 372 } 373 374 // SetValue provides a mock function with given fields: id, value 375 func (_m *Accounts) SetValue(id flow.RegisterID, value []byte) error { 376 ret := _m.Called(id, value) 377 378 var r0 error 379 if rf, ok := ret.Get(0).(func(flow.RegisterID, []byte) error); ok { 380 r0 = rf(id, value) 381 } else { 382 r0 = ret.Error(0) 383 } 384 385 return r0 386 } 387 388 type mockConstructorTestingTNewAccounts interface { 389 mock.TestingT 390 Cleanup(func()) 391 } 392 393 // NewAccounts creates a new instance of Accounts. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 394 func NewAccounts(t mockConstructorTestingTNewAccounts) *Accounts { 395 mock := &Accounts{} 396 mock.Mock.Test(t) 397 398 t.Cleanup(func() { mock.AssertExpectations(t) }) 399 400 return mock 401 }