github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/jsonrpc/mocks/mock_state.go (about)

     1  // Code generated by mockery v2.22.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  	coretypes "github.com/ethereum/go-ethereum/core/types"
    12  
    13  	mock "github.com/stretchr/testify/mock"
    14  
    15  	pgx "github.com/jackc/pgx/v4"
    16  
    17  	runtime "github.com/0xPolygon/supernets2-node/state/runtime"
    18  
    19  	state "github.com/0xPolygon/supernets2-node/state"
    20  
    21  	time "time"
    22  )
    23  
    24  // StateMock is an autogenerated mock type for the StateInterface type
    25  type StateMock struct {
    26  	mock.Mock
    27  }
    28  
    29  // BatchNumberByL2BlockNumber provides a mock function with given fields: ctx, blockNumber, dbTx
    30  func (_m *StateMock) BatchNumberByL2BlockNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) {
    31  	ret := _m.Called(ctx, blockNumber, dbTx)
    32  
    33  	var r0 uint64
    34  	var r1 error
    35  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (uint64, error)); ok {
    36  		return rf(ctx, blockNumber, dbTx)
    37  	}
    38  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) uint64); ok {
    39  		r0 = rf(ctx, blockNumber, dbTx)
    40  	} else {
    41  		r0 = ret.Get(0).(uint64)
    42  	}
    43  
    44  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
    45  		r1 = rf(ctx, blockNumber, dbTx)
    46  	} else {
    47  		r1 = ret.Error(1)
    48  	}
    49  
    50  	return r0, r1
    51  }
    52  
    53  // BeginStateTransaction provides a mock function with given fields: ctx
    54  func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) {
    55  	ret := _m.Called(ctx)
    56  
    57  	var r0 pgx.Tx
    58  	var r1 error
    59  	if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok {
    60  		return rf(ctx)
    61  	}
    62  	if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok {
    63  		r0 = rf(ctx)
    64  	} else {
    65  		if ret.Get(0) != nil {
    66  			r0 = ret.Get(0).(pgx.Tx)
    67  		}
    68  	}
    69  
    70  	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
    71  		r1 = rf(ctx)
    72  	} else {
    73  		r1 = ret.Error(1)
    74  	}
    75  
    76  	return r0, r1
    77  }
    78  
    79  // DebugTransaction provides a mock function with given fields: ctx, transactionHash, traceConfig, dbTx
    80  func (_m *StateMock) DebugTransaction(ctx context.Context, transactionHash common.Hash, traceConfig state.TraceConfig, dbTx pgx.Tx) (*runtime.ExecutionResult, error) {
    81  	ret := _m.Called(ctx, transactionHash, traceConfig, dbTx)
    82  
    83  	var r0 *runtime.ExecutionResult
    84  	var r1 error
    85  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) (*runtime.ExecutionResult, error)); ok {
    86  		return rf(ctx, transactionHash, traceConfig, dbTx)
    87  	}
    88  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) *runtime.ExecutionResult); ok {
    89  		r0 = rf(ctx, transactionHash, traceConfig, dbTx)
    90  	} else {
    91  		if ret.Get(0) != nil {
    92  			r0 = ret.Get(0).(*runtime.ExecutionResult)
    93  		}
    94  	}
    95  
    96  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) error); ok {
    97  		r1 = rf(ctx, transactionHash, traceConfig, dbTx)
    98  	} else {
    99  		r1 = ret.Error(1)
   100  	}
   101  
   102  	return r0, r1
   103  }
   104  
   105  // EstimateGas provides a mock function with given fields: transaction, senderAddress, l2BlockNumber, dbTx
   106  func (_m *StateMock) EstimateGas(transaction *coretypes.Transaction, senderAddress common.Address, l2BlockNumber *uint64, dbTx pgx.Tx) (uint64, []byte, error) {
   107  	ret := _m.Called(transaction, senderAddress, l2BlockNumber, dbTx)
   108  
   109  	var r0 uint64
   110  	var r1 []byte
   111  	var r2 error
   112  	if rf, ok := ret.Get(0).(func(*coretypes.Transaction, common.Address, *uint64, pgx.Tx) (uint64, []byte, error)); ok {
   113  		return rf(transaction, senderAddress, l2BlockNumber, dbTx)
   114  	}
   115  	if rf, ok := ret.Get(0).(func(*coretypes.Transaction, common.Address, *uint64, pgx.Tx) uint64); ok {
   116  		r0 = rf(transaction, senderAddress, l2BlockNumber, dbTx)
   117  	} else {
   118  		r0 = ret.Get(0).(uint64)
   119  	}
   120  
   121  	if rf, ok := ret.Get(1).(func(*coretypes.Transaction, common.Address, *uint64, pgx.Tx) []byte); ok {
   122  		r1 = rf(transaction, senderAddress, l2BlockNumber, dbTx)
   123  	} else {
   124  		if ret.Get(1) != nil {
   125  			r1 = ret.Get(1).([]byte)
   126  		}
   127  	}
   128  
   129  	if rf, ok := ret.Get(2).(func(*coretypes.Transaction, common.Address, *uint64, pgx.Tx) error); ok {
   130  		r2 = rf(transaction, senderAddress, l2BlockNumber, dbTx)
   131  	} else {
   132  		r2 = ret.Error(2)
   133  	}
   134  
   135  	return r0, r1, r2
   136  }
   137  
   138  // GetBalance provides a mock function with given fields: ctx, address, root
   139  func (_m *StateMock) GetBalance(ctx context.Context, address common.Address, root common.Hash) (*big.Int, error) {
   140  	ret := _m.Called(ctx, address, root)
   141  
   142  	var r0 *big.Int
   143  	var r1 error
   144  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) (*big.Int, error)); ok {
   145  		return rf(ctx, address, root)
   146  	}
   147  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) *big.Int); ok {
   148  		r0 = rf(ctx, address, root)
   149  	} else {
   150  		if ret.Get(0) != nil {
   151  			r0 = ret.Get(0).(*big.Int)
   152  		}
   153  	}
   154  
   155  	if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok {
   156  		r1 = rf(ctx, address, root)
   157  	} else {
   158  		r1 = ret.Error(1)
   159  	}
   160  
   161  	return r0, r1
   162  }
   163  
   164  // GetBatchByNumber provides a mock function with given fields: ctx, batchNumber, dbTx
   165  func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error) {
   166  	ret := _m.Called(ctx, batchNumber, dbTx)
   167  
   168  	var r0 *state.Batch
   169  	var r1 error
   170  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok {
   171  		return rf(ctx, batchNumber, dbTx)
   172  	}
   173  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok {
   174  		r0 = rf(ctx, batchNumber, dbTx)
   175  	} else {
   176  		if ret.Get(0) != nil {
   177  			r0 = ret.Get(0).(*state.Batch)
   178  		}
   179  	}
   180  
   181  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   182  		r1 = rf(ctx, batchNumber, dbTx)
   183  	} else {
   184  		r1 = ret.Error(1)
   185  	}
   186  
   187  	return r0, r1
   188  }
   189  
   190  // GetCode provides a mock function with given fields: ctx, address, root
   191  func (_m *StateMock) GetCode(ctx context.Context, address common.Address, root common.Hash) ([]byte, error) {
   192  	ret := _m.Called(ctx, address, root)
   193  
   194  	var r0 []byte
   195  	var r1 error
   196  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) ([]byte, error)); ok {
   197  		return rf(ctx, address, root)
   198  	}
   199  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) []byte); ok {
   200  		r0 = rf(ctx, address, root)
   201  	} else {
   202  		if ret.Get(0) != nil {
   203  			r0 = ret.Get(0).([]byte)
   204  		}
   205  	}
   206  
   207  	if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok {
   208  		r1 = rf(ctx, address, root)
   209  	} else {
   210  		r1 = ret.Error(1)
   211  	}
   212  
   213  	return r0, r1
   214  }
   215  
   216  // GetExitRootByGlobalExitRoot provides a mock function with given fields: ctx, ger, dbTx
   217  func (_m *StateMock) GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error) {
   218  	ret := _m.Called(ctx, ger, dbTx)
   219  
   220  	var r0 *state.GlobalExitRoot
   221  	var r1 error
   222  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*state.GlobalExitRoot, error)); ok {
   223  		return rf(ctx, ger, dbTx)
   224  	}
   225  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *state.GlobalExitRoot); ok {
   226  		r0 = rf(ctx, ger, dbTx)
   227  	} else {
   228  		if ret.Get(0) != nil {
   229  			r0 = ret.Get(0).(*state.GlobalExitRoot)
   230  		}
   231  	}
   232  
   233  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok {
   234  		r1 = rf(ctx, ger, dbTx)
   235  	} else {
   236  		r1 = ret.Error(1)
   237  	}
   238  
   239  	return r0, r1
   240  }
   241  
   242  // GetL2BlockByHash provides a mock function with given fields: ctx, hash, dbTx
   243  func (_m *StateMock) GetL2BlockByHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*coretypes.Block, error) {
   244  	ret := _m.Called(ctx, hash, dbTx)
   245  
   246  	var r0 *coretypes.Block
   247  	var r1 error
   248  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*coretypes.Block, error)); ok {
   249  		return rf(ctx, hash, dbTx)
   250  	}
   251  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *coretypes.Block); ok {
   252  		r0 = rf(ctx, hash, dbTx)
   253  	} else {
   254  		if ret.Get(0) != nil {
   255  			r0 = ret.Get(0).(*coretypes.Block)
   256  		}
   257  	}
   258  
   259  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok {
   260  		r1 = rf(ctx, hash, dbTx)
   261  	} else {
   262  		r1 = ret.Error(1)
   263  	}
   264  
   265  	return r0, r1
   266  }
   267  
   268  // GetL2BlockByNumber provides a mock function with given fields: ctx, blockNumber, dbTx
   269  func (_m *StateMock) GetL2BlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*coretypes.Block, error) {
   270  	ret := _m.Called(ctx, blockNumber, dbTx)
   271  
   272  	var r0 *coretypes.Block
   273  	var r1 error
   274  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*coretypes.Block, error)); ok {
   275  		return rf(ctx, blockNumber, dbTx)
   276  	}
   277  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *coretypes.Block); ok {
   278  		r0 = rf(ctx, blockNumber, dbTx)
   279  	} else {
   280  		if ret.Get(0) != nil {
   281  			r0 = ret.Get(0).(*coretypes.Block)
   282  		}
   283  	}
   284  
   285  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   286  		r1 = rf(ctx, blockNumber, dbTx)
   287  	} else {
   288  		r1 = ret.Error(1)
   289  	}
   290  
   291  	return r0, r1
   292  }
   293  
   294  // GetL2BlockHashesSince provides a mock function with given fields: ctx, since, dbTx
   295  func (_m *StateMock) GetL2BlockHashesSince(ctx context.Context, since time.Time, dbTx pgx.Tx) ([]common.Hash, error) {
   296  	ret := _m.Called(ctx, since, dbTx)
   297  
   298  	var r0 []common.Hash
   299  	var r1 error
   300  	if rf, ok := ret.Get(0).(func(context.Context, time.Time, pgx.Tx) ([]common.Hash, error)); ok {
   301  		return rf(ctx, since, dbTx)
   302  	}
   303  	if rf, ok := ret.Get(0).(func(context.Context, time.Time, pgx.Tx) []common.Hash); ok {
   304  		r0 = rf(ctx, since, dbTx)
   305  	} else {
   306  		if ret.Get(0) != nil {
   307  			r0 = ret.Get(0).([]common.Hash)
   308  		}
   309  	}
   310  
   311  	if rf, ok := ret.Get(1).(func(context.Context, time.Time, pgx.Tx) error); ok {
   312  		r1 = rf(ctx, since, dbTx)
   313  	} else {
   314  		r1 = ret.Error(1)
   315  	}
   316  
   317  	return r0, r1
   318  }
   319  
   320  // GetL2BlockHeaderByNumber provides a mock function with given fields: ctx, blockNumber, dbTx
   321  func (_m *StateMock) GetL2BlockHeaderByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*coretypes.Header, error) {
   322  	ret := _m.Called(ctx, blockNumber, dbTx)
   323  
   324  	var r0 *coretypes.Header
   325  	var r1 error
   326  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*coretypes.Header, error)); ok {
   327  		return rf(ctx, blockNumber, dbTx)
   328  	}
   329  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *coretypes.Header); ok {
   330  		r0 = rf(ctx, blockNumber, dbTx)
   331  	} else {
   332  		if ret.Get(0) != nil {
   333  			r0 = ret.Get(0).(*coretypes.Header)
   334  		}
   335  	}
   336  
   337  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   338  		r1 = rf(ctx, blockNumber, dbTx)
   339  	} else {
   340  		r1 = ret.Error(1)
   341  	}
   342  
   343  	return r0, r1
   344  }
   345  
   346  // GetL2BlockTransactionCountByHash provides a mock function with given fields: ctx, hash, dbTx
   347  func (_m *StateMock) GetL2BlockTransactionCountByHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (uint64, error) {
   348  	ret := _m.Called(ctx, hash, dbTx)
   349  
   350  	var r0 uint64
   351  	var r1 error
   352  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (uint64, error)); ok {
   353  		return rf(ctx, hash, dbTx)
   354  	}
   355  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) uint64); ok {
   356  		r0 = rf(ctx, hash, dbTx)
   357  	} else {
   358  		r0 = ret.Get(0).(uint64)
   359  	}
   360  
   361  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok {
   362  		r1 = rf(ctx, hash, dbTx)
   363  	} else {
   364  		r1 = ret.Error(1)
   365  	}
   366  
   367  	return r0, r1
   368  }
   369  
   370  // GetL2BlockTransactionCountByNumber provides a mock function with given fields: ctx, blockNumber, dbTx
   371  func (_m *StateMock) GetL2BlockTransactionCountByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) {
   372  	ret := _m.Called(ctx, blockNumber, dbTx)
   373  
   374  	var r0 uint64
   375  	var r1 error
   376  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (uint64, error)); ok {
   377  		return rf(ctx, blockNumber, dbTx)
   378  	}
   379  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) uint64); ok {
   380  		r0 = rf(ctx, blockNumber, dbTx)
   381  	} else {
   382  		r0 = ret.Get(0).(uint64)
   383  	}
   384  
   385  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   386  		r1 = rf(ctx, blockNumber, dbTx)
   387  	} else {
   388  		r1 = ret.Error(1)
   389  	}
   390  
   391  	return r0, r1
   392  }
   393  
   394  // GetLastBatchNumber provides a mock function with given fields: ctx, dbTx
   395  func (_m *StateMock) GetLastBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) {
   396  	ret := _m.Called(ctx, dbTx)
   397  
   398  	var r0 uint64
   399  	var r1 error
   400  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok {
   401  		return rf(ctx, dbTx)
   402  	}
   403  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok {
   404  		r0 = rf(ctx, dbTx)
   405  	} else {
   406  		r0 = ret.Get(0).(uint64)
   407  	}
   408  
   409  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   410  		r1 = rf(ctx, dbTx)
   411  	} else {
   412  		r1 = ret.Error(1)
   413  	}
   414  
   415  	return r0, r1
   416  }
   417  
   418  // GetLastConsolidatedL2BlockNumber provides a mock function with given fields: ctx, dbTx
   419  func (_m *StateMock) GetLastConsolidatedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) {
   420  	ret := _m.Called(ctx, dbTx)
   421  
   422  	var r0 uint64
   423  	var r1 error
   424  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok {
   425  		return rf(ctx, dbTx)
   426  	}
   427  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok {
   428  		r0 = rf(ctx, dbTx)
   429  	} else {
   430  		r0 = ret.Get(0).(uint64)
   431  	}
   432  
   433  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   434  		r1 = rf(ctx, dbTx)
   435  	} else {
   436  		r1 = ret.Error(1)
   437  	}
   438  
   439  	return r0, r1
   440  }
   441  
   442  // GetLastL2Block provides a mock function with given fields: ctx, dbTx
   443  func (_m *StateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*coretypes.Block, error) {
   444  	ret := _m.Called(ctx, dbTx)
   445  
   446  	var r0 *coretypes.Block
   447  	var r1 error
   448  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*coretypes.Block, error)); ok {
   449  		return rf(ctx, dbTx)
   450  	}
   451  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *coretypes.Block); ok {
   452  		r0 = rf(ctx, dbTx)
   453  	} else {
   454  		if ret.Get(0) != nil {
   455  			r0 = ret.Get(0).(*coretypes.Block)
   456  		}
   457  	}
   458  
   459  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   460  		r1 = rf(ctx, dbTx)
   461  	} else {
   462  		r1 = ret.Error(1)
   463  	}
   464  
   465  	return r0, r1
   466  }
   467  
   468  // GetLastL2BlockNumber provides a mock function with given fields: ctx, dbTx
   469  func (_m *StateMock) GetLastL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) {
   470  	ret := _m.Called(ctx, dbTx)
   471  
   472  	var r0 uint64
   473  	var r1 error
   474  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok {
   475  		return rf(ctx, dbTx)
   476  	}
   477  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok {
   478  		r0 = rf(ctx, dbTx)
   479  	} else {
   480  		r0 = ret.Get(0).(uint64)
   481  	}
   482  
   483  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   484  		r1 = rf(ctx, dbTx)
   485  	} else {
   486  		r1 = ret.Error(1)
   487  	}
   488  
   489  	return r0, r1
   490  }
   491  
   492  // GetLastVerifiedBatch provides a mock function with given fields: ctx, dbTx
   493  func (_m *StateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*state.VerifiedBatch, error) {
   494  	ret := _m.Called(ctx, dbTx)
   495  
   496  	var r0 *state.VerifiedBatch
   497  	var r1 error
   498  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.VerifiedBatch, error)); ok {
   499  		return rf(ctx, dbTx)
   500  	}
   501  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.VerifiedBatch); ok {
   502  		r0 = rf(ctx, dbTx)
   503  	} else {
   504  		if ret.Get(0) != nil {
   505  			r0 = ret.Get(0).(*state.VerifiedBatch)
   506  		}
   507  	}
   508  
   509  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   510  		r1 = rf(ctx, dbTx)
   511  	} else {
   512  		r1 = ret.Error(1)
   513  	}
   514  
   515  	return r0, r1
   516  }
   517  
   518  // GetLastVirtualBatchNum provides a mock function with given fields: ctx, dbTx
   519  func (_m *StateMock) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (uint64, error) {
   520  	ret := _m.Called(ctx, dbTx)
   521  
   522  	var r0 uint64
   523  	var r1 error
   524  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok {
   525  		return rf(ctx, dbTx)
   526  	}
   527  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok {
   528  		r0 = rf(ctx, dbTx)
   529  	} else {
   530  		r0 = ret.Get(0).(uint64)
   531  	}
   532  
   533  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   534  		r1 = rf(ctx, dbTx)
   535  	} else {
   536  		r1 = ret.Error(1)
   537  	}
   538  
   539  	return r0, r1
   540  }
   541  
   542  // GetLastVirtualizedL2BlockNumber provides a mock function with given fields: ctx, dbTx
   543  func (_m *StateMock) GetLastVirtualizedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) {
   544  	ret := _m.Called(ctx, dbTx)
   545  
   546  	var r0 uint64
   547  	var r1 error
   548  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok {
   549  		return rf(ctx, dbTx)
   550  	}
   551  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok {
   552  		r0 = rf(ctx, dbTx)
   553  	} else {
   554  		r0 = ret.Get(0).(uint64)
   555  	}
   556  
   557  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   558  		r1 = rf(ctx, dbTx)
   559  	} else {
   560  		r1 = ret.Error(1)
   561  	}
   562  
   563  	return r0, r1
   564  }
   565  
   566  // GetLogs provides a mock function with given fields: ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx
   567  func (_m *StateMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64, addresses []common.Address, topics [][]common.Hash, blockHash *common.Hash, since *time.Time, dbTx pgx.Tx) ([]*coretypes.Log, error) {
   568  	ret := _m.Called(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx)
   569  
   570  	var r0 []*coretypes.Log
   571  	var r1 error
   572  	if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) ([]*coretypes.Log, error)); ok {
   573  		return rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx)
   574  	}
   575  	if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) []*coretypes.Log); ok {
   576  		r0 = rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx)
   577  	} else {
   578  		if ret.Get(0) != nil {
   579  			r0 = ret.Get(0).([]*coretypes.Log)
   580  		}
   581  	}
   582  
   583  	if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) error); ok {
   584  		r1 = rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx)
   585  	} else {
   586  		r1 = ret.Error(1)
   587  	}
   588  
   589  	return r0, r1
   590  }
   591  
   592  // GetNonce provides a mock function with given fields: ctx, address, root
   593  func (_m *StateMock) GetNonce(ctx context.Context, address common.Address, root common.Hash) (uint64, error) {
   594  	ret := _m.Called(ctx, address, root)
   595  
   596  	var r0 uint64
   597  	var r1 error
   598  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) (uint64, error)); ok {
   599  		return rf(ctx, address, root)
   600  	}
   601  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) uint64); ok {
   602  		r0 = rf(ctx, address, root)
   603  	} else {
   604  		r0 = ret.Get(0).(uint64)
   605  	}
   606  
   607  	if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok {
   608  		r1 = rf(ctx, address, root)
   609  	} else {
   610  		r1 = ret.Error(1)
   611  	}
   612  
   613  	return r0, r1
   614  }
   615  
   616  // GetStorageAt provides a mock function with given fields: ctx, address, position, root
   617  func (_m *StateMock) GetStorageAt(ctx context.Context, address common.Address, position *big.Int, root common.Hash) (*big.Int, error) {
   618  	ret := _m.Called(ctx, address, position, root)
   619  
   620  	var r0 *big.Int
   621  	var r1 error
   622  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int, common.Hash) (*big.Int, error)); ok {
   623  		return rf(ctx, address, position, root)
   624  	}
   625  	if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int, common.Hash) *big.Int); ok {
   626  		r0 = rf(ctx, address, position, root)
   627  	} else {
   628  		if ret.Get(0) != nil {
   629  			r0 = ret.Get(0).(*big.Int)
   630  		}
   631  	}
   632  
   633  	if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int, common.Hash) error); ok {
   634  		r1 = rf(ctx, address, position, root)
   635  	} else {
   636  		r1 = ret.Error(1)
   637  	}
   638  
   639  	return r0, r1
   640  }
   641  
   642  // GetSyncingInfo provides a mock function with given fields: ctx, dbTx
   643  func (_m *StateMock) GetSyncingInfo(ctx context.Context, dbTx pgx.Tx) (state.SyncingInfo, error) {
   644  	ret := _m.Called(ctx, dbTx)
   645  
   646  	var r0 state.SyncingInfo
   647  	var r1 error
   648  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (state.SyncingInfo, error)); ok {
   649  		return rf(ctx, dbTx)
   650  	}
   651  	if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) state.SyncingInfo); ok {
   652  		r0 = rf(ctx, dbTx)
   653  	} else {
   654  		r0 = ret.Get(0).(state.SyncingInfo)
   655  	}
   656  
   657  	if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok {
   658  		r1 = rf(ctx, dbTx)
   659  	} else {
   660  		r1 = ret.Error(1)
   661  	}
   662  
   663  	return r0, r1
   664  }
   665  
   666  // GetTransactionByHash provides a mock function with given fields: ctx, transactionHash, dbTx
   667  func (_m *StateMock) GetTransactionByHash(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*coretypes.Transaction, error) {
   668  	ret := _m.Called(ctx, transactionHash, dbTx)
   669  
   670  	var r0 *coretypes.Transaction
   671  	var r1 error
   672  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*coretypes.Transaction, error)); ok {
   673  		return rf(ctx, transactionHash, dbTx)
   674  	}
   675  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *coretypes.Transaction); ok {
   676  		r0 = rf(ctx, transactionHash, dbTx)
   677  	} else {
   678  		if ret.Get(0) != nil {
   679  			r0 = ret.Get(0).(*coretypes.Transaction)
   680  		}
   681  	}
   682  
   683  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok {
   684  		r1 = rf(ctx, transactionHash, dbTx)
   685  	} else {
   686  		r1 = ret.Error(1)
   687  	}
   688  
   689  	return r0, r1
   690  }
   691  
   692  // GetTransactionByL2BlockHashAndIndex provides a mock function with given fields: ctx, blockHash, index, dbTx
   693  func (_m *StateMock) GetTransactionByL2BlockHashAndIndex(ctx context.Context, blockHash common.Hash, index uint64, dbTx pgx.Tx) (*coretypes.Transaction, error) {
   694  	ret := _m.Called(ctx, blockHash, index, dbTx)
   695  
   696  	var r0 *coretypes.Transaction
   697  	var r1 error
   698  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, uint64, pgx.Tx) (*coretypes.Transaction, error)); ok {
   699  		return rf(ctx, blockHash, index, dbTx)
   700  	}
   701  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, uint64, pgx.Tx) *coretypes.Transaction); ok {
   702  		r0 = rf(ctx, blockHash, index, dbTx)
   703  	} else {
   704  		if ret.Get(0) != nil {
   705  			r0 = ret.Get(0).(*coretypes.Transaction)
   706  		}
   707  	}
   708  
   709  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, uint64, pgx.Tx) error); ok {
   710  		r1 = rf(ctx, blockHash, index, dbTx)
   711  	} else {
   712  		r1 = ret.Error(1)
   713  	}
   714  
   715  	return r0, r1
   716  }
   717  
   718  // GetTransactionByL2BlockNumberAndIndex provides a mock function with given fields: ctx, blockNumber, index, dbTx
   719  func (_m *StateMock) GetTransactionByL2BlockNumberAndIndex(ctx context.Context, blockNumber uint64, index uint64, dbTx pgx.Tx) (*coretypes.Transaction, error) {
   720  	ret := _m.Called(ctx, blockNumber, index, dbTx)
   721  
   722  	var r0 *coretypes.Transaction
   723  	var r1 error
   724  	if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) (*coretypes.Transaction, error)); ok {
   725  		return rf(ctx, blockNumber, index, dbTx)
   726  	}
   727  	if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) *coretypes.Transaction); ok {
   728  		r0 = rf(ctx, blockNumber, index, dbTx)
   729  	} else {
   730  		if ret.Get(0) != nil {
   731  			r0 = ret.Get(0).(*coretypes.Transaction)
   732  		}
   733  	}
   734  
   735  	if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, pgx.Tx) error); ok {
   736  		r1 = rf(ctx, blockNumber, index, dbTx)
   737  	} else {
   738  		r1 = ret.Error(1)
   739  	}
   740  
   741  	return r0, r1
   742  }
   743  
   744  // GetTransactionReceipt provides a mock function with given fields: ctx, transactionHash, dbTx
   745  func (_m *StateMock) GetTransactionReceipt(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*coretypes.Receipt, error) {
   746  	ret := _m.Called(ctx, transactionHash, dbTx)
   747  
   748  	var r0 *coretypes.Receipt
   749  	var r1 error
   750  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*coretypes.Receipt, error)); ok {
   751  		return rf(ctx, transactionHash, dbTx)
   752  	}
   753  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *coretypes.Receipt); ok {
   754  		r0 = rf(ctx, transactionHash, dbTx)
   755  	} else {
   756  		if ret.Get(0) != nil {
   757  			r0 = ret.Get(0).(*coretypes.Receipt)
   758  		}
   759  	}
   760  
   761  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok {
   762  		r1 = rf(ctx, transactionHash, dbTx)
   763  	} else {
   764  		r1 = ret.Error(1)
   765  	}
   766  
   767  	return r0, r1
   768  }
   769  
   770  // GetTransactionsByBatchNumber provides a mock function with given fields: ctx, batchNumber, dbTx
   771  func (_m *StateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]coretypes.Transaction, error) {
   772  	ret := _m.Called(ctx, batchNumber, dbTx)
   773  
   774  	var r0 []coretypes.Transaction
   775  	var r1 error
   776  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]coretypes.Transaction, error)); ok {
   777  		return rf(ctx, batchNumber, dbTx)
   778  	}
   779  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []coretypes.Transaction); ok {
   780  		r0 = rf(ctx, batchNumber, dbTx)
   781  	} else {
   782  		if ret.Get(0) != nil {
   783  			r0 = ret.Get(0).([]coretypes.Transaction)
   784  		}
   785  	}
   786  
   787  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   788  		r1 = rf(ctx, batchNumber, dbTx)
   789  	} else {
   790  		r1 = ret.Error(1)
   791  	}
   792  
   793  	return r0, r1
   794  }
   795  
   796  // GetVerifiedBatch provides a mock function with given fields: ctx, batchNumber, dbTx
   797  func (_m *StateMock) GetVerifiedBatch(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VerifiedBatch, error) {
   798  	ret := _m.Called(ctx, batchNumber, dbTx)
   799  
   800  	var r0 *state.VerifiedBatch
   801  	var r1 error
   802  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.VerifiedBatch, error)); ok {
   803  		return rf(ctx, batchNumber, dbTx)
   804  	}
   805  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.VerifiedBatch); ok {
   806  		r0 = rf(ctx, batchNumber, dbTx)
   807  	} else {
   808  		if ret.Get(0) != nil {
   809  			r0 = ret.Get(0).(*state.VerifiedBatch)
   810  		}
   811  	}
   812  
   813  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   814  		r1 = rf(ctx, batchNumber, dbTx)
   815  	} else {
   816  		r1 = ret.Error(1)
   817  	}
   818  
   819  	return r0, r1
   820  }
   821  
   822  // GetVirtualBatch provides a mock function with given fields: ctx, batchNumber, dbTx
   823  func (_m *StateMock) GetVirtualBatch(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VirtualBatch, error) {
   824  	ret := _m.Called(ctx, batchNumber, dbTx)
   825  
   826  	var r0 *state.VirtualBatch
   827  	var r1 error
   828  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.VirtualBatch, error)); ok {
   829  		return rf(ctx, batchNumber, dbTx)
   830  	}
   831  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.VirtualBatch); ok {
   832  		r0 = rf(ctx, batchNumber, dbTx)
   833  	} else {
   834  		if ret.Get(0) != nil {
   835  			r0 = ret.Get(0).(*state.VirtualBatch)
   836  		}
   837  	}
   838  
   839  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   840  		r1 = rf(ctx, batchNumber, dbTx)
   841  	} else {
   842  		r1 = ret.Error(1)
   843  	}
   844  
   845  	return r0, r1
   846  }
   847  
   848  // IsL2BlockConsolidated provides a mock function with given fields: ctx, blockNumber, dbTx
   849  func (_m *StateMock) IsL2BlockConsolidated(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) {
   850  	ret := _m.Called(ctx, blockNumber, dbTx)
   851  
   852  	var r0 bool
   853  	var r1 error
   854  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (bool, error)); ok {
   855  		return rf(ctx, blockNumber, dbTx)
   856  	}
   857  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) bool); ok {
   858  		r0 = rf(ctx, blockNumber, dbTx)
   859  	} else {
   860  		r0 = ret.Get(0).(bool)
   861  	}
   862  
   863  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   864  		r1 = rf(ctx, blockNumber, dbTx)
   865  	} else {
   866  		r1 = ret.Error(1)
   867  	}
   868  
   869  	return r0, r1
   870  }
   871  
   872  // IsL2BlockVirtualized provides a mock function with given fields: ctx, blockNumber, dbTx
   873  func (_m *StateMock) IsL2BlockVirtualized(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) {
   874  	ret := _m.Called(ctx, blockNumber, dbTx)
   875  
   876  	var r0 bool
   877  	var r1 error
   878  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (bool, error)); ok {
   879  		return rf(ctx, blockNumber, dbTx)
   880  	}
   881  	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) bool); ok {
   882  		r0 = rf(ctx, blockNumber, dbTx)
   883  	} else {
   884  		r0 = ret.Get(0).(bool)
   885  	}
   886  
   887  	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
   888  		r1 = rf(ctx, blockNumber, dbTx)
   889  	} else {
   890  		r1 = ret.Error(1)
   891  	}
   892  
   893  	return r0, r1
   894  }
   895  
   896  // PrepareWebSocket provides a mock function with given fields:
   897  func (_m *StateMock) PrepareWebSocket() {
   898  	_m.Called()
   899  }
   900  
   901  // ProcessUnsignedTransaction provides a mock function with given fields: ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx
   902  func (_m *StateMock) ProcessUnsignedTransaction(ctx context.Context, tx *coretypes.Transaction, senderAddress common.Address, l2BlockNumber *uint64, noZKEVMCounters bool, dbTx pgx.Tx) (*runtime.ExecutionResult, error) {
   903  	ret := _m.Called(ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx)
   904  
   905  	var r0 *runtime.ExecutionResult
   906  	var r1 error
   907  	if rf, ok := ret.Get(0).(func(context.Context, *coretypes.Transaction, common.Address, *uint64, bool, pgx.Tx) (*runtime.ExecutionResult, error)); ok {
   908  		return rf(ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx)
   909  	}
   910  	if rf, ok := ret.Get(0).(func(context.Context, *coretypes.Transaction, common.Address, *uint64, bool, pgx.Tx) *runtime.ExecutionResult); ok {
   911  		r0 = rf(ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx)
   912  	} else {
   913  		if ret.Get(0) != nil {
   914  			r0 = ret.Get(0).(*runtime.ExecutionResult)
   915  		}
   916  	}
   917  
   918  	if rf, ok := ret.Get(1).(func(context.Context, *coretypes.Transaction, common.Address, *uint64, bool, pgx.Tx) error); ok {
   919  		r1 = rf(ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx)
   920  	} else {
   921  		r1 = ret.Error(1)
   922  	}
   923  
   924  	return r0, r1
   925  }
   926  
   927  // RegisterNewL2BlockEventHandler provides a mock function with given fields: h
   928  func (_m *StateMock) RegisterNewL2BlockEventHandler(h state.NewL2BlockEventHandler) {
   929  	_m.Called(h)
   930  }
   931  
   932  type mockConstructorTestingTNewStateMock interface {
   933  	mock.TestingT
   934  	Cleanup(func())
   935  }
   936  
   937  // NewStateMock creates a new instance of StateMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   938  func NewStateMock(t mockConstructorTestingTNewStateMock) *StateMock {
   939  	mock := &StateMock{}
   940  	mock.Mock.Test(t)
   941  
   942  	t.Cleanup(func() { mock.AssertExpectations(t) })
   943  
   944  	return mock
   945  }