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

package mocks

import (
	kv "github.com/ChainSafe/gossamer/internal/primitives/kv"
	mock "github.com/stretchr/testify/mock"

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

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

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

	triedb "github.com/ChainSafe/gossamer/pkg/trie/triedb"
)

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

type Backend_Expecter[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	mock *mock.Mock
}

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

// ChildClosestMerkleValue provides a mock function with given fields: childInfo, key
func (_m *Backend[H, Hasher]) ChildClosestMerkleValue(childInfo storage.ChildInfo, key []byte) (triedb.MerkleValue[H], error) {
	ret := _m.Called(childInfo, key)

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

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

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

	return r0, r1
}

// Backend_ChildClosestMerkleValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChildClosestMerkleValue'
type Backend_ChildClosestMerkleValue_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// ChildClosestMerkleValue is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - key []byte
func (_e *Backend_Expecter[H, Hasher]) ChildClosestMerkleValue(childInfo interface{}, key interface{}) *Backend_ChildClosestMerkleValue_Call[H, Hasher] {
	return &Backend_ChildClosestMerkleValue_Call[H, Hasher]{Call: _e.mock.On("ChildClosestMerkleValue", childInfo, key)}
}

func (_c *Backend_ChildClosestMerkleValue_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, key []byte)) *Backend_ChildClosestMerkleValue_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]byte))
	})
	return _c
}

func (_c *Backend_ChildClosestMerkleValue_Call[H, Hasher]) Return(_a0 triedb.MerkleValue[H], _a1 error) *Backend_ChildClosestMerkleValue_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ChildClosestMerkleValue_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []byte) (triedb.MerkleValue[H], error)) *Backend_ChildClosestMerkleValue_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// ChildStorage provides a mock function with given fields: childInfo, key
func (_m *Backend[H, Hasher]) ChildStorage(childInfo storage.ChildInfo, key []byte) (statemachine.StorageValue, error) {
	ret := _m.Called(childInfo, key)

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

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

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

	return r0, r1
}

// Backend_ChildStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChildStorage'
type Backend_ChildStorage_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// ChildStorage is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - key []byte
func (_e *Backend_Expecter[H, Hasher]) ChildStorage(childInfo interface{}, key interface{}) *Backend_ChildStorage_Call[H, Hasher] {
	return &Backend_ChildStorage_Call[H, Hasher]{Call: _e.mock.On("ChildStorage", childInfo, key)}
}

func (_c *Backend_ChildStorage_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, key []byte)) *Backend_ChildStorage_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]byte))
	})
	return _c
}

func (_c *Backend_ChildStorage_Call[H, Hasher]) Return(_a0 statemachine.StorageValue, _a1 error) *Backend_ChildStorage_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ChildStorage_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []byte) (statemachine.StorageValue, error)) *Backend_ChildStorage_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// ChildStorageHash provides a mock function with given fields: childInfo, key
func (_m *Backend[H, Hasher]) ChildStorageHash(childInfo storage.ChildInfo, key []byte) (*H, error) {
	ret := _m.Called(childInfo, key)

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

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

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

	return r0, r1
}

// Backend_ChildStorageHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChildStorageHash'
type Backend_ChildStorageHash_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// ChildStorageHash is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - key []byte
func (_e *Backend_Expecter[H, Hasher]) ChildStorageHash(childInfo interface{}, key interface{}) *Backend_ChildStorageHash_Call[H, Hasher] {
	return &Backend_ChildStorageHash_Call[H, Hasher]{Call: _e.mock.On("ChildStorageHash", childInfo, key)}
}

func (_c *Backend_ChildStorageHash_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, key []byte)) *Backend_ChildStorageHash_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]byte))
	})
	return _c
}

