// Code generated by mockery v2.53.3. DO NOT EDIT.

package mocks

import (
	api "github.com/ChainSafe/gossamer/internal/client/api"
	blockchain "github.com/ChainSafe/gossamer/internal/primitives/blockchain"

	kv "github.com/ChainSafe/gossamer/internal/primitives/kv"

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

	offchain "github.com/ChainSafe/gossamer/internal/primitives/core/offchain"

	runtime "github.com/ChainSafe/gossamer/internal/primitives/runtime"

	statemachine "github.com/ChainSafe/gossamer/internal/primitives/state-machine"

	sync "sync"
)

// Backend is an autogenerated mock type for the Backend type
type Backend[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	mock.Mock
}

type Backend_Expecter[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	mock *mock.Mock
}

func (_m *Backend[H, N, Hasher, Header, E]) EXPECT() *Backend_Expecter[H, N, Hasher, Header, E] {
	return &Backend_Expecter[H, N, Hasher, Header, E]{mock: &_m.Mock}
}

// AppendJustification provides a mock function with given fields: hash, justification
func (_m *Backend[H, N, Hasher, Header, E]) AppendJustification(hash H, justification runtime.Justification) error {
	ret := _m.Called(hash, justification)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(H, runtime.Justification) error); ok {
		r0 = rf(hash, justification)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_AppendJustification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendJustification'
type Backend_AppendJustification_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// AppendJustification is a helper method to define mock.On call
//   - hash H
//   - justification runtime.Justification
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) AppendJustification(hash interface{}, justification interface{}) *Backend_AppendJustification_Call[H, N, Hasher, Header, E] {
	return &Backend_AppendJustification_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("AppendJustification", hash, justification)}
}

func (_c *Backend_AppendJustification_Call[H, N, Hasher, Header, E]) Run(run func(hash H, justification runtime.Justification)) *Backend_AppendJustification_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H), args[1].(runtime.Justification))
	})
	return _c
}

func (_c *Backend_AppendJustification_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_AppendJustification_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_AppendJustification_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H, runtime.Justification) error) *Backend_AppendJustification_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// BeginOperation provides a mock function with no fields
func (_m *Backend[H, N, Hasher, Header, E]) BeginOperation() (api.BlockImportOperation[N, H, Hasher, Header, E], error) {
	ret := _m.Called()

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

	var r0 api.BlockImportOperation[N, H, Hasher, Header, E]
	var r1 error
	if rf, ok := ret.Get(0).(func() (api.BlockImportOperation[N, H, Hasher, Header, E], error)); ok {
		return rf()
	}
	if rf, ok := ret.Get(0).(func() api.BlockImportOperation[N, H, Hasher, Header, E]); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(api.BlockImportOperation[N, H, Hasher, Header, E])
		}
	}

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

	return r0, r1
}

// Backend_BeginOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginOperation'
type Backend_BeginOperation_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// BeginOperation is a helper method to define mock.On call
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) BeginOperation() *Backend_BeginOperation_Call[H, N, Hasher, Header, E] {
	return &Backend_BeginOperation_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("BeginOperation")}
}

func (_c *Backend_BeginOperation_Call[H, N, Hasher, Header, E]) Run(run func()) *Backend_BeginOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Backend_BeginOperation_Call[H, N, Hasher, Header, E]) Return(_a0 api.BlockImportOperation[N, H, Hasher, Header, E], _a1 error) *Backend_BeginOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_BeginOperation_Call[H, N, Hasher, Header, E]) RunAndReturn(run func() (api.BlockImportOperation[N, H, Hasher, Header, E], error)) *Backend_BeginOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// BeginStateOperation provides a mock function with given fields: operation, block
func (_m *Backend[H, N, Hasher, Header, E]) BeginStateOperation(operation api.BlockImportOperation[N, H, Hasher, Header, E], block H) error {
	ret := _m.Called(operation, block)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(api.BlockImportOperation[N, H, Hasher, Header, E], H) error); ok {
		r0 = rf(operation, block)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_BeginStateOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginStateOperation'
type Backend_BeginStateOperation_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// BeginStateOperation is a helper method to define mock.On call
//   - operation api.BlockImportOperation[N,H,Hasher,Header,E]
//   - block H
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) BeginStateOperation(operation interface{}, block interface{}) *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E] {
	return &Backend_BeginStateOperation_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("BeginStateOperation", operation, block)}
}

