// Code generated by mockery. DO NOT EDIT.

package mock_syncinterfaces

import (
	context "context"

	pgx "github.com/jackc/pgx/v4"
	mock "github.com/stretchr/testify/mock"

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

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

type StateLastBlockGetter_Expecter struct {
	mock *mock.Mock
}

func (_m *StateLastBlockGetter) EXPECT() *StateLastBlockGetter_Expecter {
	return &StateLastBlockGetter_Expecter{mock: &_m.Mock}
}

// GetLastBlock provides a mock function with given fields: ctx, dbTx
func (_m *StateLastBlockGetter) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Block, error) {
	ret := _m.Called(ctx, dbTx)

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

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

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

	return r0, r1
}

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

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

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

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

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

// NewStateLastBlockGetter creates a new instance of StateLastBlockGetter. 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 NewStateLastBlockGetter(t interface {
	mock.TestingT
	Cleanup(func())
}) *StateLastBlockGetter {
	mock := &StateLastBlockGetter{}
	mock.Mock.Test(t)

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

	return mock
}