func (_c *Backend_ChildStorageHash_Call[H, Hasher]) Return(_a0 *H, _a1 error) *Backend_ChildStorageHash_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ChildStorageHash_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []byte) (*H, error)) *Backend_ChildStorageHash_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// ChildStorageRoot provides a mock function with given fields: childInfo, delta, stateVersion
func (_m *Backend[H, Hasher]) ChildStorageRoot(childInfo storage.ChildInfo, delta []kv.KeyValue, stateVersion storage.StateVersion) (H, bool, statemachine.BackendTransaction[H, Hasher]) {
	ret := _m.Called(childInfo, delta, stateVersion)

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

	var r0 H
	var r1 bool
	var r2 statemachine.BackendTransaction[H, Hasher]
	if rf, ok := ret.Get(0).(func(storage.ChildInfo, []kv.KeyValue, storage.StateVersion) (H, bool, statemachine.BackendTransaction[H, Hasher])); ok {
		return rf(childInfo, delta, stateVersion)
	}
	if rf, ok := ret.Get(0).(func(storage.ChildInfo, []kv.KeyValue, storage.StateVersion) H); ok {
		r0 = rf(childInfo, delta, stateVersion)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(H)
		}
	}

	if rf, ok := ret.Get(1).(func(storage.ChildInfo, []kv.KeyValue, storage.StateVersion) bool); ok {
		r1 = rf(childInfo, delta, stateVersion)
	} else {
		r1 = ret.Get(1).(bool)
	}

	if rf, ok := ret.Get(2).(func(storage.ChildInfo, []kv.KeyValue, storage.StateVersion) statemachine.BackendTransaction[H, Hasher]); ok {
		r2 = rf(childInfo, delta, stateVersion)
	} else {
		r2 = ret.Get(2).(statemachine.BackendTransaction[H, Hasher])
	}

	return r0, r1, r2
}

// Backend_ChildStorageRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChildStorageRoot'
type Backend_ChildStorageRoot_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// ChildStorageRoot is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - delta []kv.KeyValue
//   - stateVersion storage.StateVersion
func (_e *Backend_Expecter[H, Hasher]) ChildStorageRoot(childInfo interface{}, delta interface{}, stateVersion interface{}) *Backend_ChildStorageRoot_Call[H, Hasher] {
	return &Backend_ChildStorageRoot_Call[H, Hasher]{Call: _e.mock.On("ChildStorageRoot", childInfo, delta, stateVersion)}
}

func (_c *Backend_ChildStorageRoot_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, delta []kv.KeyValue, stateVersion storage.StateVersion)) *Backend_ChildStorageRoot_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]kv.KeyValue), args[2].(storage.StateVersion))
	})
	return _c
}

func (_c *Backend_ChildStorageRoot_Call[H, Hasher]) Return(_a0 H, _a1 bool, _a2 statemachine.BackendTransaction[H, Hasher]) *Backend_ChildStorageRoot_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1, _a2)
	return _c
}

func (_c *Backend_ChildStorageRoot_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []kv.KeyValue, storage.StateVersion) (H, bool, statemachine.BackendTransaction[H, Hasher])) *Backend_ChildStorageRoot_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

	return r0, r1
}

// Backend_ClosestMerkleValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClosestMerkleValue'
type Backend_ClosestMerkleValue_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

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

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

func (_c *Backend_ClosestMerkleValue_Call[H, Hasher]) Return(_a0 triedb.MerkleValue[H], _a1 error) *Backend_ClosestMerkleValue_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ClosestMerkleValue_Call[H, Hasher]) RunAndReturn(run func([]byte) (triedb.MerkleValue[H], error)) *Backend_ClosestMerkleValue_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// ExistsChildStorage provides a mock function with given fields: childInfo, key
func (_m *Backend[H, Hasher]) ExistsChildStorage(childInfo storage.ChildInfo, key []byte) (bool, error) {
	ret := _m.Called(childInfo, key)

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

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

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

	return r0, r1
}

// Backend_ExistsChildStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExistsChildStorage'
type Backend_ExistsChildStorage_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// ExistsChildStorage is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - key []byte
func (_e *Backend_Expecter[H, Hasher]) ExistsChildStorage(childInfo interface{}, key interface{}) *Backend_ExistsChildStorage_Call[H, Hasher] {
	return &Backend_ExistsChildStorage_Call[H, Hasher]{Call: _e.mock.On("ExistsChildStorage", childInfo, key)}
}

func (_c *Backend_ExistsChildStorage_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, key []byte)) *Backend_ExistsChildStorage_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]byte))
	})
	return _c
}

func (_c *Backend_ExistsChildStorage_Call[H, Hasher]) Return(_a0 bool, _a1 error) *Backend_ExistsChildStorage_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ExistsChildStorage_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []byte) (bool, error)) *Backend_ExistsChildStorage_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

	return r0, r1
}