func (_c *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E]) Run(run func(operation api.BlockImportOperation[N, H, Hasher, Header, E], block H)) *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(api.BlockImportOperation[N, H, Hasher, Header, E]), args[1].(H))
	})
	return _c
}

func (_c *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(api.BlockImportOperation[N, H, Hasher, Header, E], H) error) *Backend_BeginStateOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// Blockchain provides a mock function with no fields
func (_m *Backend[H, N, Hasher, Header, E]) Blockchain() blockchain.Backend[H, N, Header, E] {
	ret := _m.Called()

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

	var r0 blockchain.Backend[H, N, Header, E]
	if rf, ok := ret.Get(0).(func() blockchain.Backend[H, N, Header, E]); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(blockchain.Backend[H, N, Header, E])
		}
	}

	return r0
}

// Backend_Blockchain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Blockchain'
type Backend_Blockchain_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// Blockchain is a helper method to define mock.On call
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) Blockchain() *Backend_Blockchain_Call[H, N, Hasher, Header, E] {
	return &Backend_Blockchain_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("Blockchain")}
}

func (_c *Backend_Blockchain_Call[H, N, Hasher, Header, E]) Run(run func()) *Backend_Blockchain_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Backend_Blockchain_Call[H, N, Hasher, Header, E]) Return(_a0 blockchain.Backend[H, N, Header, E]) *Backend_Blockchain_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_Blockchain_Call[H, N, Hasher, Header, E]) RunAndReturn(run func() blockchain.Backend[H, N, Header, E]) *Backend_Blockchain_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// CommitOperation provides a mock function with given fields: transaction
func (_m *Backend[H, N, Hasher, Header, E]) CommitOperation(transaction api.BlockImportOperation[N, H, Hasher, Header, E]) error {
	ret := _m.Called(transaction)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(api.BlockImportOperation[N, H, Hasher, Header, E]) error); ok {
		r0 = rf(transaction)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_CommitOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommitOperation'
type Backend_CommitOperation_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// CommitOperation is a helper method to define mock.On call
//   - transaction api.BlockImportOperation[N,H,Hasher,Header,E]
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) CommitOperation(transaction interface{}) *Backend_CommitOperation_Call[H, N, Hasher, Header, E] {
	return &Backend_CommitOperation_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("CommitOperation", transaction)}
}

func (_c *Backend_CommitOperation_Call[H, N, Hasher, Header, E]) Run(run func(transaction api.BlockImportOperation[N, H, Hasher, Header, E])) *Backend_CommitOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(api.BlockImportOperation[N, H, Hasher, Header, E]))
	})
	return _c
}

func (_c *Backend_CommitOperation_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_CommitOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_CommitOperation_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(api.BlockImportOperation[N, H, Hasher, Header, E]) error) *Backend_CommitOperation_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// FinalizeBlock provides a mock function with given fields: hash, justification
func (_m *Backend[H, N, Hasher, Header, E]) FinalizeBlock(hash H, justification *runtime.Justification) error {
	ret := _m.Called(hash, justification)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(H, *runtime.Justification) error); ok {
		r0 = rf(hash, justification)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_FinalizeBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeBlock'
type Backend_FinalizeBlock_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// FinalizeBlock is a helper method to define mock.On call
//   - hash H
//   - justification *runtime.Justification
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) FinalizeBlock(hash interface{}, justification interface{}) *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E] {
	return &Backend_FinalizeBlock_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("FinalizeBlock", hash, justification)}
}

func (_c *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E]) Run(run func(hash H, justification *runtime.Justification)) *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H), args[1].(*runtime.Justification))
	})
	return _c
}

func (_c *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H, *runtime.Justification) error) *Backend_FinalizeBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// GetAux provides a mock function with given fields: key
func (_m *Backend[H, N, Hasher, Header, E]) GetAux(key []byte) ([]byte, error) {
	ret := _m.Called(key)

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

	var r0 []byte
	var r1 error
	if rf, ok := ret.Get(0).(func([]byte) ([]byte, error)); ok {
		return rf(key)
	}
	if rf, ok := ret.Get(0).(func([]byte) []byte); ok {
		r0 = rf(key)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]byte)
		}
	}

	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(key)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Backend_GetAux_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAux'
