github.com/koko1123/flow-go-1@v0.29.6/fvm/environment/mock/accounts.go (about)

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