// Backend_ExistsStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExistsStorage'
type Backend_ExistsStorage_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

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

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

func (_c *Backend_ExistsStorage_Call[H, Hasher]) Return(_a0 bool, _a1 error) *Backend_ExistsStorage_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ExistsStorage_Call[H, Hasher]) RunAndReturn(run func([]byte) (bool, error)) *Backend_ExistsStorage_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// FullStorageRoot provides a mock function with given fields: delta, childDeltas, stateVersion
func (_m *Backend[H, Hasher]) FullStorageRoot(delta []kv.KeyValue, childDeltas []statemachine.ChildDelta, stateVersion storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher]) {
	ret := _m.Called(delta, childDeltas, stateVersion)

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

	var r0 H
	var r1 statemachine.BackendTransaction[H, Hasher]
	if rf, ok := ret.Get(0).(func([]kv.KeyValue, []statemachine.ChildDelta, storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher])); ok {
		return rf(delta, childDeltas, stateVersion)
	}
	if rf, ok := ret.Get(0).(func([]kv.KeyValue, []statemachine.ChildDelta, storage.StateVersion) H); ok {
		r0 = rf(delta, childDeltas, stateVersion)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(H)
		}
	}

	if rf, ok := ret.Get(1).(func([]kv.KeyValue, []statemachine.ChildDelta, storage.StateVersion) statemachine.BackendTransaction[H, Hasher]); ok {
		r1 = rf(delta, childDeltas, stateVersion)
	} else {
		r1 = ret.Get(1).(statemachine.BackendTransaction[H, Hasher])
	}

	return r0, r1
}

// Backend_FullStorageRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FullStorageRoot'
type Backend_FullStorageRoot_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// FullStorageRoot is a helper method to define mock.On call
//   - delta []kv.KeyValue
//   - childDeltas []statemachine.ChildDelta
//   - stateVersion storage.StateVersion
func (_e *Backend_Expecter[H, Hasher]) FullStorageRoot(delta interface{}, childDeltas interface{}, stateVersion interface{}) *Backend_FullStorageRoot_Call[H, Hasher] {
	return &Backend_FullStorageRoot_Call[H, Hasher]{Call: _e.mock.On("FullStorageRoot", delta, childDeltas, stateVersion)}
}

func (_c *Backend_FullStorageRoot_Call[H, Hasher]) Run(run func(delta []kv.KeyValue, childDeltas []statemachine.ChildDelta, stateVersion storage.StateVersion)) *Backend_FullStorageRoot_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].([]kv.KeyValue), args[1].([]statemachine.ChildDelta), args[2].(storage.StateVersion))
	})
	return _c
}

func (_c *Backend_FullStorageRoot_Call[H, Hasher]) Return(_a0 H, _a1 statemachine.BackendTransaction[H, Hasher]) *Backend_FullStorageRoot_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_FullStorageRoot_Call[H, Hasher]) RunAndReturn(run func([]kv.KeyValue, []statemachine.ChildDelta, storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher])) *Backend_FullStorageRoot_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// Keys provides a mock function with given fields: args
func (_m *Backend[H, Hasher]) Keys(args statemachine.IterArgs) (statemachine.KeysIter[H, Hasher], error) {
	ret := _m.Called(args)

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

	var r0 statemachine.KeysIter[H, Hasher]
	var r1 error
	if rf, ok := ret.Get(0).(func(statemachine.IterArgs) (statemachine.KeysIter[H, Hasher], error)); ok {
		return rf(args)
	}
	if rf, ok := ret.Get(0).(func(statemachine.IterArgs) statemachine.KeysIter[H, Hasher]); ok {
		r0 = rf(args)
	} else {
		r0 = ret.Get(0).(statemachine.KeysIter[H, Hasher])
	}

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

	return r0, r1
}

// Backend_Keys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Keys'
type Backend_Keys_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// Keys is a helper method to define mock.On call
//   - args statemachine.IterArgs
func (_e *Backend_Expecter[H, Hasher]) Keys(args interface{}) *Backend_Keys_Call[H, Hasher] {
	return &Backend_Keys_Call[H, Hasher]{Call: _e.mock.On("Keys", args)}
}

func (_c *Backend_Keys_Call[H, Hasher]) Run(run func(args statemachine.IterArgs)) *Backend_Keys_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(statemachine.IterArgs))
	})
	return _c
}