type Backend_GetAux_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// GetAux is a helper method to define mock.On call
//   - key []byte
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) GetAux(key interface{}) *Backend_GetAux_Call[H, N, Hasher, Header, E] {
	return &Backend_GetAux_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("GetAux", key)}
}

func (_c *Backend_GetAux_Call[H, N, Hasher, Header, E]) Run(run func(key []byte)) *Backend_GetAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].([]byte))
	})
	return _c
}

func (_c *Backend_GetAux_Call[H, N, Hasher, Header, E]) Return(_a0 []byte, _a1 error) *Backend_GetAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_GetAux_Call[H, N, Hasher, Header, E]) RunAndReturn(run func([]byte) ([]byte, error)) *Backend_GetAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// GetImportLock provides a mock function with no fields
func (_m *Backend[H, N, Hasher, Header, E]) GetImportLock() *sync.RWMutex {
	ret := _m.Called()

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

	var r0 *sync.RWMutex
	if rf, ok := ret.Get(0).(func() *sync.RWMutex); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sync.RWMutex)
		}
	}

	return r0
}

// Backend_GetImportLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImportLock'
type Backend_GetImportLock_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// GetImportLock is a helper method to define mock.On call
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) GetImportLock() *Backend_GetImportLock_Call[H, N, Hasher, Header, E] {
	return &Backend_GetImportLock_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("GetImportLock")}
}

func (_c *Backend_GetImportLock_Call[H, N, Hasher, Header, E]) Run(run func()) *Backend_GetImportLock_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Backend_GetImportLock_Call[H, N, Hasher, Header, E]) Return(_a0 *sync.RWMutex) *Backend_GetImportLock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_GetImportLock_Call[H, N, Hasher, Header, E]) RunAndReturn(run func() *sync.RWMutex) *Backend_GetImportLock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// HaveStateAt provides a mock function with given fields: hash, number
func (_m *Backend[H, N, Hasher, Header, E]) HaveStateAt(hash H, number N) bool {
	ret := _m.Called(hash, number)

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

	var r0 bool
	if rf, ok := ret.Get(0).(func(H, N) bool); ok {
		r0 = rf(hash, number)
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}

// Backend_HaveStateAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HaveStateAt'
type Backend_HaveStateAt_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// HaveStateAt is a helper method to define mock.On call
//   - hash H
//   - number N
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) HaveStateAt(hash interface{}, number interface{}) *Backend_HaveStateAt_Call[H, N, Hasher, Header, E] {
	return &Backend_HaveStateAt_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("HaveStateAt", hash, number)}
}

func (_c *Backend_HaveStateAt_Call[H, N, Hasher, Header, E]) Run(run func(hash H, number N)) *Backend_HaveStateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H), args[1].(N))
	})
	return _c
}

func (_c *Backend_HaveStateAt_Call[H, N, Hasher, Header, E]) Return(_a0 bool) *Backend_HaveStateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_HaveStateAt_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H, N) bool) *Backend_HaveStateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// InsertAux provides a mock function with given fields: insert, delete
func (_m *Backend[H, N, Hasher, Header, E]) InsertAux(insert []kv.KeyValue, delete [][]byte) error {
	ret := _m.Called(insert, delete)

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

	var r0 error
	if rf, ok := ret.Get(0).(func([]kv.KeyValue, [][]byte) error); ok {
		r0 = rf(insert, delete)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_InsertAux_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertAux'
type Backend_InsertAux_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// InsertAux is a helper method to define mock.On call
//   - insert []kv.KeyValue
//   - delete [][]byte
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) InsertAux(insert interface{}, delete interface{}) *Backend_InsertAux_Call[H, N, Hasher, Header, E] {
	return &Backend_InsertAux_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("InsertAux", insert, delete)}
}

func (_c *Backend_InsertAux_Call[H, N, Hasher, Header, E]) Run(run func(insert []kv.KeyValue, delete [][]byte)) *Backend_InsertAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].([]kv.KeyValue), args[1].([][]byte))
	})
	return _c
}

