// Code generated by mockery. DO NOT EDIT.

package mock_l2_shared

import (
	context "context"

	mock "github.com/stretchr/testify/mock"

	pgx "github.com/jackc/pgx/v4"

	state "github.com/0xPolygonHermez/zkevm-node/state"
)

// StateInterface is an autogenerated mock type for the StateInterface type
type StateInterface struct {
	mock.Mock
}

type StateInterface_Expecter struct {
	mock *mock.Mock
}

func (_m *StateInterface) EXPECT() *StateInterface_Expecter {
	return &StateInterface_Expecter{mock: &_m.Mock}
}

// BeginStateTransaction provides a mock function with given fields: ctx
func (_m *StateInterface) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for BeginStateTransaction")
	}

	var r0 pgx.Tx
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok {
		return rf(ctx)
	}
	if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(pgx.Tx)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// StateInterface_BeginStateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginStateTransaction'
type StateInterface_BeginStateTransaction_Call struct {
	*mock.Call
}

// BeginStateTransaction is a helper method to define mock.On call
//   - ctx context.Context
func (_e *StateInterface_Expecter) BeginStateTransaction(ctx interface{}) *StateInterface_BeginStateTransaction_Call {
	return &StateInterface_BeginStateTransaction_Call{Call: _e.mock.On("BeginStateTransaction", ctx)}
}

func (_c *StateInterface_BeginStateTransaction_Call) Run(run func(ctx context.Context)) *StateInterface_BeginStateTransaction_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

func (_c *StateInterface_BeginStateTransaction_Call) Return(_a0 pgx.Tx, _a1 error) *StateInterface_BeginStateTransaction_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *StateInterface_BeginStateTransaction_Call) RunAndReturn(run func(context.Context) (pgx.Tx, error)) *StateInterface_BeginStateTransaction_Call {
	_c.Call.Return(run)
	return _c
}

// GetBatchByNumber provides a mock function with given fields: ctx, batchNumber, dbTx
func (_m *StateInterface) GetBatchByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error) {
	ret := _m.Called(ctx, batchNumber, dbTx)

	if len(ret) == 0 {
		panic("no return value specified for GetBatchByNumber")
	}

	var r0 *state.Batch
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok {
		return rf(ctx, batchNumber, dbTx)
	}
	if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok {
		r0 = rf(ctx, batchNumber, dbTx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*state.Batch)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
		r1 = rf(ctx, batchNumber, dbTx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// StateInterface_GetBatchByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBatchByNumber'
type StateInterface_GetBatchByNumber_Call struct {
	*mock.Call
}

// GetBatchByNumber is a helper method to define mock.On call
//   - ctx context.Context
//   - batchNumber uint64
//   - dbTx pgx.Tx
func (_e *StateInterface_Expecter) GetBatchByNumber(ctx interface{}, batchNumber interface{}, dbTx interface{}) *StateInterface_GetBatchByNumber_Call {
	return &StateInterface_GetBatchByNumber_Call{Call: _e.mock.On("GetBatchByNumber", ctx, batchNumber, dbTx)}
}

func (_c *StateInterface_GetBatchByNumber_Call) Run(run func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx)) *StateInterface_GetBatchByNumber_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(uint64), args[2].(pgx.Tx))
	})
	return _c
}

func (_c *StateInterface_GetBatchByNumber_Call) Return(_a0 *state.Batch, _a1 error) *StateInterface_GetBatchByNumber_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *StateInterface_GetBatchByNumber_Call) RunAndReturn(run func(context.Context, uint64, pgx.Tx) (*state.Batch, error)) *StateInterface_GetBatchByNumber_Call {
	_c.Call.Return(run)
	return _c
}

// NewStateInterface creates a new instance of StateInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewStateInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *StateInterface {
	mock := &StateInterface{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