func (_c *Backend_Keys_Call[H, Hasher]) Return(_a0 statemachine.KeysIter[H, Hasher], _a1 error) *Backend_Keys_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_Keys_Call[H, Hasher]) RunAndReturn(run func(statemachine.IterArgs) (statemachine.KeysIter[H, Hasher], error)) *Backend_Keys_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// NextChildStorageKey provides a mock function with given fields: childInfo, key
func (_m *Backend[H, Hasher]) NextChildStorageKey(childInfo storage.ChildInfo, key []byte) (statemachine.StorageKey, error) {
	ret := _m.Called(childInfo, key)

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

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

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

	return r0, r1
}

// Backend_NextChildStorageKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextChildStorageKey'
type Backend_NextChildStorageKey_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// NextChildStorageKey is a helper method to define mock.On call
//   - childInfo storage.ChildInfo
//   - key []byte
func (_e *Backend_Expecter[H, Hasher]) NextChildStorageKey(childInfo interface{}, key interface{}) *Backend_NextChildStorageKey_Call[H, Hasher] {
	return &Backend_NextChildStorageKey_Call[H, Hasher]{Call: _e.mock.On("NextChildStorageKey", childInfo, key)}
}

func (_c *Backend_NextChildStorageKey_Call[H, Hasher]) Run(run func(childInfo storage.ChildInfo, key []byte)) *Backend_NextChildStorageKey_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(storage.ChildInfo), args[1].([]byte))
	})
	return _c
}

func (_c *Backend_NextChildStorageKey_Call[H, Hasher]) Return(_a0 statemachine.StorageKey, _a1 error) *Backend_NextChildStorageKey_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_NextChildStorageKey_Call[H, Hasher]) RunAndReturn(run func(storage.ChildInfo, []byte) (statemachine.StorageKey, error)) *Backend_NextChildStorageKey_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

	return r0, r1
}

// Backend_NextStorageKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextStorageKey'
type Backend_NextStorageKey_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

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

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

func (_c *Backend_NextStorageKey_Call[H, Hasher]) Return(_a0 statemachine.StorageKey, _a1 error) *Backend_NextStorageKey_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_NextStorageKey_Call[H, Hasher]) RunAndReturn(run func([]byte) (statemachine.StorageKey, error)) *Backend_NextStorageKey_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// Pairs provides a mock function with given fields: args
func (_m *Backend[H, Hasher]) Pairs(args statemachine.IterArgs) (statemachine.PairsIter[H, Hasher], error) {
	ret := _m.Called(args)

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

	var r0 statemachine.PairsIter[H, Hasher]
	var r1 error
	if rf, ok := ret.Get(0).(func(statemachine.IterArgs) (statemachine.PairsIter[H, Hasher], error)); ok {
		return rf(args)
	}
	if rf, ok := ret.Get(0).(func(statemachine.IterArgs) statemachine.PairsIter[H, Hasher]); ok {
		r0 = rf(args)
	} else {
		r0 = ret.Get(0).(statemachine.PairsIter[H, Hasher])
	}

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

	return r0, r1
}

// Backend_Pairs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pairs'
type Backend_Pairs_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// Pairs is a helper method to define mock.On call
//   - args statemachine.IterArgs
func (_e *Backend_Expecter[H, Hasher]) Pairs(args interface{}) *Backend_Pairs_Call[H, Hasher] {
	return &Backend_Pairs_Call[H, Hasher]{Call: _e.mock.On("Pairs", args)}
}

func (_c *Backend_Pairs_Call[H, Hasher]) Run(run func(args statemachine.IterArgs)) *Backend_Pairs_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(statemachine.IterArgs))
	})
	return _c
}

func (_c *Backend_Pairs_Call[H, Hasher]) Return(_a0 statemachine.PairsIter[H, Hasher], _a1 error) *Backend_Pairs_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_Pairs_Call[H, Hasher]) RunAndReturn(run func(statemachine.IterArgs) (statemachine.PairsIter[H, Hasher], error)) *Backend_Pairs_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

// RawIter provides a mock function with given fields: args
func (_m *Backend[H, Hasher]) RawIter(args statemachine.IterArgs) (statemachine.StorageIterator[H, Hasher], error) {
	ret := _m.Called(args)

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

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

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

	return r0, r1
}