func (_c *Backend_InsertAux_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_InsertAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_InsertAux_Call[H, N, Hasher, Header, E]) RunAndReturn(run func([]kv.KeyValue, [][]byte) error) *Backend_InsertAux_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// OffchainStorage provides a mock function with no fields
func (_m *Backend[H, N, Hasher, Header, E]) OffchainStorage() offchain.OffchainStorage {
	ret := _m.Called()

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

	var r0 offchain.OffchainStorage
	if rf, ok := ret.Get(0).(func() offchain.OffchainStorage); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(offchain.OffchainStorage)
		}
	}

	return r0
}

// Backend_OffchainStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OffchainStorage'
type Backend_OffchainStorage_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// OffchainStorage is a helper method to define mock.On call
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) OffchainStorage() *Backend_OffchainStorage_Call[H, N, Hasher, Header, E] {
	return &Backend_OffchainStorage_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("OffchainStorage")}
}

func (_c *Backend_OffchainStorage_Call[H, N, Hasher, Header, E]) Run(run func()) *Backend_OffchainStorage_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Backend_OffchainStorage_Call[H, N, Hasher, Header, E]) Return(_a0 offchain.OffchainStorage) *Backend_OffchainStorage_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_OffchainStorage_Call[H, N, Hasher, Header, E]) RunAndReturn(run func() offchain.OffchainStorage) *Backend_OffchainStorage_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// PinBlock provides a mock function with given fields: hash
func (_m *Backend[H, N, Hasher, Header, E]) PinBlock(hash H) error {
	ret := _m.Called(hash)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(H) error); ok {
		r0 = rf(hash)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_PinBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PinBlock'
type Backend_PinBlock_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// PinBlock is a helper method to define mock.On call
//   - hash H
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) PinBlock(hash interface{}) *Backend_PinBlock_Call[H, N, Hasher, Header, E] {
	return &Backend_PinBlock_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("PinBlock", hash)}
}

func (_c *Backend_PinBlock_Call[H, N, Hasher, Header, E]) Run(run func(hash H)) *Backend_PinBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H))
	})
	return _c
}

func (_c *Backend_PinBlock_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_PinBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_PinBlock_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H) error) *Backend_PinBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// RemoveLeafBlock provides a mock function with given fields: hash
func (_m *Backend[H, N, Hasher, Header, E]) RemoveLeafBlock(hash H) error {
	ret := _m.Called(hash)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(H) error); ok {
		r0 = rf(hash)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Backend_RemoveLeafBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveLeafBlock'
type Backend_RemoveLeafBlock_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// RemoveLeafBlock is a helper method to define mock.On call
//   - hash H
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) RemoveLeafBlock(hash interface{}) *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E] {
	return &Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("RemoveLeafBlock", hash)}
}

func (_c *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E]) Run(run func(hash H)) *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H))
	})
	return _c
}

func (_c *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E]) Return(_a0 error) *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H) error) *Backend_RemoveLeafBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// RequiresFullSync provides a mock function with no fields
func (_m *Backend[H, N, Hasher, Header, E]) RequiresFullSync() bool {
	ret := _m.Called()

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

	var r0 bool
	if rf, ok := ret.Get(0).(func() bool); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}

// Backend_RequiresFullSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequiresFullSync'
type Backend_RequiresFullSync_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// RequiresFullSync is a helper method to define mock.On call
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) RequiresFullSync() *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E] {
	return &Backend_RequiresFullSync_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("RequiresFullSync")}
}

func (_c *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E]) Run(run func()) *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E]) Return(_a0 bool) *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E]) RunAndReturn(run func() bool) *Backend_RequiresFullSync_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// Revert provides a mock function with given fields: n, revertFinalized
func (_m *Backend[H, N, Hasher, Header, E]) Revert(n N, revertFinalized bool) (N, map[H]interface{}, error) {
	ret := _m.Called(n, revertFinalized)

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

	var r0 N
	var r1 map[H]interface{}
	var r2 error
	if rf, ok := ret.Get(0).(func(N, bool) (N, map[H]interface{}, error)); ok {
		return rf(n, revertFinalized)
	}
	if rf, ok := ret.Get(0).(func(N, bool) N); ok {
		r0 = rf(n, revertFinalized)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(N)
		}
	}

	if rf, ok := ret.Get(1).(func(N, bool) map[H]interface{}); ok {
		r1 = rf(n, revertFinalized)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).(map[H]interface{})
		}
	}

	if rf, ok := ret.Get(2).(func(N, bool) error); ok {
		r2 = rf(n, revertFinalized)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

// Backend_Revert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revert'
type Backend_Revert_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// Revert is a helper method to define mock.On call
//   - n N
//   - revertFinalized bool
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) Revert(n interface{}, revertFinalized interface{}) *Backend_Revert_Call[H, N, Hasher, Header, E] {
	return &Backend_Revert_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("Revert", n, revertFinalized)}
}

