From 5dda2e965f6ed6581a28f381e857af7da1369b66 Mon Sep 17 00:00:00 2001 From: YashK Date: Tue, 30 Apr 2024 14:50:32 +0530 Subject: [PATCH] refactor: added httpClient instance in commitParams struct --- cmd/commit.go | 8 +- core/types/http.go | 6 + core/types/vote.go | 4 +- utils/api.go | 14 +- utils/api_test.go | 6 +- utils/asset.go | 21 +- utils/asset_test.go | 20 +- utils/interface.go | 9 +- utils/mocks/utils.go | 786 +++++++++++++++++++++---------------------- 9 files changed, 443 insertions(+), 431 deletions(-) diff --git a/cmd/commit.go b/cmd/commit.go index cf65b355..da313866 100644 --- a/cmd/commit.go +++ b/cmd/commit.go @@ -80,7 +80,7 @@ func (*UtilsStruct) HandleCommitState(client *ethclient.Client, epoch uint32, se var wg sync.WaitGroup log.Debug("Creating a local cache which will store API result and expire at the end of commit state") - localCache := cache.NewLocalCache(time.Second * time.Duration(core.StateLength)) + commitParams.LocalCache = cache.NewLocalCache(time.Second * time.Duration(core.StateLength)) log.Debug("Iterating over all the collections...") for i := 0; i < int(numActiveCollections); i++ { @@ -97,7 +97,7 @@ func (*UtilsStruct) HandleCommitState(client *ethclient.Client, epoch uint32, se errChan <- err return } - collectionData, err := razorUtils.GetAggregatedDataOfCollection(client, collectionId, epoch, localCache, commitParams) + collectionData, err := razorUtils.GetAggregatedDataOfCollection(client, collectionId, epoch, commitParams) if err != nil { log.Error("Error in getting aggregated data of collection: ", err) errChan <- err @@ -129,7 +129,7 @@ func (*UtilsStruct) HandleCommitState(client *ethclient.Client, epoch uint32, se if err != nil { // Returning the first error from the error channel log.Error("Error in getting collection data: ", err) - localCache.StopCleanup() + commitParams.LocalCache.StopCleanup() return types.CommitData{}, err } } @@ -139,7 +139,7 @@ func (*UtilsStruct) HandleCommitState(client *ethclient.Client, epoch uint32, se log.Debug("HandleCommitState: SeqAllottedCollections: ", seqAllottedCollections) log.Debug("HandleCommitState: Leaves: ", leavesOfTree) - localCache.StopCleanup() + commitParams.LocalCache.StopCleanup() return types.CommitData{ AssignedCollections: assignedCollections, diff --git a/core/types/http.go b/core/types/http.go index c86cad9a..3573cd8d 100644 --- a/core/types/http.go +++ b/core/types/http.go @@ -1,7 +1,13 @@ package types +import "net/http" + type HttpClientConfig struct { Timeout int64 MaxIdleConnections int MaxIdleConnectionsPerHost int } + +type HttpClientInterface interface { + Do(request *http.Request) (*http.Response, error) +} diff --git a/core/types/vote.go b/core/types/vote.go index 08c136f5..f7fc92b8 100644 --- a/core/types/vote.go +++ b/core/types/vote.go @@ -3,7 +3,6 @@ package types import ( "math/big" "razor/cache" - "razor/client" ) type ElectedProposer struct { @@ -70,5 +69,6 @@ type ProposeFileData struct { type CommitParams struct { JobsCache *cache.JobsCache CollectionsCache *cache.CollectionsCache - HttpClient *client.HttpClient + LocalCache *cache.LocalCache + HttpClient HttpClientInterface } diff --git a/utils/api.go b/utils/api.go index 36e97151..32029c51 100644 --- a/utils/api.go +++ b/utils/api.go @@ -7,8 +7,6 @@ import ( "fmt" "io" "net/http" - "razor/cache" - "razor/client" "razor/core" "regexp" "time" @@ -20,30 +18,30 @@ import ( "github.com/gocolly/colly" ) -func GetDataFromAPI(httpClient *client.HttpClient, dataSourceURLStruct types.DataSourceURL, localCache *cache.LocalCache) ([]byte, error) { +func GetDataFromAPI(commitParams types.CommitParams, dataSourceURLStruct types.DataSourceURL) ([]byte, error) { cacheKey, err := generateCacheKey(dataSourceURLStruct.URL, dataSourceURLStruct.Body) if err != nil { log.Errorf("Error in generating cache key for API %s: %v", dataSourceURLStruct.URL, err) return nil, err } - cachedData, found := localCache.Read(cacheKey) + cachedData, found := commitParams.LocalCache.Read(cacheKey) if found { log.Debugf("Getting Data for URL %s from local cache...", dataSourceURLStruct.URL) return cachedData, nil } - response, err := makeAPIRequest(httpClient, dataSourceURLStruct) + response, err := makeAPIRequest(commitParams.HttpClient, dataSourceURLStruct) if err != nil { return nil, err } // Storing the data into cache - localCache.Update(response, cacheKey, time.Now().Add(time.Second*time.Duration(core.StateLength)).Unix()) + commitParams.LocalCache.Update(response, cacheKey, time.Now().Add(time.Second*time.Duration(core.StateLength)).Unix()) return response, nil } -func makeAPIRequest(httpClient *client.HttpClient, dataSourceURLStruct types.DataSourceURL) ([]byte, error) { +func makeAPIRequest(httpClient types.HttpClientInterface, dataSourceURLStruct types.DataSourceURL) ([]byte, error) { var requestBody io.Reader // Using the broader io.Reader interface here switch dataSourceURLStruct.Type { @@ -121,7 +119,7 @@ func addHeaderToRequest(request *http.Request, headerMap map[string]string) *htt return request } -func ProcessRequest(httpClient *client.HttpClient, dataSourceURLStruct types.DataSourceURL, requestBody io.Reader) ([]byte, error) { +func ProcessRequest(httpClient types.HttpClientInterface, dataSourceURLStruct types.DataSourceURL, requestBody io.Reader) ([]byte, error) { request, err := http.NewRequest(dataSourceURLStruct.Type, dataSourceURLStruct.URL, requestBody) if err != nil { return nil, err diff --git a/utils/api_test.go b/utils/api_test.go index 93a737c5..906688a8 100644 --- a/utils/api_test.go +++ b/utils/api_test.go @@ -174,7 +174,11 @@ func TestGetDataFromAPI(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { localCache := cache.NewLocalCache(time.Second * 10) - got, err := GetDataFromAPI(httpClient, tt.args.urlStruct, localCache) + commitParams := types.CommitParams{ + LocalCache: localCache, + HttpClient: httpClient, + } + got, err := GetDataFromAPI(commitParams, tt.args.urlStruct) if (err != nil) != tt.wantErr { t.Errorf("GetDataFromAPI() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/utils/asset.go b/utils/asset.go index 1d307231..09c01a13 100644 --- a/utils/asset.go +++ b/utils/asset.go @@ -7,7 +7,6 @@ import ( "math/big" "os" "razor/cache" - "razor/client" "razor/core" "razor/core/types" "razor/path" @@ -142,21 +141,21 @@ func (*UtilsStruct) GetActiveCollectionIds(client *ethclient.Client) ([]uint16, return activeCollectionIds, nil } -func (*UtilsStruct) GetAggregatedDataOfCollection(client *ethclient.Client, collectionId uint16, epoch uint32, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) { +func (*UtilsStruct) GetAggregatedDataOfCollection(client *ethclient.Client, collectionId uint16, epoch uint32, commitParams types.CommitParams) (*big.Int, error) { activeCollection, err := UtilsInterface.GetActiveCollection(commitParams.CollectionsCache, collectionId) if err != nil { log.Error(err) return nil, err } //Supply previous epoch to Aggregate in case if last reported value is required. - collectionData, aggregationError := UtilsInterface.Aggregate(client, epoch-1, activeCollection, localCache, commitParams) + collectionData, aggregationError := UtilsInterface.Aggregate(client, epoch-1, activeCollection, commitParams) if aggregationError != nil { return nil, aggregationError } return collectionData, nil } -func (*UtilsStruct) Aggregate(client *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) { +func (*UtilsStruct) Aggregate(client *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, commitParams types.CommitParams) (*big.Int, error) { var jobs []bindings.StructsJob var overriddenJobIds []uint16 @@ -212,7 +211,7 @@ func (*UtilsStruct) Aggregate(client *ethclient.Client, previousEpoch uint32, co if len(jobs) == 0 { return nil, errors.New("no jobs present in the collection") } - dataToCommit, weight := UtilsInterface.GetDataToCommitFromJobs(jobs, localCache, commitParams.HttpClient) + dataToCommit, weight := UtilsInterface.GetDataToCommitFromJobs(jobs, commitParams) if len(dataToCommit) == 0 { prevCommitmentData, err := UtilsInterface.FetchPreviousValue(client, previousEpoch, collection.Id) if err != nil { @@ -254,7 +253,7 @@ func (*UtilsStruct) GetActiveCollection(collectionsCache *cache.CollectionsCache return collection, nil } -func (*UtilsStruct) GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) ([]*big.Int, []uint8) { +func (*UtilsStruct) GetDataToCommitFromJobs(jobs []bindings.StructsJob, commitParams types.CommitParams) ([]*big.Int, []uint8) { var ( wg sync.WaitGroup mu sync.Mutex @@ -264,7 +263,7 @@ func (*UtilsStruct) GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCac for _, job := range jobs { wg.Add(1) - go processJobConcurrently(&wg, &mu, &data, &weight, job, localCache, httpClient) + go processJobConcurrently(&wg, &mu, &data, &weight, job, commitParams) } wg.Wait() @@ -272,10 +271,10 @@ func (*UtilsStruct) GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCac return data, weight } -func processJobConcurrently(wg *sync.WaitGroup, mu *sync.Mutex, data *[]*big.Int, weight *[]uint8, job bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) { +func processJobConcurrently(wg *sync.WaitGroup, mu *sync.Mutex, data *[]*big.Int, weight *[]uint8, job bindings.StructsJob, commitParams types.CommitParams) { defer wg.Done() - dataToAppend, err := UtilsInterface.GetDataToCommitFromJob(job, localCache, httpClient) + dataToAppend, err := UtilsInterface.GetDataToCommitFromJob(job, commitParams) if err != nil { return } @@ -287,7 +286,7 @@ func processJobConcurrently(wg *sync.WaitGroup, mu *sync.Mutex, data *[]*big.Int *weight = append(*weight, job.Weight) } -func (*UtilsStruct) GetDataToCommitFromJob(job bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) (*big.Int, error) { +func (*UtilsStruct) GetDataToCommitFromJob(job bindings.StructsJob, commitParams types.CommitParams) (*big.Int, error) { var parsedJSON map[string]interface{} var ( response []byte @@ -323,7 +322,7 @@ func (*UtilsStruct) GetDataToCommitFromJob(job bindings.StructsJob, localCache * var parsedData interface{} if job.SelectorType == 0 { start := time.Now() - response, apiErr = GetDataFromAPI(httpClient, dataSourceURLStruct, localCache) + response, apiErr = GetDataFromAPI(commitParams, dataSourceURLStruct) if apiErr != nil { log.Errorf("Job ID: %d, Error in fetching data from API %s: %v", job.Id, job.Url, apiErr) return nil, apiErr diff --git a/utils/asset_test.go b/utils/asset_test.go index b1e00f8b..3c9a441f 100644 --- a/utils/asset_test.go +++ b/utils/asset_test.go @@ -206,7 +206,8 @@ func TestAggregate(t *testing.T) { ioMock.On("ReadAll", mock.Anything).Return(tt.args.fileData, tt.args.fileDataErr) utilsMock.On("HandleOfficialJobsFromJSONFile", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.overrrideJobs, tt.args.overrideJobIds) - got, err := utils.Aggregate(client, previousEpoch, tt.args.collection, &cache.LocalCache{}, types.CommitParams{HttpClient: &clientPkg.HttpClient{}}) + got, err := utils.Aggregate(client, previousEpoch, tt.args.collection, commitParams) + if (err != nil) != tt.wantErr { t.Errorf("Aggregate() error = %v, wantErr %v", err, tt.wantErr) return @@ -640,9 +641,12 @@ func TestGetDataToCommitFromJobs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { UtilsInterface = &UtilsStruct{} - lc := cache.NewLocalCache(time.Second * 10) + commitParams := types.CommitParams{ + LocalCache: cache.NewLocalCache(time.Second * 10), + HttpClient: httpClient, + } - gotDataArray, gotWeightArray := UtilsInterface.GetDataToCommitFromJobs(tt.args.jobs, lc, httpClient) + gotDataArray, gotWeightArray := UtilsInterface.GetDataToCommitFromJobs(tt.args.jobs, commitParams) if len(gotDataArray) != tt.wantArrayLength || len(gotWeightArray) != tt.wantArrayLength { t.Errorf("GetDataToCommitFromJobs() got = %v, want %v", gotDataArray, tt.wantArrayLength) } @@ -754,8 +758,12 @@ func TestGetDataToCommitFromJob(t *testing.T) { } utils := StartRazor(optionsPackageStruct) - lc := cache.NewLocalCache(time.Second * 10) - data, err := utils.GetDataToCommitFromJob(tt.args.job, lc, httpClient) + commitParams := types.CommitParams{ + LocalCache: cache.NewLocalCache(time.Second * 10), + HttpClient: httpClient, + } + + data, err := utils.GetDataToCommitFromJob(tt.args.job, commitParams) fmt.Println("JOB returns data: ", data) if (err != nil) != tt.wantErr { t.Errorf("GetDataToCommitFromJob() error = %v, wantErr %v", err, tt.wantErr) @@ -1294,7 +1302,7 @@ func TestGetAggregatedDataOfCollection(t *testing.T) { utilsMock.On("GetActiveCollection", mock.Anything, mock.Anything).Return(tt.args.activeCollection, tt.args.activeCollectionErr) utilsMock.On("Aggregate", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tt.args.collectionData, tt.args.aggregationErr) - got, err := utils.GetAggregatedDataOfCollection(client, collectionId, epoch, &cache.LocalCache{}, types.CommitParams{HttpClient: &clientPkg.HttpClient{}}) + got, err := utils.GetAggregatedDataOfCollection(client, collectionId, epoch, types.CommitParams{HttpClient: &clientPkg.HttpClient{}}) if (err != nil) != tt.wantErr { t.Errorf("GetAggregatedDataOfCollection() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/utils/interface.go b/utils/interface.go index 725b14d4..237a7d19 100644 --- a/utils/interface.go +++ b/utils/interface.go @@ -8,7 +8,6 @@ import ( "math/big" "os" "razor/cache" - "razor/client" "razor/core/types" "razor/pkg/bindings" "time" @@ -111,15 +110,15 @@ type Utils interface { GetActiveJob(client *ethclient.Client, jobId uint16) (bindings.StructsJob, error) GetCollection(client *ethclient.Client, collectionId uint16) (bindings.StructsCollection, error) GetActiveCollection(collectionsCache *cache.CollectionsCache, collectionId uint16) (bindings.StructsCollection, error) - Aggregate(client *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) - GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) ([]*big.Int, []uint8) - GetDataToCommitFromJob(job bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) (*big.Int, error) + Aggregate(client *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, commitParams types.CommitParams) (*big.Int, error) + GetDataToCommitFromJobs(jobs []bindings.StructsJob, commitParams types.CommitParams) ([]*big.Int, []uint8) + GetDataToCommitFromJob(job bindings.StructsJob, commitParams types.CommitParams) (*big.Int, error) GetAssignedCollections(client *ethclient.Client, numActiveCollections uint16, seed []byte) (map[int]bool, []*big.Int, error) GetLeafIdOfACollection(client *ethclient.Client, collectionId uint16) (uint16, error) GetCollectionIdFromIndex(client *ethclient.Client, medianIndex uint16) (uint16, error) GetCollectionIdFromLeafId(client *ethclient.Client, leafId uint16) (uint16, error) GetNumActiveCollections(client *ethclient.Client) (uint16, error) - GetAggregatedDataOfCollection(client *ethclient.Client, collectionId uint16, epoch uint32, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) + GetAggregatedDataOfCollection(client *ethclient.Client, collectionId uint16, epoch uint32, commitParams types.CommitParams) (*big.Int, error) GetJobs(client *ethclient.Client) ([]bindings.StructsJob, error) GetAllCollections(client *ethclient.Client) ([]bindings.StructsCollection, error) GetActiveCollectionIds(client *ethclient.Client) ([]uint16, error) diff --git a/utils/mocks/utils.go b/utils/mocks/utils.go index 65baf683..67107321 100644 --- a/utils/mocks/utils.go +++ b/utils/mocks/utils.go @@ -10,8 +10,6 @@ import ( cache "razor/cache" - client "razor/client" - common "github.com/ethereum/go-ethereum/common" coretypes "github.com/ethereum/go-ethereum/core/types" @@ -70,25 +68,25 @@ func (_m *Utils) AddJobToJSON(fileName string, job *types.StructsJob) error { return r0 } -// Aggregate provides a mock function with given fields: _a0, previousEpoch, collection, localCache, commitParams -func (_m *Utils) Aggregate(_a0 *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) { - ret := _m.Called(_a0, previousEpoch, collection, localCache, commitParams) +// Aggregate provides a mock function with given fields: client, previousEpoch, collection, commitParams +func (_m *Utils) Aggregate(client *ethclient.Client, previousEpoch uint32, collection bindings.StructsCollection, commitParams types.CommitParams) (*big.Int, error) { + ret := _m.Called(client, previousEpoch, collection, commitParams) var r0 *big.Int var r1 error - if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, bindings.StructsCollection, *cache.LocalCache, types.CommitParams) (*big.Int, error)); ok { - return rf(_a0, previousEpoch, collection, localCache, commitParams) + if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, bindings.StructsCollection, types.CommitParams) (*big.Int, error)); ok { + return rf(client, previousEpoch, collection, commitParams) } - if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, bindings.StructsCollection, *cache.LocalCache, types.CommitParams) *big.Int); ok { - r0 = rf(_a0, previousEpoch, collection, localCache, commitParams) + if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, bindings.StructsCollection, types.CommitParams) *big.Int); ok { + r0 = rf(client, previousEpoch, collection, commitParams) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) } } - if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, bindings.StructsCollection, *cache.LocalCache, types.CommitParams) error); ok { - r1 = rf(_a0, previousEpoch, collection, localCache, commitParams) + if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, bindings.StructsCollection, types.CommitParams) error); ok { + r1 = rf(client, previousEpoch, collection, commitParams) } else { r1 = ret.Error(1) } @@ -110,23 +108,23 @@ func (_m *Utils) AssignPassword(flagSet *pflag.FlagSet) string { return r0 } -// AssignStakerId provides a mock function with given fields: flagSet, _a1, address -func (_m *Utils) AssignStakerId(flagSet *pflag.FlagSet, _a1 *ethclient.Client, address string) (uint32, error) { - ret := _m.Called(flagSet, _a1, address) +// AssignStakerId provides a mock function with given fields: flagSet, client, address +func (_m *Utils) AssignStakerId(flagSet *pflag.FlagSet, client *ethclient.Client, address string) (uint32, error) { + ret := _m.Called(flagSet, client, address) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*pflag.FlagSet, *ethclient.Client, string) (uint32, error)); ok { - return rf(flagSet, _a1, address) + return rf(flagSet, client, address) } if rf, ok := ret.Get(0).(func(*pflag.FlagSet, *ethclient.Client, string) uint32); ok { - r0 = rf(flagSet, _a1, address) + r0 = rf(flagSet, client, address) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*pflag.FlagSet, *ethclient.Client, string) error); ok { - r1 = rf(flagSet, _a1, address) + r1 = rf(flagSet, client, address) } else { r1 = ret.Error(1) } @@ -134,13 +132,13 @@ func (_m *Utils) AssignStakerId(flagSet *pflag.FlagSet, _a1 *ethclient.Client, a return r0, r1 } -// CalculateBlockTime provides a mock function with given fields: _a0 -func (_m *Utils) CalculateBlockTime(_a0 *ethclient.Client) int64 { - ret := _m.Called(_a0) +// CalculateBlockTime provides a mock function with given fields: client +func (_m *Utils) CalculateBlockTime(client *ethclient.Client) int64 { + ret := _m.Called(client) var r0 int64 if rf, ok := ret.Get(0).(func(*ethclient.Client) int64); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(int64) } @@ -180,9 +178,9 @@ func (_m *Utils) CheckAmountAndBalance(amountInWei *big.Int, balance *big.Int) * return r0 } -// CheckEthBalanceIsZero provides a mock function with given fields: _a0, address -func (_m *Utils) CheckEthBalanceIsZero(_a0 *ethclient.Client, address string) { - _m.Called(_a0, address) +// CheckEthBalanceIsZero provides a mock function with given fields: client, address +func (_m *Utils) CheckEthBalanceIsZero(client *ethclient.Client, address string) { + _m.Called(client, address) } // CheckPassword provides a mock function with given fields: account @@ -199,13 +197,13 @@ func (_m *Utils) CheckPassword(account types.Account) error { return r0 } -// CheckTransactionReceipt provides a mock function with given fields: _a0, _txHash -func (_m *Utils) CheckTransactionReceipt(_a0 *ethclient.Client, _txHash string) int { - ret := _m.Called(_a0, _txHash) +// CheckTransactionReceipt provides a mock function with given fields: client, _txHash +func (_m *Utils) CheckTransactionReceipt(client *ethclient.Client, _txHash string) int { + ret := _m.Called(client, _txHash) var r0 int if rf, ok := ret.Get(0).(func(*ethclient.Client, string) int); ok { - r0 = rf(_a0, _txHash) + r0 = rf(client, _txHash) } else { r0 = ret.Get(0).(int) } @@ -243,17 +241,17 @@ func (_m *Utils) DeleteJobFromJSON(fileName string, jobId string) error { return r0 } -// EstimateBlockNumberAtEpochBeginning provides a mock function with given fields: _a0, currentBlockNumber -func (_m *Utils) EstimateBlockNumberAtEpochBeginning(_a0 *ethclient.Client, currentBlockNumber *big.Int) (*big.Int, error) { - ret := _m.Called(_a0, currentBlockNumber) +// EstimateBlockNumberAtEpochBeginning provides a mock function with given fields: client, currentBlockNumber +func (_m *Utils) EstimateBlockNumberAtEpochBeginning(client *ethclient.Client, currentBlockNumber *big.Int) (*big.Int, error) { + ret := _m.Called(client, currentBlockNumber) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, *big.Int) (*big.Int, error)); ok { - return rf(_a0, currentBlockNumber) + return rf(client, currentBlockNumber) } if rf, ok := ret.Get(0).(func(*ethclient.Client, *big.Int) *big.Int); ok { - r0 = rf(_a0, currentBlockNumber) + r0 = rf(client, currentBlockNumber) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -261,7 +259,7 @@ func (_m *Utils) EstimateBlockNumberAtEpochBeginning(_a0 *ethclient.Client, curr } if rf, ok := ret.Get(1).(func(*ethclient.Client, *big.Int) error); ok { - r1 = rf(_a0, currentBlockNumber) + r1 = rf(client, currentBlockNumber) } else { r1 = ret.Error(1) } @@ -269,17 +267,17 @@ func (_m *Utils) EstimateBlockNumberAtEpochBeginning(_a0 *ethclient.Client, curr return r0, r1 } -// FetchBalance provides a mock function with given fields: _a0, accountAddress -func (_m *Utils) FetchBalance(_a0 *ethclient.Client, accountAddress string) (*big.Int, error) { - ret := _m.Called(_a0, accountAddress) +// FetchBalance provides a mock function with given fields: client, accountAddress +func (_m *Utils) FetchBalance(client *ethclient.Client, accountAddress string) (*big.Int, error) { + ret := _m.Called(client, accountAddress) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, string) (*big.Int, error)); ok { - return rf(_a0, accountAddress) + return rf(client, accountAddress) } if rf, ok := ret.Get(0).(func(*ethclient.Client, string) *big.Int); ok { - r0 = rf(_a0, accountAddress) + r0 = rf(client, accountAddress) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -287,7 +285,7 @@ func (_m *Utils) FetchBalance(_a0 *ethclient.Client, accountAddress string) (*bi } if rf, ok := ret.Get(1).(func(*ethclient.Client, string) error); ok { - r1 = rf(_a0, accountAddress) + r1 = rf(client, accountAddress) } else { r1 = ret.Error(1) } @@ -295,17 +293,17 @@ func (_m *Utils) FetchBalance(_a0 *ethclient.Client, accountAddress string) (*bi return r0, r1 } -// FetchPreviousValue provides a mock function with given fields: _a0, epoch, assetId -func (_m *Utils) FetchPreviousValue(_a0 *ethclient.Client, epoch uint32, assetId uint16) (*big.Int, error) { - ret := _m.Called(_a0, epoch, assetId) +// FetchPreviousValue provides a mock function with given fields: client, epoch, assetId +func (_m *Utils) FetchPreviousValue(client *ethclient.Client, epoch uint32, assetId uint16) (*big.Int, error) { + ret := _m.Called(client, epoch, assetId) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint16) (*big.Int, error)); ok { - return rf(_a0, epoch, assetId) + return rf(client, epoch, assetId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint16) *big.Int); ok { - r0 = rf(_a0, epoch, assetId) + r0 = rf(client, epoch, assetId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -313,7 +311,7 @@ func (_m *Utils) FetchPreviousValue(_a0 *ethclient.Client, epoch uint32, assetId } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint16) error); ok { - r1 = rf(_a0, epoch, assetId) + r1 = rf(client, epoch, assetId) } else { r1 = ret.Error(1) } @@ -345,17 +343,17 @@ func (_m *Utils) GetActiveCollection(collectionsCache *cache.CollectionsCache, c return r0, r1 } -// GetActiveCollectionIds provides a mock function with given fields: _a0 -func (_m *Utils) GetActiveCollectionIds(_a0 *ethclient.Client) ([]uint16, error) { - ret := _m.Called(_a0) +// GetActiveCollectionIds provides a mock function with given fields: client +func (_m *Utils) GetActiveCollectionIds(client *ethclient.Client) ([]uint16, error) { + ret := _m.Called(client) var r0 []uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) ([]uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) []uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint16) @@ -363,7 +361,7 @@ func (_m *Utils) GetActiveCollectionIds(_a0 *ethclient.Client) ([]uint16, error) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -371,23 +369,23 @@ func (_m *Utils) GetActiveCollectionIds(_a0 *ethclient.Client) ([]uint16, error) return r0, r1 } -// GetActiveJob provides a mock function with given fields: _a0, jobId -func (_m *Utils) GetActiveJob(_a0 *ethclient.Client, jobId uint16) (bindings.StructsJob, error) { - ret := _m.Called(_a0, jobId) +// GetActiveJob provides a mock function with given fields: client, jobId +func (_m *Utils) GetActiveJob(client *ethclient.Client, jobId uint16) (bindings.StructsJob, error) { + ret := _m.Called(client, jobId) var r0 bindings.StructsJob var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) (bindings.StructsJob, error)); ok { - return rf(_a0, jobId) + return rf(client, jobId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) bindings.StructsJob); ok { - r0 = rf(_a0, jobId) + r0 = rf(client, jobId) } else { r0 = ret.Get(0).(bindings.StructsJob) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16) error); ok { - r1 = rf(_a0, jobId) + r1 = rf(client, jobId) } else { r1 = ret.Error(1) } @@ -395,25 +393,25 @@ func (_m *Utils) GetActiveJob(_a0 *ethclient.Client, jobId uint16) (bindings.Str return r0, r1 } -// GetAggregatedDataOfCollection provides a mock function with given fields: _a0, collectionId, epoch, localCache, commitParams -func (_m *Utils) GetAggregatedDataOfCollection(_a0 *ethclient.Client, collectionId uint16, epoch uint32, localCache *cache.LocalCache, commitParams types.CommitParams) (*big.Int, error) { - ret := _m.Called(_a0, collectionId, epoch, localCache, commitParams) +// GetAggregatedDataOfCollection provides a mock function with given fields: client, collectionId, epoch, commitParams +func (_m *Utils) GetAggregatedDataOfCollection(client *ethclient.Client, collectionId uint16, epoch uint32, commitParams types.CommitParams) (*big.Int, error) { + ret := _m.Called(client, collectionId, epoch, commitParams) var r0 *big.Int var r1 error - if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, uint32, *cache.LocalCache, types.CommitParams) (*big.Int, error)); ok { - return rf(_a0, collectionId, epoch, localCache, commitParams) + if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, uint32, types.CommitParams) (*big.Int, error)); ok { + return rf(client, collectionId, epoch, commitParams) } - if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, uint32, *cache.LocalCache, types.CommitParams) *big.Int); ok { - r0 = rf(_a0, collectionId, epoch, localCache, commitParams) + if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, uint32, types.CommitParams) *big.Int); ok { + r0 = rf(client, collectionId, epoch, commitParams) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) } } - if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16, uint32, *cache.LocalCache, types.CommitParams) error); ok { - r1 = rf(_a0, collectionId, epoch, localCache, commitParams) + if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16, uint32, types.CommitParams) error); ok { + r1 = rf(client, collectionId, epoch, commitParams) } else { r1 = ret.Error(1) } @@ -421,17 +419,17 @@ func (_m *Utils) GetAggregatedDataOfCollection(_a0 *ethclient.Client, collection return r0, r1 } -// GetAllCollections provides a mock function with given fields: _a0 -func (_m *Utils) GetAllCollections(_a0 *ethclient.Client) ([]bindings.StructsCollection, error) { - ret := _m.Called(_a0) +// GetAllCollections provides a mock function with given fields: client +func (_m *Utils) GetAllCollections(client *ethclient.Client) ([]bindings.StructsCollection, error) { + ret := _m.Called(client) var r0 []bindings.StructsCollection var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) ([]bindings.StructsCollection, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) []bindings.StructsCollection); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]bindings.StructsCollection) @@ -439,7 +437,7 @@ func (_m *Utils) GetAllCollections(_a0 *ethclient.Client) ([]bindings.StructsCol } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -447,18 +445,18 @@ func (_m *Utils) GetAllCollections(_a0 *ethclient.Client) ([]bindings.StructsCol return r0, r1 } -// GetAssignedCollections provides a mock function with given fields: _a0, numActiveCollections, seed -func (_m *Utils) GetAssignedCollections(_a0 *ethclient.Client, numActiveCollections uint16, seed []byte) (map[int]bool, []*big.Int, error) { - ret := _m.Called(_a0, numActiveCollections, seed) +// GetAssignedCollections provides a mock function with given fields: client, numActiveCollections, seed +func (_m *Utils) GetAssignedCollections(client *ethclient.Client, numActiveCollections uint16, seed []byte) (map[int]bool, []*big.Int, error) { + ret := _m.Called(client, numActiveCollections, seed) var r0 map[int]bool var r1 []*big.Int var r2 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, []byte) (map[int]bool, []*big.Int, error)); ok { - return rf(_a0, numActiveCollections, seed) + return rf(client, numActiveCollections, seed) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16, []byte) map[int]bool); ok { - r0 = rf(_a0, numActiveCollections, seed) + r0 = rf(client, numActiveCollections, seed) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(map[int]bool) @@ -466,7 +464,7 @@ func (_m *Utils) GetAssignedCollections(_a0 *ethclient.Client, numActiveCollecti } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16, []byte) []*big.Int); ok { - r1 = rf(_a0, numActiveCollections, seed) + r1 = rf(client, numActiveCollections, seed) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]*big.Int) @@ -474,7 +472,7 @@ func (_m *Utils) GetAssignedCollections(_a0 *ethclient.Client, numActiveCollecti } if rf, ok := ret.Get(2).(func(*ethclient.Client, uint16, []byte) error); ok { - r2 = rf(_a0, numActiveCollections, seed) + r2 = rf(client, numActiveCollections, seed) } else { r2 = ret.Error(2) } @@ -482,23 +480,23 @@ func (_m *Utils) GetAssignedCollections(_a0 *ethclient.Client, numActiveCollecti return r0, r1, r2 } -// GetBlock provides a mock function with given fields: _a0, epoch -func (_m *Utils) GetBlock(_a0 *ethclient.Client, epoch uint32) (bindings.StructsBlock, error) { - ret := _m.Called(_a0, epoch) +// GetBlock provides a mock function with given fields: client, epoch +func (_m *Utils) GetBlock(client *ethclient.Client, epoch uint32) (bindings.StructsBlock, error) { + ret := _m.Called(client, epoch) var r0 bindings.StructsBlock var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (bindings.StructsBlock, error)); ok { - return rf(_a0, epoch) + return rf(client, epoch) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) bindings.StructsBlock); ok { - r0 = rf(_a0, epoch) + r0 = rf(client, epoch) } else { r0 = ret.Get(0).(bindings.StructsBlock) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, epoch) + r1 = rf(client, epoch) } else { r1 = ret.Error(1) } @@ -506,23 +504,23 @@ func (_m *Utils) GetBlock(_a0 *ethclient.Client, epoch uint32) (bindings.Structs return r0, r1 } -// GetBlockIndexToBeConfirmed provides a mock function with given fields: _a0 -func (_m *Utils) GetBlockIndexToBeConfirmed(_a0 *ethclient.Client) (int8, error) { - ret := _m.Called(_a0) +// GetBlockIndexToBeConfirmed provides a mock function with given fields: client +func (_m *Utils) GetBlockIndexToBeConfirmed(client *ethclient.Client) (int8, error) { + ret := _m.Called(client) var r0 int8 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (int8, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) int8); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(int8) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -530,13 +528,13 @@ func (_m *Utils) GetBlockIndexToBeConfirmed(_a0 *ethclient.Client) (int8, error) return r0, r1 } -// GetBlockManager provides a mock function with given fields: _a0 -func (_m *Utils) GetBlockManager(_a0 *ethclient.Client) *bindings.BlockManager { - ret := _m.Called(_a0) +// GetBlockManager provides a mock function with given fields: client +func (_m *Utils) GetBlockManager(client *ethclient.Client) *bindings.BlockManager { + ret := _m.Called(client) var r0 *bindings.BlockManager if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.BlockManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.BlockManager) @@ -546,17 +544,17 @@ func (_m *Utils) GetBlockManager(_a0 *ethclient.Client) *bindings.BlockManager { return r0 } -// GetBlockManagerWithOpts provides a mock function with given fields: _a0 -func (_m *Utils) GetBlockManagerWithOpts(_a0 *ethclient.Client) (*bindings.BlockManager, bind.CallOpts) { - ret := _m.Called(_a0) +// GetBlockManagerWithOpts provides a mock function with given fields: client +func (_m *Utils) GetBlockManagerWithOpts(client *ethclient.Client) (*bindings.BlockManager, bind.CallOpts) { + ret := _m.Called(client) var r0 *bindings.BlockManager var r1 bind.CallOpts if rf, ok := ret.Get(0).(func(*ethclient.Client) (*bindings.BlockManager, bind.CallOpts)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.BlockManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.BlockManager) @@ -564,7 +562,7 @@ func (_m *Utils) GetBlockManagerWithOpts(_a0 *ethclient.Client) (*bindings.Block } if rf, ok := ret.Get(1).(func(*ethclient.Client) bind.CallOpts); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Get(1).(bind.CallOpts) } @@ -572,23 +570,23 @@ func (_m *Utils) GetBlockManagerWithOpts(_a0 *ethclient.Client) (*bindings.Block return r0, r1 } -// GetBufferedState provides a mock function with given fields: _a0, header, buffer -func (_m *Utils) GetBufferedState(_a0 *ethclient.Client, header *coretypes.Header, buffer int32) (int64, error) { - ret := _m.Called(_a0, header, buffer) +// GetBufferedState provides a mock function with given fields: client, header, buffer +func (_m *Utils) GetBufferedState(client *ethclient.Client, header *coretypes.Header, buffer int32) (int64, error) { + ret := _m.Called(client, header, buffer) var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, *coretypes.Header, int32) (int64, error)); ok { - return rf(_a0, header, buffer) + return rf(client, header, buffer) } if rf, ok := ret.Get(0).(func(*ethclient.Client, *coretypes.Header, int32) int64); ok { - r0 = rf(_a0, header, buffer) + r0 = rf(client, header, buffer) } else { r0 = ret.Get(0).(int64) } if rf, ok := ret.Get(1).(func(*ethclient.Client, *coretypes.Header, int32) error); ok { - r1 = rf(_a0, header, buffer) + r1 = rf(client, header, buffer) } else { r1 = ret.Error(1) } @@ -596,23 +594,23 @@ func (_m *Utils) GetBufferedState(_a0 *ethclient.Client, header *coretypes.Heade return r0, r1 } -// GetCollection provides a mock function with given fields: _a0, collectionId -func (_m *Utils) GetCollection(_a0 *ethclient.Client, collectionId uint16) (bindings.StructsCollection, error) { - ret := _m.Called(_a0, collectionId) +// GetCollection provides a mock function with given fields: client, collectionId +func (_m *Utils) GetCollection(client *ethclient.Client, collectionId uint16) (bindings.StructsCollection, error) { + ret := _m.Called(client, collectionId) var r0 bindings.StructsCollection var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) (bindings.StructsCollection, error)); ok { - return rf(_a0, collectionId) + return rf(client, collectionId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) bindings.StructsCollection); ok { - r0 = rf(_a0, collectionId) + r0 = rf(client, collectionId) } else { r0 = ret.Get(0).(bindings.StructsCollection) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16) error); ok { - r1 = rf(_a0, collectionId) + r1 = rf(client, collectionId) } else { r1 = ret.Error(1) } @@ -620,23 +618,23 @@ func (_m *Utils) GetCollection(_a0 *ethclient.Client, collectionId uint16) (bind return r0, r1 } -// GetCollectionIdFromIndex provides a mock function with given fields: _a0, medianIndex -func (_m *Utils) GetCollectionIdFromIndex(_a0 *ethclient.Client, medianIndex uint16) (uint16, error) { - ret := _m.Called(_a0, medianIndex) +// GetCollectionIdFromIndex provides a mock function with given fields: client, medianIndex +func (_m *Utils) GetCollectionIdFromIndex(client *ethclient.Client, medianIndex uint16) (uint16, error) { + ret := _m.Called(client, medianIndex) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) (uint16, error)); ok { - return rf(_a0, medianIndex) + return rf(client, medianIndex) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) uint16); ok { - r0 = rf(_a0, medianIndex) + r0 = rf(client, medianIndex) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16) error); ok { - r1 = rf(_a0, medianIndex) + r1 = rf(client, medianIndex) } else { r1 = ret.Error(1) } @@ -644,23 +642,23 @@ func (_m *Utils) GetCollectionIdFromIndex(_a0 *ethclient.Client, medianIndex uin return r0, r1 } -// GetCollectionIdFromLeafId provides a mock function with given fields: _a0, leafId -func (_m *Utils) GetCollectionIdFromLeafId(_a0 *ethclient.Client, leafId uint16) (uint16, error) { - ret := _m.Called(_a0, leafId) +// GetCollectionIdFromLeafId provides a mock function with given fields: client, leafId +func (_m *Utils) GetCollectionIdFromLeafId(client *ethclient.Client, leafId uint16) (uint16, error) { + ret := _m.Called(client, leafId) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) (uint16, error)); ok { - return rf(_a0, leafId) + return rf(client, leafId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) uint16); ok { - r0 = rf(_a0, leafId) + r0 = rf(client, leafId) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16) error); ok { - r1 = rf(_a0, leafId) + r1 = rf(client, leafId) } else { r1 = ret.Error(1) } @@ -668,13 +666,13 @@ func (_m *Utils) GetCollectionIdFromLeafId(_a0 *ethclient.Client, leafId uint16) return r0, r1 } -// GetCollectionManager provides a mock function with given fields: _a0 -func (_m *Utils) GetCollectionManager(_a0 *ethclient.Client) *bindings.CollectionManager { - ret := _m.Called(_a0) +// GetCollectionManager provides a mock function with given fields: client +func (_m *Utils) GetCollectionManager(client *ethclient.Client) *bindings.CollectionManager { + ret := _m.Called(client) var r0 *bindings.CollectionManager if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.CollectionManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.CollectionManager) @@ -684,17 +682,17 @@ func (_m *Utils) GetCollectionManager(_a0 *ethclient.Client) *bindings.Collectio return r0 } -// GetCollectionManagerWithOpts provides a mock function with given fields: _a0 -func (_m *Utils) GetCollectionManagerWithOpts(_a0 *ethclient.Client) (*bindings.CollectionManager, bind.CallOpts) { - ret := _m.Called(_a0) +// GetCollectionManagerWithOpts provides a mock function with given fields: client +func (_m *Utils) GetCollectionManagerWithOpts(client *ethclient.Client) (*bindings.CollectionManager, bind.CallOpts) { + ret := _m.Called(client) var r0 *bindings.CollectionManager var r1 bind.CallOpts if rf, ok := ret.Get(0).(func(*ethclient.Client) (*bindings.CollectionManager, bind.CallOpts)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.CollectionManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.CollectionManager) @@ -702,7 +700,7 @@ func (_m *Utils) GetCollectionManagerWithOpts(_a0 *ethclient.Client) (*bindings. } if rf, ok := ret.Get(1).(func(*ethclient.Client) bind.CallOpts); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Get(1).(bind.CallOpts) } @@ -710,23 +708,23 @@ func (_m *Utils) GetCollectionManagerWithOpts(_a0 *ethclient.Client) (*bindings. return r0, r1 } -// GetCommitment provides a mock function with given fields: _a0, address -func (_m *Utils) GetCommitment(_a0 *ethclient.Client, address string) (types.Commitment, error) { - ret := _m.Called(_a0, address) +// GetCommitment provides a mock function with given fields: client, address +func (_m *Utils) GetCommitment(client *ethclient.Client, address string) (types.Commitment, error) { + ret := _m.Called(client, address) var r0 types.Commitment var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, string) (types.Commitment, error)); ok { - return rf(_a0, address) + return rf(client, address) } if rf, ok := ret.Get(0).(func(*ethclient.Client, string) types.Commitment); ok { - r0 = rf(_a0, address) + r0 = rf(client, address) } else { r0 = ret.Get(0).(types.Commitment) } if rf, ok := ret.Get(1).(func(*ethclient.Client, string) error); ok { - r1 = rf(_a0, address) + r1 = rf(client, address) } else { r1 = ret.Error(1) } @@ -734,25 +732,25 @@ func (_m *Utils) GetCommitment(_a0 *ethclient.Client, address string) (types.Com return r0, r1 } -// GetDataToCommitFromJob provides a mock function with given fields: job, localCache, httpClient -func (_m *Utils) GetDataToCommitFromJob(job bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) (*big.Int, error) { - ret := _m.Called(job, localCache, httpClient) +// GetDataToCommitFromJob provides a mock function with given fields: job, commitParams +func (_m *Utils) GetDataToCommitFromJob(job bindings.StructsJob, commitParams types.CommitParams) (*big.Int, error) { + ret := _m.Called(job, commitParams) var r0 *big.Int var r1 error - if rf, ok := ret.Get(0).(func(bindings.StructsJob, *cache.LocalCache, *client.HttpClient) (*big.Int, error)); ok { - return rf(job, localCache, httpClient) + if rf, ok := ret.Get(0).(func(bindings.StructsJob, types.CommitParams) (*big.Int, error)); ok { + return rf(job, commitParams) } - if rf, ok := ret.Get(0).(func(bindings.StructsJob, *cache.LocalCache, *client.HttpClient) *big.Int); ok { - r0 = rf(job, localCache, httpClient) + if rf, ok := ret.Get(0).(func(bindings.StructsJob, types.CommitParams) *big.Int); ok { + r0 = rf(job, commitParams) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) } } - if rf, ok := ret.Get(1).(func(bindings.StructsJob, *cache.LocalCache, *client.HttpClient) error); ok { - r1 = rf(job, localCache, httpClient) + if rf, ok := ret.Get(1).(func(bindings.StructsJob, types.CommitParams) error); ok { + r1 = rf(job, commitParams) } else { r1 = ret.Error(1) } @@ -760,25 +758,25 @@ func (_m *Utils) GetDataToCommitFromJob(job bindings.StructsJob, localCache *cac return r0, r1 } -// GetDataToCommitFromJobs provides a mock function with given fields: jobs, localCache, httpClient -func (_m *Utils) GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCache *cache.LocalCache, httpClient *client.HttpClient) ([]*big.Int, []uint8) { - ret := _m.Called(jobs, localCache, httpClient) +// GetDataToCommitFromJobs provides a mock function with given fields: jobs, commitParams +func (_m *Utils) GetDataToCommitFromJobs(jobs []bindings.StructsJob, commitParams types.CommitParams) ([]*big.Int, []uint8) { + ret := _m.Called(jobs, commitParams) var r0 []*big.Int var r1 []uint8 - if rf, ok := ret.Get(0).(func([]bindings.StructsJob, *cache.LocalCache, *client.HttpClient) ([]*big.Int, []uint8)); ok { - return rf(jobs, localCache, httpClient) + if rf, ok := ret.Get(0).(func([]bindings.StructsJob, types.CommitParams) ([]*big.Int, []uint8)); ok { + return rf(jobs, commitParams) } - if rf, ok := ret.Get(0).(func([]bindings.StructsJob, *cache.LocalCache, *client.HttpClient) []*big.Int); ok { - r0 = rf(jobs, localCache, httpClient) + if rf, ok := ret.Get(0).(func([]bindings.StructsJob, types.CommitParams) []*big.Int); ok { + r0 = rf(jobs, commitParams) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*big.Int) } } - if rf, ok := ret.Get(1).(func([]bindings.StructsJob, *cache.LocalCache, *client.HttpClient) []uint8); ok { - r1 = rf(jobs, localCache, httpClient) + if rf, ok := ret.Get(1).(func([]bindings.StructsJob, types.CommitParams) []uint8); ok { + r1 = rf(jobs, commitParams) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]uint8) @@ -788,23 +786,23 @@ func (_m *Utils) GetDataToCommitFromJobs(jobs []bindings.StructsJob, localCache return r0, r1 } -// GetEpoch provides a mock function with given fields: _a0 -func (_m *Utils) GetEpoch(_a0 *ethclient.Client) (uint32, error) { - ret := _m.Called(_a0) +// GetEpoch provides a mock function with given fields: client +func (_m *Utils) GetEpoch(client *ethclient.Client) (uint32, error) { + ret := _m.Called(client) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint32, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint32); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -812,23 +810,23 @@ func (_m *Utils) GetEpoch(_a0 *ethclient.Client) (uint32, error) { return r0, r1 } -// GetEpochLastCommitted provides a mock function with given fields: _a0, stakerId -func (_m *Utils) GetEpochLastCommitted(_a0 *ethclient.Client, stakerId uint32) (uint32, error) { - ret := _m.Called(_a0, stakerId) +// GetEpochLastCommitted provides a mock function with given fields: client, stakerId +func (_m *Utils) GetEpochLastCommitted(client *ethclient.Client, stakerId uint32) (uint32, error) { + ret := _m.Called(client, stakerId) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (uint32, error)); ok { - return rf(_a0, stakerId) + return rf(client, stakerId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) uint32); ok { - r0 = rf(_a0, stakerId) + r0 = rf(client, stakerId) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, stakerId) + r1 = rf(client, stakerId) } else { r1 = ret.Error(1) } @@ -836,23 +834,23 @@ func (_m *Utils) GetEpochLastCommitted(_a0 *ethclient.Client, stakerId uint32) ( return r0, r1 } -// GetEpochLastProposed provides a mock function with given fields: _a0, stakerId -func (_m *Utils) GetEpochLastProposed(_a0 *ethclient.Client, stakerId uint32) (uint32, error) { - ret := _m.Called(_a0, stakerId) +// GetEpochLastProposed provides a mock function with given fields: client, stakerId +func (_m *Utils) GetEpochLastProposed(client *ethclient.Client, stakerId uint32) (uint32, error) { + ret := _m.Called(client, stakerId) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (uint32, error)); ok { - return rf(_a0, stakerId) + return rf(client, stakerId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) uint32); ok { - r0 = rf(_a0, stakerId) + r0 = rf(client, stakerId) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, stakerId) + r1 = rf(client, stakerId) } else { r1 = ret.Error(1) } @@ -860,23 +858,23 @@ func (_m *Utils) GetEpochLastProposed(_a0 *ethclient.Client, stakerId uint32) (u return r0, r1 } -// GetEpochLastRevealed provides a mock function with given fields: _a0, stakerId -func (_m *Utils) GetEpochLastRevealed(_a0 *ethclient.Client, stakerId uint32) (uint32, error) { - ret := _m.Called(_a0, stakerId) +// GetEpochLastRevealed provides a mock function with given fields: client, stakerId +func (_m *Utils) GetEpochLastRevealed(client *ethclient.Client, stakerId uint32) (uint32, error) { + ret := _m.Called(client, stakerId) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (uint32, error)); ok { - return rf(_a0, stakerId) + return rf(client, stakerId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) uint32); ok { - r0 = rf(_a0, stakerId) + r0 = rf(client, stakerId) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, stakerId) + r1 = rf(client, stakerId) } else { r1 = ret.Error(1) } @@ -884,23 +882,23 @@ func (_m *Utils) GetEpochLastRevealed(_a0 *ethclient.Client, stakerId uint32) (u return r0, r1 } -// GetEpochLimitForUpdateCommission provides a mock function with given fields: _a0 -func (_m *Utils) GetEpochLimitForUpdateCommission(_a0 *ethclient.Client) (uint16, error) { - ret := _m.Called(_a0) +// GetEpochLimitForUpdateCommission provides a mock function with given fields: client +func (_m *Utils) GetEpochLimitForUpdateCommission(client *ethclient.Client) (uint16, error) { + ret := _m.Called(client) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -908,17 +906,17 @@ func (_m *Utils) GetEpochLimitForUpdateCommission(_a0 *ethclient.Client) (uint16 return r0, r1 } -// GetInfluenceSnapshot provides a mock function with given fields: _a0, stakerId, epoch -func (_m *Utils) GetInfluenceSnapshot(_a0 *ethclient.Client, stakerId uint32, epoch uint32) (*big.Int, error) { - ret := _m.Called(_a0, stakerId, epoch) +// GetInfluenceSnapshot provides a mock function with given fields: client, stakerId, epoch +func (_m *Utils) GetInfluenceSnapshot(client *ethclient.Client, stakerId uint32, epoch uint32) (*big.Int, error) { + ret := _m.Called(client, stakerId, epoch) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) (*big.Int, error)); ok { - return rf(_a0, stakerId, epoch) + return rf(client, stakerId, epoch) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) *big.Int); ok { - r0 = rf(_a0, stakerId, epoch) + r0 = rf(client, stakerId, epoch) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -926,7 +924,7 @@ func (_m *Utils) GetInfluenceSnapshot(_a0 *ethclient.Client, stakerId uint32, ep } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint32) error); ok { - r1 = rf(_a0, stakerId, epoch) + r1 = rf(client, stakerId, epoch) } else { r1 = ret.Error(1) } @@ -934,17 +932,17 @@ func (_m *Utils) GetInfluenceSnapshot(_a0 *ethclient.Client, stakerId uint32, ep return r0, r1 } -// GetJobs provides a mock function with given fields: _a0 -func (_m *Utils) GetJobs(_a0 *ethclient.Client) ([]bindings.StructsJob, error) { - ret := _m.Called(_a0) +// GetJobs provides a mock function with given fields: client +func (_m *Utils) GetJobs(client *ethclient.Client) ([]bindings.StructsJob, error) { + ret := _m.Called(client) var r0 []bindings.StructsJob var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) ([]bindings.StructsJob, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) []bindings.StructsJob); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]bindings.StructsJob) @@ -952,7 +950,7 @@ func (_m *Utils) GetJobs(_a0 *ethclient.Client) ([]bindings.StructsJob, error) { } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -960,23 +958,23 @@ func (_m *Utils) GetJobs(_a0 *ethclient.Client) ([]bindings.StructsJob, error) { return r0, r1 } -// GetLeafIdOfACollection provides a mock function with given fields: _a0, collectionId -func (_m *Utils) GetLeafIdOfACollection(_a0 *ethclient.Client, collectionId uint16) (uint16, error) { - ret := _m.Called(_a0, collectionId) +// GetLeafIdOfACollection provides a mock function with given fields: client, collectionId +func (_m *Utils) GetLeafIdOfACollection(client *ethclient.Client, collectionId uint16) (uint16, error) { + ret := _m.Called(client, collectionId) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) (uint16, error)); ok { - return rf(_a0, collectionId) + return rf(client, collectionId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint16) uint16); ok { - r0 = rf(_a0, collectionId) + r0 = rf(client, collectionId) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint16) error); ok { - r1 = rf(_a0, collectionId) + r1 = rf(client, collectionId) } else { r1 = ret.Error(1) } @@ -984,23 +982,23 @@ func (_m *Utils) GetLeafIdOfACollection(_a0 *ethclient.Client, collectionId uint return r0, r1 } -// GetLock provides a mock function with given fields: _a0, address, stakerId, lockType -func (_m *Utils) GetLock(_a0 *ethclient.Client, address string, stakerId uint32, lockType uint8) (types.Locks, error) { - ret := _m.Called(_a0, address, stakerId, lockType) +// GetLock provides a mock function with given fields: client, address, stakerId, lockType +func (_m *Utils) GetLock(client *ethclient.Client, address string, stakerId uint32, lockType uint8) (types.Locks, error) { + ret := _m.Called(client, address, stakerId, lockType) var r0 types.Locks var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, string, uint32, uint8) (types.Locks, error)); ok { - return rf(_a0, address, stakerId, lockType) + return rf(client, address, stakerId, lockType) } if rf, ok := ret.Get(0).(func(*ethclient.Client, string, uint32, uint8) types.Locks); ok { - r0 = rf(_a0, address, stakerId, lockType) + r0 = rf(client, address, stakerId, lockType) } else { r0 = ret.Get(0).(types.Locks) } if rf, ok := ret.Get(1).(func(*ethclient.Client, string, uint32, uint8) error); ok { - r1 = rf(_a0, address, stakerId, lockType) + r1 = rf(client, address, stakerId, lockType) } else { r1 = ret.Error(1) } @@ -1008,23 +1006,23 @@ func (_m *Utils) GetLock(_a0 *ethclient.Client, address string, stakerId uint32, return r0, r1 } -// GetMaxAltBlocks provides a mock function with given fields: _a0 -func (_m *Utils) GetMaxAltBlocks(_a0 *ethclient.Client) (uint8, error) { - ret := _m.Called(_a0) +// GetMaxAltBlocks provides a mock function with given fields: client +func (_m *Utils) GetMaxAltBlocks(client *ethclient.Client) (uint8, error) { + ret := _m.Called(client) var r0 uint8 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint8, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint8); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint8) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1032,23 +1030,23 @@ func (_m *Utils) GetMaxAltBlocks(_a0 *ethclient.Client) (uint8, error) { return r0, r1 } -// GetMaxCommission provides a mock function with given fields: _a0 -func (_m *Utils) GetMaxCommission(_a0 *ethclient.Client) (uint8, error) { - ret := _m.Called(_a0) +// GetMaxCommission provides a mock function with given fields: client +func (_m *Utils) GetMaxCommission(client *ethclient.Client) (uint8, error) { + ret := _m.Called(client) var r0 uint8 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint8, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint8); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint8) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1056,17 +1054,17 @@ func (_m *Utils) GetMaxCommission(_a0 *ethclient.Client) (uint8, error) { return r0, r1 } -// GetMinSafeRazor provides a mock function with given fields: _a0 -func (_m *Utils) GetMinSafeRazor(_a0 *ethclient.Client) (*big.Int, error) { - ret := _m.Called(_a0) +// GetMinSafeRazor provides a mock function with given fields: client +func (_m *Utils) GetMinSafeRazor(client *ethclient.Client) (*big.Int, error) { + ret := _m.Called(client) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (*big.Int, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *big.Int); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1074,7 +1072,7 @@ func (_m *Utils) GetMinSafeRazor(_a0 *ethclient.Client) (*big.Int, error) { } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1082,17 +1080,17 @@ func (_m *Utils) GetMinSafeRazor(_a0 *ethclient.Client) (*big.Int, error) { return r0, r1 } -// GetMinStakeAmount provides a mock function with given fields: _a0 -func (_m *Utils) GetMinStakeAmount(_a0 *ethclient.Client) (*big.Int, error) { - ret := _m.Called(_a0) +// GetMinStakeAmount provides a mock function with given fields: client +func (_m *Utils) GetMinStakeAmount(client *ethclient.Client) (*big.Int, error) { + ret := _m.Called(client) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (*big.Int, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *big.Int); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1100,7 +1098,7 @@ func (_m *Utils) GetMinStakeAmount(_a0 *ethclient.Client) (*big.Int, error) { } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1108,23 +1106,23 @@ func (_m *Utils) GetMinStakeAmount(_a0 *ethclient.Client) (*big.Int, error) { return r0, r1 } -// GetNumActiveCollections provides a mock function with given fields: _a0 -func (_m *Utils) GetNumActiveCollections(_a0 *ethclient.Client) (uint16, error) { - ret := _m.Called(_a0) +// GetNumActiveCollections provides a mock function with given fields: client +func (_m *Utils) GetNumActiveCollections(client *ethclient.Client) (uint16, error) { + ret := _m.Called(client) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1132,23 +1130,23 @@ func (_m *Utils) GetNumActiveCollections(_a0 *ethclient.Client) (uint16, error) return r0, r1 } -// GetNumCollections provides a mock function with given fields: _a0 -func (_m *Utils) GetNumCollections(_a0 *ethclient.Client) (uint16, error) { - ret := _m.Called(_a0) +// GetNumCollections provides a mock function with given fields: client +func (_m *Utils) GetNumCollections(client *ethclient.Client) (uint16, error) { + ret := _m.Called(client) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1156,23 +1154,23 @@ func (_m *Utils) GetNumCollections(_a0 *ethclient.Client) (uint16, error) { return r0, r1 } -// GetNumberOfProposedBlocks provides a mock function with given fields: _a0, epoch -func (_m *Utils) GetNumberOfProposedBlocks(_a0 *ethclient.Client, epoch uint32) (uint8, error) { - ret := _m.Called(_a0, epoch) +// GetNumberOfProposedBlocks provides a mock function with given fields: client, epoch +func (_m *Utils) GetNumberOfProposedBlocks(client *ethclient.Client, epoch uint32) (uint8, error) { + ret := _m.Called(client, epoch) var r0 uint8 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (uint8, error)); ok { - return rf(_a0, epoch) + return rf(client, epoch) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) uint8); ok { - r0 = rf(_a0, epoch) + r0 = rf(client, epoch) } else { r0 = ret.Get(0).(uint8) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, epoch) + r1 = rf(client, epoch) } else { r1 = ret.Error(1) } @@ -1180,23 +1178,23 @@ func (_m *Utils) GetNumberOfProposedBlocks(_a0 *ethclient.Client, epoch uint32) return r0, r1 } -// GetNumberOfStakers provides a mock function with given fields: _a0 -func (_m *Utils) GetNumberOfStakers(_a0 *ethclient.Client) (uint32, error) { - ret := _m.Called(_a0) +// GetNumberOfStakers provides a mock function with given fields: client +func (_m *Utils) GetNumberOfStakers(client *ethclient.Client) (uint32, error) { + ret := _m.Called(client) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint32, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint32); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1218,23 +1216,23 @@ func (_m *Utils) GetOptions() bind.CallOpts { return r0 } -// GetProposedBlock provides a mock function with given fields: _a0, epoch, proposedBlockId -func (_m *Utils) GetProposedBlock(_a0 *ethclient.Client, epoch uint32, proposedBlockId uint32) (bindings.StructsBlock, error) { - ret := _m.Called(_a0, epoch, proposedBlockId) +// GetProposedBlock provides a mock function with given fields: client, epoch, proposedBlockId +func (_m *Utils) GetProposedBlock(client *ethclient.Client, epoch uint32, proposedBlockId uint32) (bindings.StructsBlock, error) { + ret := _m.Called(client, epoch, proposedBlockId) var r0 bindings.StructsBlock var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) (bindings.StructsBlock, error)); ok { - return rf(_a0, epoch, proposedBlockId) + return rf(client, epoch, proposedBlockId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) bindings.StructsBlock); ok { - r0 = rf(_a0, epoch, proposedBlockId) + r0 = rf(client, epoch, proposedBlockId) } else { r0 = ret.Get(0).(bindings.StructsBlock) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint32) error); ok { - r1 = rf(_a0, epoch, proposedBlockId) + r1 = rf(client, epoch, proposedBlockId) } else { r1 = ret.Error(1) } @@ -1242,23 +1240,23 @@ func (_m *Utils) GetProposedBlock(_a0 *ethclient.Client, epoch uint32, proposedB return r0, r1 } -// GetRemainingTimeOfCurrentState provides a mock function with given fields: _a0, bufferPercent -func (_m *Utils) GetRemainingTimeOfCurrentState(_a0 *ethclient.Client, bufferPercent int32) (int64, error) { - ret := _m.Called(_a0, bufferPercent) +// GetRemainingTimeOfCurrentState provides a mock function with given fields: client, bufferPercent +func (_m *Utils) GetRemainingTimeOfCurrentState(client *ethclient.Client, bufferPercent int32) (int64, error) { + ret := _m.Called(client, bufferPercent) var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, int32) (int64, error)); ok { - return rf(_a0, bufferPercent) + return rf(client, bufferPercent) } if rf, ok := ret.Get(0).(func(*ethclient.Client, int32) int64); ok { - r0 = rf(_a0, bufferPercent) + r0 = rf(client, bufferPercent) } else { r0 = ret.Get(0).(int64) } if rf, ok := ret.Get(1).(func(*ethclient.Client, int32) error); ok { - r1 = rf(_a0, bufferPercent) + r1 = rf(client, bufferPercent) } else { r1 = ret.Error(1) } @@ -1282,23 +1280,23 @@ func (_m *Utils) GetRogueRandomValue(value int) *big.Int { return r0 } -// GetSortedProposedBlockId provides a mock function with given fields: _a0, epoch, index -func (_m *Utils) GetSortedProposedBlockId(_a0 *ethclient.Client, epoch uint32, index *big.Int) (uint32, error) { - ret := _m.Called(_a0, epoch, index) +// GetSortedProposedBlockId provides a mock function with given fields: client, epoch, index +func (_m *Utils) GetSortedProposedBlockId(client *ethclient.Client, epoch uint32, index *big.Int) (uint32, error) { + ret := _m.Called(client, epoch, index) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, *big.Int) (uint32, error)); ok { - return rf(_a0, epoch, index) + return rf(client, epoch, index) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, *big.Int) uint32); ok { - r0 = rf(_a0, epoch, index) + r0 = rf(client, epoch, index) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, *big.Int) error); ok { - r1 = rf(_a0, epoch, index) + r1 = rf(client, epoch, index) } else { r1 = ret.Error(1) } @@ -1306,17 +1304,17 @@ func (_m *Utils) GetSortedProposedBlockId(_a0 *ethclient.Client, epoch uint32, i return r0, r1 } -// GetSortedProposedBlockIds provides a mock function with given fields: _a0, epoch -func (_m *Utils) GetSortedProposedBlockIds(_a0 *ethclient.Client, epoch uint32) ([]uint32, error) { - ret := _m.Called(_a0, epoch) +// GetSortedProposedBlockIds provides a mock function with given fields: client, epoch +func (_m *Utils) GetSortedProposedBlockIds(client *ethclient.Client, epoch uint32) ([]uint32, error) { + ret := _m.Called(client, epoch) var r0 []uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) ([]uint32, error)); ok { - return rf(_a0, epoch) + return rf(client, epoch) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) []uint32); ok { - r0 = rf(_a0, epoch) + r0 = rf(client, epoch) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint32) @@ -1324,7 +1322,7 @@ func (_m *Utils) GetSortedProposedBlockIds(_a0 *ethclient.Client, epoch uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, epoch) + r1 = rf(client, epoch) } else { r1 = ret.Error(1) } @@ -1332,17 +1330,17 @@ func (_m *Utils) GetSortedProposedBlockIds(_a0 *ethclient.Client, epoch uint32) return r0, r1 } -// GetStake provides a mock function with given fields: _a0, stakerId -func (_m *Utils) GetStake(_a0 *ethclient.Client, stakerId uint32) (*big.Int, error) { - ret := _m.Called(_a0, stakerId) +// GetStake provides a mock function with given fields: client, stakerId +func (_m *Utils) GetStake(client *ethclient.Client, stakerId uint32) (*big.Int, error) { + ret := _m.Called(client, stakerId) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (*big.Int, error)); ok { - return rf(_a0, stakerId) + return rf(client, stakerId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) *big.Int); ok { - r0 = rf(_a0, stakerId) + r0 = rf(client, stakerId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1350,7 +1348,7 @@ func (_m *Utils) GetStake(_a0 *ethclient.Client, stakerId uint32) (*big.Int, err } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, stakerId) + r1 = rf(client, stakerId) } else { r1 = ret.Error(1) } @@ -1358,13 +1356,13 @@ func (_m *Utils) GetStake(_a0 *ethclient.Client, stakerId uint32) (*big.Int, err return r0, r1 } -// GetStakeManager provides a mock function with given fields: _a0 -func (_m *Utils) GetStakeManager(_a0 *ethclient.Client) *bindings.StakeManager { - ret := _m.Called(_a0) +// GetStakeManager provides a mock function with given fields: client +func (_m *Utils) GetStakeManager(client *ethclient.Client) *bindings.StakeManager { + ret := _m.Called(client) var r0 *bindings.StakeManager if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.StakeManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.StakeManager) @@ -1374,17 +1372,17 @@ func (_m *Utils) GetStakeManager(_a0 *ethclient.Client) *bindings.StakeManager { return r0 } -// GetStakeManagerWithOpts provides a mock function with given fields: _a0 -func (_m *Utils) GetStakeManagerWithOpts(_a0 *ethclient.Client) (*bindings.StakeManager, bind.CallOpts) { - ret := _m.Called(_a0) +// GetStakeManagerWithOpts provides a mock function with given fields: client +func (_m *Utils) GetStakeManagerWithOpts(client *ethclient.Client) (*bindings.StakeManager, bind.CallOpts) { + ret := _m.Called(client) var r0 *bindings.StakeManager var r1 bind.CallOpts if rf, ok := ret.Get(0).(func(*ethclient.Client) (*bindings.StakeManager, bind.CallOpts)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.StakeManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.StakeManager) @@ -1392,7 +1390,7 @@ func (_m *Utils) GetStakeManagerWithOpts(_a0 *ethclient.Client) (*bindings.Stake } if rf, ok := ret.Get(1).(func(*ethclient.Client) bind.CallOpts); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Get(1).(bind.CallOpts) } @@ -1400,17 +1398,17 @@ func (_m *Utils) GetStakeManagerWithOpts(_a0 *ethclient.Client) (*bindings.Stake return r0, r1 } -// GetStakeSnapshot provides a mock function with given fields: _a0, stakerId, epoch -func (_m *Utils) GetStakeSnapshot(_a0 *ethclient.Client, stakerId uint32, epoch uint32) (*big.Int, error) { - ret := _m.Called(_a0, stakerId, epoch) +// GetStakeSnapshot provides a mock function with given fields: client, stakerId, epoch +func (_m *Utils) GetStakeSnapshot(client *ethclient.Client, stakerId uint32, epoch uint32) (*big.Int, error) { + ret := _m.Called(client, stakerId, epoch) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) (*big.Int, error)); ok { - return rf(_a0, stakerId, epoch) + return rf(client, stakerId, epoch) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32) *big.Int); ok { - r0 = rf(_a0, stakerId, epoch) + r0 = rf(client, stakerId, epoch) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1418,7 +1416,7 @@ func (_m *Utils) GetStakeSnapshot(_a0 *ethclient.Client, stakerId uint32, epoch } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint32) error); ok { - r1 = rf(_a0, stakerId, epoch) + r1 = rf(client, stakerId, epoch) } else { r1 = ret.Error(1) } @@ -1426,13 +1424,13 @@ func (_m *Utils) GetStakeSnapshot(_a0 *ethclient.Client, stakerId uint32, epoch return r0, r1 } -// GetStakedToken provides a mock function with given fields: _a0, tokenAddress -func (_m *Utils) GetStakedToken(_a0 *ethclient.Client, tokenAddress common.Address) *bindings.StakedToken { - ret := _m.Called(_a0, tokenAddress) +// GetStakedToken provides a mock function with given fields: client, tokenAddress +func (_m *Utils) GetStakedToken(client *ethclient.Client, tokenAddress common.Address) *bindings.StakedToken { + ret := _m.Called(client, tokenAddress) var r0 *bindings.StakedToken if rf, ok := ret.Get(0).(func(*ethclient.Client, common.Address) *bindings.StakedToken); ok { - r0 = rf(_a0, tokenAddress) + r0 = rf(client, tokenAddress) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.StakedToken) @@ -1442,17 +1440,17 @@ func (_m *Utils) GetStakedToken(_a0 *ethclient.Client, tokenAddress common.Addre return r0 } -// GetStakedTokenManagerWithOpts provides a mock function with given fields: _a0, tokenAddress -func (_m *Utils) GetStakedTokenManagerWithOpts(_a0 *ethclient.Client, tokenAddress common.Address) (*bindings.StakedToken, bind.CallOpts) { - ret := _m.Called(_a0, tokenAddress) +// GetStakedTokenManagerWithOpts provides a mock function with given fields: client, tokenAddress +func (_m *Utils) GetStakedTokenManagerWithOpts(client *ethclient.Client, tokenAddress common.Address) (*bindings.StakedToken, bind.CallOpts) { + ret := _m.Called(client, tokenAddress) var r0 *bindings.StakedToken var r1 bind.CallOpts if rf, ok := ret.Get(0).(func(*ethclient.Client, common.Address) (*bindings.StakedToken, bind.CallOpts)); ok { - return rf(_a0, tokenAddress) + return rf(client, tokenAddress) } if rf, ok := ret.Get(0).(func(*ethclient.Client, common.Address) *bindings.StakedToken); ok { - r0 = rf(_a0, tokenAddress) + r0 = rf(client, tokenAddress) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.StakedToken) @@ -1460,7 +1458,7 @@ func (_m *Utils) GetStakedTokenManagerWithOpts(_a0 *ethclient.Client, tokenAddre } if rf, ok := ret.Get(1).(func(*ethclient.Client, common.Address) bind.CallOpts); ok { - r1 = rf(_a0, tokenAddress) + r1 = rf(client, tokenAddress) } else { r1 = ret.Get(1).(bind.CallOpts) } @@ -1468,23 +1466,23 @@ func (_m *Utils) GetStakedTokenManagerWithOpts(_a0 *ethclient.Client, tokenAddre return r0, r1 } -// GetStaker provides a mock function with given fields: _a0, stakerId -func (_m *Utils) GetStaker(_a0 *ethclient.Client, stakerId uint32) (bindings.StructsStaker, error) { - ret := _m.Called(_a0, stakerId) +// GetStaker provides a mock function with given fields: client, stakerId +func (_m *Utils) GetStaker(client *ethclient.Client, stakerId uint32) (bindings.StructsStaker, error) { + ret := _m.Called(client, stakerId) var r0 bindings.StructsStaker var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) (bindings.StructsStaker, error)); ok { - return rf(_a0, stakerId) + return rf(client, stakerId) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32) bindings.StructsStaker); ok { - r0 = rf(_a0, stakerId) + r0 = rf(client, stakerId) } else { r0 = ret.Get(0).(bindings.StructsStaker) } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32) error); ok { - r1 = rf(_a0, stakerId) + r1 = rf(client, stakerId) } else { r1 = ret.Error(1) } @@ -1492,23 +1490,23 @@ func (_m *Utils) GetStaker(_a0 *ethclient.Client, stakerId uint32) (bindings.Str return r0, r1 } -// GetStakerId provides a mock function with given fields: _a0, address -func (_m *Utils) GetStakerId(_a0 *ethclient.Client, address string) (uint32, error) { - ret := _m.Called(_a0, address) +// GetStakerId provides a mock function with given fields: client, address +func (_m *Utils) GetStakerId(client *ethclient.Client, address string) (uint32, error) { + ret := _m.Called(client, address) var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, string) (uint32, error)); ok { - return rf(_a0, address) + return rf(client, address) } if rf, ok := ret.Get(0).(func(*ethclient.Client, string) uint32); ok { - r0 = rf(_a0, address) + r0 = rf(client, address) } else { r0 = ret.Get(0).(uint32) } if rf, ok := ret.Get(1).(func(*ethclient.Client, string) error); ok { - r1 = rf(_a0, address) + r1 = rf(client, address) } else { r1 = ret.Error(1) } @@ -1516,17 +1514,17 @@ func (_m *Utils) GetStakerId(_a0 *ethclient.Client, address string) (uint32, err return r0, r1 } -// GetStakerSRZRBalance provides a mock function with given fields: _a0, staker -func (_m *Utils) GetStakerSRZRBalance(_a0 *ethclient.Client, staker bindings.StructsStaker) (*big.Int, error) { - ret := _m.Called(_a0, staker) +// GetStakerSRZRBalance provides a mock function with given fields: client, staker +func (_m *Utils) GetStakerSRZRBalance(client *ethclient.Client, staker bindings.StructsStaker) (*big.Int, error) { + ret := _m.Called(client, staker) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, bindings.StructsStaker) (*big.Int, error)); ok { - return rf(_a0, staker) + return rf(client, staker) } if rf, ok := ret.Get(0).(func(*ethclient.Client, bindings.StructsStaker) *big.Int); ok { - r0 = rf(_a0, staker) + r0 = rf(client, staker) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1534,7 +1532,7 @@ func (_m *Utils) GetStakerSRZRBalance(_a0 *ethclient.Client, staker bindings.Str } if rf, ok := ret.Get(1).(func(*ethclient.Client, bindings.StructsStaker) error); ok { - r1 = rf(_a0, staker) + r1 = rf(client, staker) } else { r1 = ret.Error(1) } @@ -1542,23 +1540,23 @@ func (_m *Utils) GetStakerSRZRBalance(_a0 *ethclient.Client, staker bindings.Str return r0, r1 } -// GetStateBuffer provides a mock function with given fields: _a0 -func (_m *Utils) GetStateBuffer(_a0 *ethclient.Client) (uint64, error) { - ret := _m.Called(_a0) +// GetStateBuffer provides a mock function with given fields: client +func (_m *Utils) GetStateBuffer(client *ethclient.Client) (uint64, error) { + ret := _m.Called(client) var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint64, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint64); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint64) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1566,13 +1564,13 @@ func (_m *Utils) GetStateBuffer(_a0 *ethclient.Client) (uint64, error) { return r0, r1 } -// GetTokenManager provides a mock function with given fields: _a0 -func (_m *Utils) GetTokenManager(_a0 *ethclient.Client) *bindings.RAZOR { - ret := _m.Called(_a0) +// GetTokenManager provides a mock function with given fields: client +func (_m *Utils) GetTokenManager(client *ethclient.Client) *bindings.RAZOR { + ret := _m.Called(client) var r0 *bindings.RAZOR if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.RAZOR); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.RAZOR) @@ -1582,17 +1580,17 @@ func (_m *Utils) GetTokenManager(_a0 *ethclient.Client) *bindings.RAZOR { return r0 } -// GetTotalInfluenceRevealed provides a mock function with given fields: _a0, epoch, medianIndex -func (_m *Utils) GetTotalInfluenceRevealed(_a0 *ethclient.Client, epoch uint32, medianIndex uint16) (*big.Int, error) { - ret := _m.Called(_a0, epoch, medianIndex) +// GetTotalInfluenceRevealed provides a mock function with given fields: client, epoch, medianIndex +func (_m *Utils) GetTotalInfluenceRevealed(client *ethclient.Client, epoch uint32, medianIndex uint16) (*big.Int, error) { + ret := _m.Called(client, epoch, medianIndex) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint16) (*big.Int, error)); ok { - return rf(_a0, epoch, medianIndex) + return rf(client, epoch, medianIndex) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint16) *big.Int); ok { - r0 = rf(_a0, epoch, medianIndex) + r0 = rf(client, epoch, medianIndex) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1600,7 +1598,7 @@ func (_m *Utils) GetTotalInfluenceRevealed(_a0 *ethclient.Client, epoch uint32, } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint16) error); ok { - r1 = rf(_a0, epoch, medianIndex) + r1 = rf(client, epoch, medianIndex) } else { r1 = ret.Error(1) } @@ -1648,13 +1646,13 @@ func (_m *Utils) GetUint32(flagSet *pflag.FlagSet, name string) (uint32, error) return r0, r1 } -// GetVoteManager provides a mock function with given fields: _a0 -func (_m *Utils) GetVoteManager(_a0 *ethclient.Client) *bindings.VoteManager { - ret := _m.Called(_a0) +// GetVoteManager provides a mock function with given fields: client +func (_m *Utils) GetVoteManager(client *ethclient.Client) *bindings.VoteManager { + ret := _m.Called(client) var r0 *bindings.VoteManager if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.VoteManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.VoteManager) @@ -1664,17 +1662,17 @@ func (_m *Utils) GetVoteManager(_a0 *ethclient.Client) *bindings.VoteManager { return r0 } -// GetVoteManagerWithOpts provides a mock function with given fields: _a0 -func (_m *Utils) GetVoteManagerWithOpts(_a0 *ethclient.Client) (*bindings.VoteManager, bind.CallOpts) { - ret := _m.Called(_a0) +// GetVoteManagerWithOpts provides a mock function with given fields: client +func (_m *Utils) GetVoteManagerWithOpts(client *ethclient.Client) (*bindings.VoteManager, bind.CallOpts) { + ret := _m.Called(client) var r0 *bindings.VoteManager var r1 bind.CallOpts if rf, ok := ret.Get(0).(func(*ethclient.Client) (*bindings.VoteManager, bind.CallOpts)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) *bindings.VoteManager); ok { - r0 = rf(_a0) + r0 = rf(client) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*bindings.VoteManager) @@ -1682,7 +1680,7 @@ func (_m *Utils) GetVoteManagerWithOpts(_a0 *ethclient.Client) (*bindings.VoteMa } if rf, ok := ret.Get(1).(func(*ethclient.Client) bind.CallOpts); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Get(1).(bind.CallOpts) } @@ -1690,17 +1688,17 @@ func (_m *Utils) GetVoteManagerWithOpts(_a0 *ethclient.Client) (*bindings.VoteMa return r0, r1 } -// GetVoteValue provides a mock function with given fields: _a0, epoch, stakerId, medianIndex -func (_m *Utils) GetVoteValue(_a0 *ethclient.Client, epoch uint32, stakerId uint32, medianIndex uint16) (*big.Int, error) { - ret := _m.Called(_a0, epoch, stakerId, medianIndex) +// GetVoteValue provides a mock function with given fields: client, epoch, stakerId, medianIndex +func (_m *Utils) GetVoteValue(client *ethclient.Client, epoch uint32, stakerId uint32, medianIndex uint16) (*big.Int, error) { + ret := _m.Called(client, epoch, stakerId, medianIndex) var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32, uint16) (*big.Int, error)); ok { - return rf(_a0, epoch, stakerId, medianIndex) + return rf(client, epoch, stakerId, medianIndex) } if rf, ok := ret.Get(0).(func(*ethclient.Client, uint32, uint32, uint16) *big.Int); ok { - r0 = rf(_a0, epoch, stakerId, medianIndex) + r0 = rf(client, epoch, stakerId, medianIndex) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) @@ -1708,7 +1706,7 @@ func (_m *Utils) GetVoteValue(_a0 *ethclient.Client, epoch uint32, stakerId uint } if rf, ok := ret.Get(1).(func(*ethclient.Client, uint32, uint32, uint16) error); ok { - r1 = rf(_a0, epoch, stakerId, medianIndex) + r1 = rf(client, epoch, stakerId, medianIndex) } else { r1 = ret.Error(1) } @@ -1716,23 +1714,23 @@ func (_m *Utils) GetVoteValue(_a0 *ethclient.Client, epoch uint32, stakerId uint return r0, r1 } -// GetWithdrawInitiationPeriod provides a mock function with given fields: _a0 -func (_m *Utils) GetWithdrawInitiationPeriod(_a0 *ethclient.Client) (uint16, error) { - ret := _m.Called(_a0) +// GetWithdrawInitiationPeriod provides a mock function with given fields: client +func (_m *Utils) GetWithdrawInitiationPeriod(client *ethclient.Client) (uint16, error) { + ret := _m.Called(client) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1740,17 +1738,17 @@ func (_m *Utils) GetWithdrawInitiationPeriod(_a0 *ethclient.Client) (uint16, err return r0, r1 } -// HandleOfficialJobsFromJSONFile provides a mock function with given fields: _a0, collection, dataString, commitParams -func (_m *Utils) HandleOfficialJobsFromJSONFile(_a0 *ethclient.Client, collection bindings.StructsCollection, dataString string, commitParams types.CommitParams) ([]bindings.StructsJob, []uint16) { - ret := _m.Called(_a0, collection, dataString, commitParams) +// HandleOfficialJobsFromJSONFile provides a mock function with given fields: client, collection, dataString, commitParams +func (_m *Utils) HandleOfficialJobsFromJSONFile(client *ethclient.Client, collection bindings.StructsCollection, dataString string, commitParams types.CommitParams) ([]bindings.StructsJob, []uint16) { + ret := _m.Called(client, collection, dataString, commitParams) var r0 []bindings.StructsJob var r1 []uint16 if rf, ok := ret.Get(0).(func(*ethclient.Client, bindings.StructsCollection, string, types.CommitParams) ([]bindings.StructsJob, []uint16)); ok { - return rf(_a0, collection, dataString, commitParams) + return rf(client, collection, dataString, commitParams) } if rf, ok := ret.Get(0).(func(*ethclient.Client, bindings.StructsCollection, string, types.CommitParams) []bindings.StructsJob); ok { - r0 = rf(_a0, collection, dataString, commitParams) + r0 = rf(client, collection, dataString, commitParams) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]bindings.StructsJob) @@ -1758,7 +1756,7 @@ func (_m *Utils) HandleOfficialJobsFromJSONFile(_a0 *ethclient.Client, collectio } if rf, ok := ret.Get(1).(func(*ethclient.Client, bindings.StructsCollection, string, types.CommitParams) []uint16); ok { - r1 = rf(_a0, collection, dataString, commitParams) + r1 = rf(client, collection, dataString, commitParams) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]uint16) @@ -1868,13 +1866,13 @@ func (_m *Utils) ReadJSONData(fileName string) (map[string]*types.StructsJob, er return r0, r1 } -// ResetAssetCache provides a mock function with given fields: _a0, jobsCache, collectionsCache -func (_m *Utils) ResetAssetCache(_a0 *ethclient.Client, jobsCache *cache.JobsCache, collectionsCache *cache.CollectionsCache) error { - ret := _m.Called(_a0, jobsCache, collectionsCache) +// ResetAssetCache provides a mock function with given fields: client, jobsCache, collectionsCache +func (_m *Utils) ResetAssetCache(client *ethclient.Client, jobsCache *cache.JobsCache, collectionsCache *cache.CollectionsCache) error { + ret := _m.Called(client, jobsCache, collectionsCache) var r0 error if rf, ok := ret.Get(0).(func(*ethclient.Client, *cache.JobsCache, *cache.CollectionsCache) error); ok { - r0 = rf(_a0, jobsCache, collectionsCache) + r0 = rf(client, jobsCache, collectionsCache) } else { r0 = ret.Error(0) } @@ -1896,23 +1894,23 @@ func (_m *Utils) SecondsToReadableTime(input int) string { return r0 } -// ToAssign provides a mock function with given fields: _a0 -func (_m *Utils) ToAssign(_a0 *ethclient.Client) (uint16, error) { - ret := _m.Called(_a0) +// ToAssign provides a mock function with given fields: client +func (_m *Utils) ToAssign(client *ethclient.Client) (uint16, error) { + ret := _m.Called(client) var r0 uint16 var r1 error if rf, ok := ret.Get(0).(func(*ethclient.Client) (uint16, error)); ok { - return rf(_a0) + return rf(client) } if rf, ok := ret.Get(0).(func(*ethclient.Client) uint16); ok { - r0 = rf(_a0) + r0 = rf(client) } else { r0 = ret.Get(0).(uint16) } if rf, ok := ret.Get(1).(func(*ethclient.Client) error); ok { - r1 = rf(_a0) + r1 = rf(client) } else { r1 = ret.Error(1) } @@ -1920,13 +1918,13 @@ func (_m *Utils) ToAssign(_a0 *ethclient.Client) (uint16, error) { return r0, r1 } -// WaitForBlockCompletion provides a mock function with given fields: _a0, hashToRead -func (_m *Utils) WaitForBlockCompletion(_a0 *ethclient.Client, hashToRead string) error { - ret := _m.Called(_a0, hashToRead) +// WaitForBlockCompletion provides a mock function with given fields: client, hashToRead +func (_m *Utils) WaitForBlockCompletion(client *ethclient.Client, hashToRead string) error { + ret := _m.Called(client, hashToRead) var r0 error if rf, ok := ret.Get(0).(func(*ethclient.Client, string) error); ok { - r0 = rf(_a0, hashToRead) + r0 = rf(client, hashToRead) } else { r0 = ret.Error(0) }