// Backend_RawIter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawIter'
type Backend_RawIter_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// RawIter is a helper method to define mock.On call
//   - args statemachine.IterArgs
func (_e *Backend_Expecter[H, Hasher]) RawIter(args interface{}) *Backend_RawIter_Call[H, Hasher] {
	return &Backend_RawIter_Call[H, Hasher]{Call: _e.mock.On("RawIter", args)}
}

func (_c *Backend_RawIter_Call[H, Hasher]) Run(run func(args statemachine.IterArgs)) *Backend_RawIter_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(statemachine.IterArgs))
	})
	return _c
}

func (_c *Backend_RawIter_Call[H, Hasher]) Return(_a0 statemachine.StorageIterator[H, Hasher], _a1 error) *Backend_RawIter_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_RawIter_Call[H, Hasher]) RunAndReturn(run func(statemachine.IterArgs) (statemachine.StorageIterator[H, Hasher], error)) *Backend_RawIter_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

	return r0, r1
}

// Backend_Storage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Storage'
type Backend_Storage_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

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

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

func (_c *Backend_Storage_Call[H, Hasher]) Return(_a0 statemachine.StorageValue, _a1 error) *Backend_Storage_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_Storage_Call[H, Hasher]) RunAndReturn(run func([]byte) (statemachine.StorageValue, error)) *Backend_Storage_Call[H, Hasher] {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

	return r0, r1
}

// Backend_StorageHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StorageHash'
type Backend_StorageHash_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

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

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

func (_c *Backend_StorageHash_Call[H, Hasher]) Return(_a0 *H, _a1 error) *Backend_StorageHash_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

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

// StorageRoot provides a mock function with given fields: delta, stateVersion
func (_m *Backend[H, Hasher]) StorageRoot(delta []kv.KeyValue, stateVersion storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher]) {
	ret := _m.Called(delta, stateVersion)

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

	var r0 H
	var r1 statemachine.BackendTransaction[H, Hasher]
	if rf, ok := ret.Get(0).(func([]kv.KeyValue, storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher])); ok {
		return rf(delta, stateVersion)
	}
	if rf, ok := ret.Get(0).(func([]kv.KeyValue, storage.StateVersion) H); ok {
		r0 = rf(delta, stateVersion)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(H)
		}
	}

	if rf, ok := ret.Get(1).(func([]kv.KeyValue, storage.StateVersion) statemachine.BackendTransaction[H, Hasher]); ok {
		r1 = rf(delta, stateVersion)
	} else {
		r1 = ret.Get(1).(statemachine.BackendTransaction[H, Hasher])
	}

	return r0, r1
}

// Backend_StorageRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StorageRoot'
type Backend_StorageRoot_Call[H runtime.Hash, Hasher runtime.Hasher[H]] struct {
	*mock.Call
}

// StorageRoot is a helper method to define mock.On call
//   - delta []kv.KeyValue
//   - stateVersion storage.StateVersion
func (_e *Backend_Expecter[H, Hasher]) StorageRoot(delta interface{}, stateVersion interface{}) *Backend_StorageRoot_Call[H, Hasher] {
	return &Backend_StorageRoot_Call[H, Hasher]{Call: _e.mock.On("StorageRoot", delta, stateVersion)}
}

func (_c *Backend_StorageRoot_Call[H, Hasher]) Run(run func(delta []kv.KeyValue, stateVersion storage.StateVersion)) *Backend_StorageRoot_Call[H, Hasher] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].([]kv.KeyValue), args[1].(storage.StateVersion))
	})
	return _c
}

func (_c *Backend_StorageRoot_Call[H, Hasher]) Return(_a0 H, _a1 statemachine.BackendTransaction[H, Hasher]) *Backend_StorageRoot_Call[H, Hasher] {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_StorageRoot_Call[H, Hasher]) RunAndReturn(run func([]kv.KeyValue, storage.StateVersion) (H, statemachine.BackendTransaction[H, Hasher])) *Backend_StorageRoot_Call[H, Hasher] {
	_c.Call.Return(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, Hasher runtime.Hasher[H]](t interface {
	mock.TestingT
	Cleanup(func())
}) *Backend[H, Hasher] {
	mock := &Backend[H, Hasher]{}
	mock.Mock.Test(t)

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

	return mock
}