func (_c *Backend_Revert_Call[H, N, Hasher, Header, E]) Run(run func(n N, revertFinalized bool)) *Backend_Revert_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(N), args[1].(bool))
	})
	return _c
}

func (_c *Backend_Revert_Call[H, N, Hasher, Header, E]) Return(_a0 N, _a1 map[H]interface{}, _a2 error) *Backend_Revert_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0, _a1, _a2)
	return _c
}

func (_c *Backend_Revert_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(N, bool) (N, map[H]interface{}, error)) *Backend_Revert_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// StateAt provides a mock function with given fields: hash
func (_m *Backend[H, N, Hasher, Header, E]) StateAt(hash H) (statemachine.Backend[H, Hasher], error) {
	ret := _m.Called(hash)

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

	var r0 statemachine.Backend[H, Hasher]
	var r1 error
	if rf, ok := ret.Get(0).(func(H) (statemachine.Backend[H, Hasher], error)); ok {
		return rf(hash)
	}
	if rf, ok := ret.Get(0).(func(H) statemachine.Backend[H, Hasher]); ok {
		r0 = rf(hash)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(statemachine.Backend[H, Hasher])
		}
	}

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

	return r0, r1
}

// Backend_StateAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateAt'
type Backend_StateAt_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// StateAt is a helper method to define mock.On call
//   - hash H
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) StateAt(hash interface{}) *Backend_StateAt_Call[H, N, Hasher, Header, E] {
	return &Backend_StateAt_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("StateAt", hash)}
}

func (_c *Backend_StateAt_Call[H, N, Hasher, Header, E]) Run(run func(hash H)) *Backend_StateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H))
	})
	return _c
}

func (_c *Backend_StateAt_Call[H, N, Hasher, Header, E]) Return(_a0 statemachine.Backend[H, Hasher], _a1 error) *Backend_StateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_StateAt_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H) (statemachine.Backend[H, Hasher], error)) *Backend_StateAt_Call[H, N, Hasher, Header, E] {
	_c.Call.Return(run)
	return _c
}

// UnpinBlock provides a mock function with given fields: hash
func (_m *Backend[H, N, Hasher, Header, E]) UnpinBlock(hash H) {
	_m.Called(hash)
}

// Backend_UnpinBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnpinBlock'
type Backend_UnpinBlock_Call[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic] struct {
	*mock.Call
}

// UnpinBlock is a helper method to define mock.On call
//   - hash H
func (_e *Backend_Expecter[H, N, Hasher, Header, E]) UnpinBlock(hash interface{}) *Backend_UnpinBlock_Call[H, N, Hasher, Header, E] {
	return &Backend_UnpinBlock_Call[H, N, Hasher, Header, E]{Call: _e.mock.On("UnpinBlock", hash)}
}

func (_c *Backend_UnpinBlock_Call[H, N, Hasher, Header, E]) Run(run func(hash H)) *Backend_UnpinBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(H))
	})
	return _c
}

func (_c *Backend_UnpinBlock_Call[H, N, Hasher, Header, E]) Return() *Backend_UnpinBlock_Call[H, N, Hasher, Header, E] {
	_c.Call.Return()
	return _c
}

func (_c *Backend_UnpinBlock_Call[H, N, Hasher, Header, E]) RunAndReturn(run func(H)) *Backend_UnpinBlock_Call[H, N, Hasher, Header, E] {
	_c.Run(run)
	return _c
}

// NewBackend creates a new instance of Backend. 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 NewBackend[H runtime.Hash, N runtime.Number, Hasher runtime.Hasher[H], Header runtime.Header[N, H], E runtime.Extrinsic](t interface {
	mock.TestingT
	Cleanup(func())
}) *Backend[H, N, Hasher, Header, E] {
	mock := &Backend[H, N, Hasher, Header, E]{}
	mock.Mock.Test(t)

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

	return mock
}
