github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/synchronizer/mock_etherman.go (about)

     1  // Code generated by mockery v2.22.1. DO NOT EDIT.
     2  
     3  package synchronizer
     4  
     5  import (
     6  	context "context"
     7  	big "math/big"
     8  
     9  	common "github.com/ethereum/go-ethereum/common"
    10  
    11  	etherman "github.com/0xPolygon/supernets2-node/etherman"
    12  
    13  	mock "github.com/stretchr/testify/mock"
    14  
    15  	state "github.com/0xPolygon/supernets2-node/state"
    16  
    17  	types "github.com/ethereum/go-ethereum/core/types"
    18  )
    19  
    20  // ethermanMock is an autogenerated mock type for the ethermanInterface type
    21  type ethermanMock struct {
    22  	mock.Mock
    23  }
    24  
    25  // EthBlockByNumber provides a mock function with given fields: ctx, blockNumber
    26  func (_m *ethermanMock) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error) {
    27  	ret := _m.Called(ctx, blockNumber)
    28  
    29  	var r0 *types.Block
    30  	var r1 error
    31  	if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Block, error)); ok {
    32  		return rf(ctx, blockNumber)
    33  	}
    34  	if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Block); ok {
    35  		r0 = rf(ctx, blockNumber)
    36  	} else {
    37  		if ret.Get(0) != nil {
    38  			r0 = ret.Get(0).(*types.Block)
    39  		}
    40  	}
    41  
    42  	if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
    43  		r1 = rf(ctx, blockNumber)
    44  	} else {
    45  		r1 = ret.Error(1)
    46  	}
    47  
    48  	return r0, r1
    49  }
    50  
    51  // GetCurrentDataCommittee provides a mock function with given fields:
    52  func (_m *ethermanMock) GetCurrentDataCommittee() (*etherman.DataCommittee, error) {
    53  	ret := _m.Called()
    54  
    55  	var r0 *etherman.DataCommittee
    56  	var r1 error
    57  	if rf, ok := ret.Get(0).(func() (*etherman.DataCommittee, error)); ok {
    58  		return rf()
    59  	}
    60  	if rf, ok := ret.Get(0).(func() *etherman.DataCommittee); ok {
    61  		r0 = rf()
    62  	} else {
    63  		if ret.Get(0) != nil {
    64  			r0 = ret.Get(0).(*etherman.DataCommittee)
    65  		}
    66  	}
    67  
    68  	if rf, ok := ret.Get(1).(func() error); ok {
    69  		r1 = rf()
    70  	} else {
    71  		r1 = ret.Error(1)
    72  	}
    73  
    74  	return r0, r1
    75  }
    76  
    77  // GetForks provides a mock function with given fields: ctx, genBlockNumber
    78  func (_m *ethermanMock) GetForks(ctx context.Context, genBlockNumber uint64) ([]state.ForkIDInterval, error) {
    79  	ret := _m.Called(ctx, genBlockNumber)
    80  
    81  	var r0 []state.ForkIDInterval
    82  	var r1 error
    83  	if rf, ok := ret.Get(0).(func(context.Context, uint64) ([]state.ForkIDInterval, error)); ok {
    84  		return rf(ctx, genBlockNumber)
    85  	}
    86  	if rf, ok := ret.Get(0).(func(context.Context, uint64) []state.ForkIDInterval); ok {
    87  		r0 = rf(ctx, genBlockNumber)
    88  	} else {
    89  		if ret.Get(0) != nil {
    90  			r0 = ret.Get(0).([]state.ForkIDInterval)
    91  		}
    92  	}
    93  
    94  	if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
    95  		r1 = rf(ctx, genBlockNumber)
    96  	} else {
    97  		r1 = ret.Error(1)
    98  	}
    99  
   100  	return r0, r1
   101  }
   102  
   103  // GetLatestBatchNumber provides a mock function with given fields:
   104  func (_m *ethermanMock) GetLatestBatchNumber() (uint64, error) {
   105  	ret := _m.Called()
   106  
   107  	var r0 uint64
   108  	var r1 error
   109  	if rf, ok := ret.Get(0).(func() (uint64, error)); ok {
   110  		return rf()
   111  	}
   112  	if rf, ok := ret.Get(0).(func() uint64); ok {
   113  		r0 = rf()
   114  	} else {
   115  		r0 = ret.Get(0).(uint64)
   116  	}
   117  
   118  	if rf, ok := ret.Get(1).(func() error); ok {
   119  		r1 = rf()
   120  	} else {
   121  		r1 = ret.Error(1)
   122  	}
   123  
   124  	return r0, r1
   125  }
   126  
   127  // GetLatestVerifiedBatchNum provides a mock function with given fields:
   128  func (_m *ethermanMock) GetLatestVerifiedBatchNum() (uint64, error) {
   129  	ret := _m.Called()
   130  
   131  	var r0 uint64
   132  	var r1 error
   133  	if rf, ok := ret.Get(0).(func() (uint64, error)); ok {
   134  		return rf()
   135  	}
   136  	if rf, ok := ret.Get(0).(func() uint64); ok {
   137  		r0 = rf()
   138  	} else {
   139  		r0 = ret.Get(0).(uint64)
   140  	}
   141  
   142  	if rf, ok := ret.Get(1).(func() error); ok {
   143  		r1 = rf()
   144  	} else {
   145  		r1 = ret.Error(1)
   146  	}
   147  
   148  	return r0, r1
   149  }
   150  
   151  // GetRollupInfoByBlockRange provides a mock function with given fields: ctx, fromBlock, toBlock
   152  func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error) {
   153  	ret := _m.Called(ctx, fromBlock, toBlock)
   154  
   155  	var r0 []etherman.Block
   156  	var r1 map[common.Hash][]etherman.Order
   157  	var r2 error
   158  	if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error)); ok {
   159  		return rf(ctx, fromBlock, toBlock)
   160  	}
   161  	if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) []etherman.Block); ok {
   162  		r0 = rf(ctx, fromBlock, toBlock)
   163  	} else {
   164  		if ret.Get(0) != nil {
   165  			r0 = ret.Get(0).([]etherman.Block)
   166  		}
   167  	}
   168  
   169  	if rf, ok := ret.Get(1).(func(context.Context, uint64, *uint64) map[common.Hash][]etherman.Order); ok {
   170  		r1 = rf(ctx, fromBlock, toBlock)
   171  	} else {
   172  		if ret.Get(1) != nil {
   173  			r1 = ret.Get(1).(map[common.Hash][]etherman.Order)
   174  		}
   175  	}
   176  
   177  	if rf, ok := ret.Get(2).(func(context.Context, uint64, *uint64) error); ok {
   178  		r2 = rf(ctx, fromBlock, toBlock)
   179  	} else {
   180  		r2 = ret.Error(2)
   181  	}
   182  
   183  	return r0, r1, r2
   184  }
   185  
   186  // GetTrustedSequencerURL provides a mock function with given fields:
   187  func (_m *ethermanMock) GetTrustedSequencerURL() (string, error) {
   188  	ret := _m.Called()
   189  
   190  	var r0 string
   191  	var r1 error
   192  	if rf, ok := ret.Get(0).(func() (string, error)); ok {
   193  		return rf()
   194  	}
   195  	if rf, ok := ret.Get(0).(func() string); ok {
   196  		r0 = rf()
   197  	} else {
   198  		r0 = ret.Get(0).(string)
   199  	}
   200  
   201  	if rf, ok := ret.Get(1).(func() error); ok {
   202  		r1 = rf()
   203  	} else {
   204  		r1 = ret.Error(1)
   205  	}
   206  
   207  	return r0, r1
   208  }
   209  
   210  // HeaderByNumber provides a mock function with given fields: ctx, number
   211  func (_m *ethermanMock) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
   212  	ret := _m.Called(ctx, number)
   213  
   214  	var r0 *types.Header
   215  	var r1 error
   216  	if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok {
   217  		return rf(ctx, number)
   218  	}
   219  	if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok {
   220  		r0 = rf(ctx, number)
   221  	} else {
   222  		if ret.Get(0) != nil {
   223  			r0 = ret.Get(0).(*types.Header)
   224  		}
   225  	}
   226  
   227  	if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok {
   228  		r1 = rf(ctx, number)
   229  	} else {
   230  		r1 = ret.Error(1)
   231  	}
   232  
   233  	return r0, r1
   234  }
   235  
   236  // VerifyGenBlockNumber provides a mock function with given fields: ctx, genBlockNumber
   237  func (_m *ethermanMock) VerifyGenBlockNumber(ctx context.Context, genBlockNumber uint64) (bool, error) {
   238  	ret := _m.Called(ctx, genBlockNumber)
   239  
   240  	var r0 bool
   241  	var r1 error
   242  	if rf, ok := ret.Get(0).(func(context.Context, uint64) (bool, error)); ok {
   243  		return rf(ctx, genBlockNumber)
   244  	}
   245  	if rf, ok := ret.Get(0).(func(context.Context, uint64) bool); ok {
   246  		r0 = rf(ctx, genBlockNumber)
   247  	} else {
   248  		r0 = ret.Get(0).(bool)
   249  	}
   250  
   251  	if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
   252  		r1 = rf(ctx, genBlockNumber)
   253  	} else {
   254  		r1 = ret.Error(1)
   255  	}
   256  
   257  	return r0, r1
   258  }
   259  
   260  type mockConstructorTestingTnewEthermanMock interface {
   261  	mock.TestingT
   262  	Cleanup(func())
   263  }
   264  
   265  // newEthermanMock creates a new instance of ethermanMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   266  func newEthermanMock(t mockConstructorTestingTnewEthermanMock) *ethermanMock {
   267  	mock := &ethermanMock{}
   268  	mock.Mock.Test(t)
   269  
   270  	t.Cleanup(func() { mock.AssertExpectations(t) })
   271  
   272  	return mock
   273  }