github.com/0chain/gosdk@v1.17.11/zcnbridge/mocks/EthereumClient.go (about) 1 // Code generated by mockery v2.28.1. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 big "math/big" 8 9 common "github.com/ethereum/go-ethereum/common" 10 11 ethereum "github.com/ethereum/go-ethereum" 12 13 mock "github.com/stretchr/testify/mock" 14 15 types "github.com/ethereum/go-ethereum/core/types" 16 ) 17 18 // EthereumClient is an autogenerated mock type for the EthereumClient type 19 type EthereumClient struct { 20 mock.Mock 21 } 22 23 // CallContract provides a mock function with given fields: ctx, call, blockNumber 24 func (_m *EthereumClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { 25 ret := _m.Called(ctx, call, blockNumber) 26 27 var r0 []byte 28 var r1 error 29 if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)); ok { 30 return rf(ctx, call, blockNumber) 31 } 32 if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) []byte); ok { 33 r0 = rf(ctx, call, blockNumber) 34 } else { 35 if ret.Get(0) != nil { 36 r0 = ret.Get(0).([]byte) 37 } 38 } 39 40 if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg, *big.Int) error); ok { 41 r1 = rf(ctx, call, blockNumber) 42 } else { 43 r1 = ret.Error(1) 44 } 45 46 return r0, r1 47 } 48 49 // ChainID provides a mock function with given fields: ctx 50 func (_m *EthereumClient) ChainID(ctx context.Context) (*big.Int, error) { 51 ret := _m.Called(ctx) 52 53 var r0 *big.Int 54 var r1 error 55 if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { 56 return rf(ctx) 57 } 58 if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { 59 r0 = rf(ctx) 60 } else { 61 if ret.Get(0) != nil { 62 r0 = ret.Get(0).(*big.Int) 63 } 64 } 65 66 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 67 r1 = rf(ctx) 68 } else { 69 r1 = ret.Error(1) 70 } 71 72 return r0, r1 73 } 74 75 // CodeAt provides a mock function with given fields: ctx, contract, blockNumber 76 func (_m *EthereumClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) { 77 ret := _m.Called(ctx, contract, blockNumber) 78 79 var r0 []byte 80 var r1 error 81 if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) ([]byte, error)); ok { 82 return rf(ctx, contract, blockNumber) 83 } 84 if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) []byte); ok { 85 r0 = rf(ctx, contract, blockNumber) 86 } else { 87 if ret.Get(0) != nil { 88 r0 = ret.Get(0).([]byte) 89 } 90 } 91 92 if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { 93 r1 = rf(ctx, contract, blockNumber) 94 } else { 95 r1 = ret.Error(1) 96 } 97 98 return r0, r1 99 } 100 101 // EstimateGas provides a mock function with given fields: ctx, call 102 func (_m *EthereumClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { 103 ret := _m.Called(ctx, call) 104 105 var r0 uint64 106 var r1 error 107 if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) (uint64, error)); ok { 108 return rf(ctx, call) 109 } 110 if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) uint64); ok { 111 r0 = rf(ctx, call) 112 } else { 113 r0 = ret.Get(0).(uint64) 114 } 115 116 if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg) error); ok { 117 r1 = rf(ctx, call) 118 } else { 119 r1 = ret.Error(1) 120 } 121 122 return r0, r1 123 } 124 125 // FilterLogs provides a mock function with given fields: ctx, query 126 func (_m *EthereumClient) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) { 127 ret := _m.Called(ctx, query) 128 129 var r0 []types.Log 130 var r1 error 131 if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery) ([]types.Log, error)); ok { 132 return rf(ctx, query) 133 } 134 if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery) []types.Log); ok { 135 r0 = rf(ctx, query) 136 } else { 137 if ret.Get(0) != nil { 138 r0 = ret.Get(0).([]types.Log) 139 } 140 } 141 142 if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery) error); ok { 143 r1 = rf(ctx, query) 144 } else { 145 r1 = ret.Error(1) 146 } 147 148 return r0, r1 149 } 150 151 // HeaderByNumber provides a mock function with given fields: ctx, number 152 func (_m *EthereumClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { 153 ret := _m.Called(ctx, number) 154 155 var r0 *types.Header 156 var r1 error 157 if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok { 158 return rf(ctx, number) 159 } 160 if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok { 161 r0 = rf(ctx, number) 162 } else { 163 if ret.Get(0) != nil { 164 r0 = ret.Get(0).(*types.Header) 165 } 166 } 167 168 if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { 169 r1 = rf(ctx, number) 170 } else { 171 r1 = ret.Error(1) 172 } 173 174 return r0, r1 175 } 176 177 // PendingCodeAt provides a mock function with given fields: ctx, account 178 func (_m *EthereumClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { 179 ret := _m.Called(ctx, account) 180 181 var r0 []byte 182 var r1 error 183 if rf, ok := ret.Get(0).(func(context.Context, common.Address) ([]byte, error)); ok { 184 return rf(ctx, account) 185 } 186 if rf, ok := ret.Get(0).(func(context.Context, common.Address) []byte); ok { 187 r0 = rf(ctx, account) 188 } else { 189 if ret.Get(0) != nil { 190 r0 = ret.Get(0).([]byte) 191 } 192 } 193 194 if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { 195 r1 = rf(ctx, account) 196 } else { 197 r1 = ret.Error(1) 198 } 199 200 return r0, r1 201 } 202 203 // PendingNonceAt provides a mock function with given fields: ctx, account 204 func (_m *EthereumClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { 205 ret := _m.Called(ctx, account) 206 207 var r0 uint64 208 var r1 error 209 if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok { 210 return rf(ctx, account) 211 } 212 if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok { 213 r0 = rf(ctx, account) 214 } else { 215 r0 = ret.Get(0).(uint64) 216 } 217 218 if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { 219 r1 = rf(ctx, account) 220 } else { 221 r1 = ret.Error(1) 222 } 223 224 return r0, r1 225 } 226 227 // SendTransaction provides a mock function with given fields: ctx, tx 228 func (_m *EthereumClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { 229 ret := _m.Called(ctx, tx) 230 231 var r0 error 232 if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) error); ok { 233 r0 = rf(ctx, tx) 234 } else { 235 r0 = ret.Error(0) 236 } 237 238 return r0 239 } 240 241 // SubscribeFilterLogs provides a mock function with given fields: ctx, query, ch 242 func (_m *EthereumClient) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { 243 ret := _m.Called(ctx, query, ch) 244 245 var r0 ethereum.Subscription 246 var r1 error 247 if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) (ethereum.Subscription, error)); ok { 248 return rf(ctx, query, ch) 249 } 250 if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) ethereum.Subscription); ok { 251 r0 = rf(ctx, query, ch) 252 } else { 253 if ret.Get(0) != nil { 254 r0 = ret.Get(0).(ethereum.Subscription) 255 } 256 } 257 258 if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) error); ok { 259 r1 = rf(ctx, query, ch) 260 } else { 261 r1 = ret.Error(1) 262 } 263 264 return r0, r1 265 } 266 267 // SuggestGasPrice provides a mock function with given fields: ctx 268 func (_m *EthereumClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { 269 ret := _m.Called(ctx) 270 271 var r0 *big.Int 272 var r1 error 273 if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { 274 return rf(ctx) 275 } 276 if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { 277 r0 = rf(ctx) 278 } else { 279 if ret.Get(0) != nil { 280 r0 = ret.Get(0).(*big.Int) 281 } 282 } 283 284 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 285 r1 = rf(ctx) 286 } else { 287 r1 = ret.Error(1) 288 } 289 290 return r0, r1 291 } 292 293 // SuggestGasTipCap provides a mock function with given fields: ctx 294 func (_m *EthereumClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { 295 ret := _m.Called(ctx) 296 297 var r0 *big.Int 298 var r1 error 299 if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { 300 return rf(ctx) 301 } 302 if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { 303 r0 = rf(ctx) 304 } else { 305 if ret.Get(0) != nil { 306 r0 = ret.Get(0).(*big.Int) 307 } 308 } 309 310 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 311 r1 = rf(ctx) 312 } else { 313 r1 = ret.Error(1) 314 } 315 316 return r0, r1 317 } 318 319 type mockConstructorTestingTNewEthereumClient interface { 320 mock.TestingT 321 Cleanup(func()) 322 } 323 324 // NewEthereumClient creates a new instance of EthereumClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 325 func NewEthereumClient(t mockConstructorTestingTNewEthereumClient) *EthereumClient { 326 mock := &EthereumClient{} 327 mock.Mock.Test(t) 328 329 t.Cleanup(func() { mock.AssertExpectations(t) }) 330 331 return mock 332 }