mock

package
v0.36.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheMultiStoreMock added in v0.17.0

type CacheMultiStoreMock struct {
	// CacheMultiStoreFunc mocks the CacheMultiStore method.
	CacheMultiStoreFunc func() types.CacheMultiStore

	// CacheMultiStoreWithVersionFunc mocks the CacheMultiStoreWithVersion method.
	CacheMultiStoreWithVersionFunc func(version int64) (types.CacheMultiStore, error)

	// CacheWrapFunc mocks the CacheWrap method.
	CacheWrapFunc func() types.CacheWrap

	// CacheWrapWithTraceFunc mocks the CacheWrapWithTrace method.
	CacheWrapWithTraceFunc func(w io.Writer, tc types.TraceContext) types.CacheWrap

	// GetKVStoreFunc mocks the GetKVStore method.
	GetKVStoreFunc func(storeKey types.StoreKey) types.KVStore

	// GetStoreFunc mocks the GetStore method.
	GetStoreFunc func(storeKey types.StoreKey) types.Store

	// GetStoreTypeFunc mocks the GetStoreType method.
	GetStoreTypeFunc func() types.StoreType

	// SetTracerFunc mocks the SetTracer method.
	SetTracerFunc func(w io.Writer) types.MultiStore

	// SetTracingContextFunc mocks the SetTracingContext method.
	SetTracingContextFunc func(traceContext types.TraceContext) types.MultiStore

	// TracingEnabledFunc mocks the TracingEnabled method.
	TracingEnabledFunc func() bool

	// WriteFunc mocks the Write method.
	WriteFunc func()
	// contains filtered or unexported fields
}

CacheMultiStoreMock is a mock implementation of interfaces.CacheMultiStore.

func TestSomethingThatUsesCacheMultiStore(t *testing.T) {

	// make and configure a mocked interfaces.CacheMultiStore
	mockedCacheMultiStore := &CacheMultiStoreMock{
		CacheMultiStoreFunc: func() types.CacheMultiStore {
			panic("mock out the CacheMultiStore method")
		},
		CacheMultiStoreWithVersionFunc: func(version int64) (types.CacheMultiStore, error) {
			panic("mock out the CacheMultiStoreWithVersion method")
		},
		CacheWrapFunc: func() types.CacheWrap {
			panic("mock out the CacheWrap method")
		},
		CacheWrapWithTraceFunc: func(w io.Writer, tc types.TraceContext) types.CacheWrap {
			panic("mock out the CacheWrapWithTrace method")
		},
		GetKVStoreFunc: func(storeKey types.StoreKey) types.KVStore {
			panic("mock out the GetKVStore method")
		},
		GetStoreFunc: func(storeKey types.StoreKey) types.Store {
			panic("mock out the GetStore method")
		},
		GetStoreTypeFunc: func() types.StoreType {
			panic("mock out the GetStoreType method")
		},
		SetTracerFunc: func(w io.Writer) types.MultiStore {
			panic("mock out the SetTracer method")
		},
		SetTracingContextFunc: func(traceContext types.TraceContext) types.MultiStore {
			panic("mock out the SetTracingContext method")
		},
		TracingEnabledFunc: func() bool {
			panic("mock out the TracingEnabled method")
		},
		WriteFunc: func()  {
			panic("mock out the Write method")
		},
	}

	// use mockedCacheMultiStore in code that requires interfaces.CacheMultiStore
	// and then make assertions.

}

func (*CacheMultiStoreMock) CacheMultiStore added in v0.17.0

func (mock *CacheMultiStoreMock) CacheMultiStore() types.CacheMultiStore

CacheMultiStore calls CacheMultiStoreFunc.

func (*CacheMultiStoreMock) CacheMultiStoreCalls added in v0.17.0

func (mock *CacheMultiStoreMock) CacheMultiStoreCalls() []struct {
}

CacheMultiStoreCalls gets all the calls that were made to CacheMultiStore. Check the length with:

len(mockedCacheMultiStore.CacheMultiStoreCalls())

func (*CacheMultiStoreMock) CacheMultiStoreWithVersion added in v0.17.0

func (mock *CacheMultiStoreMock) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)

CacheMultiStoreWithVersion calls CacheMultiStoreWithVersionFunc.

func (*CacheMultiStoreMock) CacheMultiStoreWithVersionCalls added in v0.17.0

func (mock *CacheMultiStoreMock) CacheMultiStoreWithVersionCalls() []struct {
	Version int64
}

CacheMultiStoreWithVersionCalls gets all the calls that were made to CacheMultiStoreWithVersion. Check the length with:

len(mockedCacheMultiStore.CacheMultiStoreWithVersionCalls())

func (*CacheMultiStoreMock) CacheWrap added in v0.17.0

func (mock *CacheMultiStoreMock) CacheWrap() types.CacheWrap

CacheWrap calls CacheWrapFunc.

func (*CacheMultiStoreMock) CacheWrapCalls added in v0.17.0

func (mock *CacheMultiStoreMock) CacheWrapCalls() []struct {
}

CacheWrapCalls gets all the calls that were made to CacheWrap. Check the length with:

len(mockedCacheMultiStore.CacheWrapCalls())

func (*CacheMultiStoreMock) CacheWrapWithTrace added in v0.17.0

func (mock *CacheMultiStoreMock) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap

CacheWrapWithTrace calls CacheWrapWithTraceFunc.

func (*CacheMultiStoreMock) CacheWrapWithTraceCalls added in v0.17.0

func (mock *CacheMultiStoreMock) CacheWrapWithTraceCalls() []struct {
	W  io.Writer
	Tc types.TraceContext
}

CacheWrapWithTraceCalls gets all the calls that were made to CacheWrapWithTrace. Check the length with:

len(mockedCacheMultiStore.CacheWrapWithTraceCalls())

func (*CacheMultiStoreMock) GetKVStore added in v0.17.0

func (mock *CacheMultiStoreMock) GetKVStore(storeKey types.StoreKey) types.KVStore

GetKVStore calls GetKVStoreFunc.

func (*CacheMultiStoreMock) GetKVStoreCalls added in v0.17.0

func (mock *CacheMultiStoreMock) GetKVStoreCalls() []struct {
	StoreKey types.StoreKey
}

GetKVStoreCalls gets all the calls that were made to GetKVStore. Check the length with:

len(mockedCacheMultiStore.GetKVStoreCalls())

func (*CacheMultiStoreMock) GetStore added in v0.17.0

func (mock *CacheMultiStoreMock) GetStore(storeKey types.StoreKey) types.Store

GetStore calls GetStoreFunc.

func (*CacheMultiStoreMock) GetStoreCalls added in v0.17.0

func (mock *CacheMultiStoreMock) GetStoreCalls() []struct {
	StoreKey types.StoreKey
}

GetStoreCalls gets all the calls that were made to GetStore. Check the length with:

len(mockedCacheMultiStore.GetStoreCalls())

func (*CacheMultiStoreMock) GetStoreType added in v0.17.0

func (mock *CacheMultiStoreMock) GetStoreType() types.StoreType

GetStoreType calls GetStoreTypeFunc.

func (*CacheMultiStoreMock) GetStoreTypeCalls added in v0.17.0

func (mock *CacheMultiStoreMock) GetStoreTypeCalls() []struct {
}

GetStoreTypeCalls gets all the calls that were made to GetStoreType. Check the length with:

len(mockedCacheMultiStore.GetStoreTypeCalls())

func (*CacheMultiStoreMock) SetTracer added in v0.17.0

func (mock *CacheMultiStoreMock) SetTracer(w io.Writer) types.MultiStore

SetTracer calls SetTracerFunc.

func (*CacheMultiStoreMock) SetTracerCalls added in v0.17.0

func (mock *CacheMultiStoreMock) SetTracerCalls() []struct {
	W io.Writer
}

SetTracerCalls gets all the calls that were made to SetTracer. Check the length with:

len(mockedCacheMultiStore.SetTracerCalls())

func (*CacheMultiStoreMock) SetTracingContext added in v0.17.0

func (mock *CacheMultiStoreMock) SetTracingContext(traceContext types.TraceContext) types.MultiStore

SetTracingContext calls SetTracingContextFunc.

func (*CacheMultiStoreMock) SetTracingContextCalls added in v0.17.0

func (mock *CacheMultiStoreMock) SetTracingContextCalls() []struct {
	TraceContext types.TraceContext
}

SetTracingContextCalls gets all the calls that were made to SetTracingContext. Check the length with:

len(mockedCacheMultiStore.SetTracingContextCalls())

func (*CacheMultiStoreMock) TracingEnabled added in v0.17.0

func (mock *CacheMultiStoreMock) TracingEnabled() bool

TracingEnabled calls TracingEnabledFunc.

func (*CacheMultiStoreMock) TracingEnabledCalls added in v0.17.0

func (mock *CacheMultiStoreMock) TracingEnabledCalls() []struct {
}

TracingEnabledCalls gets all the calls that were made to TracingEnabled. Check the length with:

len(mockedCacheMultiStore.TracingEnabledCalls())

func (*CacheMultiStoreMock) Write added in v0.17.0

func (mock *CacheMultiStoreMock) Write()

Write calls WriteFunc.

func (*CacheMultiStoreMock) WriteCalls added in v0.17.0

func (mock *CacheMultiStoreMock) WriteCalls() []struct {
}

WriteCalls gets all the calls that were made to Write. Check the length with:

len(mockedCacheMultiStore.WriteCalls())

type KVStoreMock

type KVStoreMock struct {
	// CacheWrapFunc mocks the CacheWrap method.
	CacheWrapFunc func() types.CacheWrap

	// CacheWrapWithTraceFunc mocks the CacheWrapWithTrace method.
	CacheWrapWithTraceFunc func(w io.Writer, tc types.TraceContext) types.CacheWrap

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(key []byte)

	// GetFunc mocks the Get method.
	GetFunc func(key []byte) []byte

	// GetStoreTypeFunc mocks the GetStoreType method.
	GetStoreTypeFunc func() types.StoreType

	// HasFunc mocks the Has method.
	HasFunc func(key []byte) bool

	// IteratorFunc mocks the Iterator method.
	IteratorFunc func(start []byte, end []byte) db.Iterator

	// ReverseIteratorFunc mocks the ReverseIterator method.
	ReverseIteratorFunc func(start []byte, end []byte) db.Iterator

	// SetFunc mocks the Set method.
	SetFunc func(key []byte, value []byte)
	// contains filtered or unexported fields
}

KVStoreMock is a mock implementation of interfaces.KVStore.

func TestSomethingThatUsesKVStore(t *testing.T) {

	// make and configure a mocked interfaces.KVStore
	mockedKVStore := &KVStoreMock{
		CacheWrapFunc: func() types.CacheWrap {
			panic("mock out the CacheWrap method")
		},
		CacheWrapWithTraceFunc: func(w io.Writer, tc types.TraceContext) types.CacheWrap {
			panic("mock out the CacheWrapWithTrace method")
		},
		DeleteFunc: func(key []byte)  {
			panic("mock out the Delete method")
		},
		GetFunc: func(key []byte) []byte {
			panic("mock out the Get method")
		},
		GetStoreTypeFunc: func() types.StoreType {
			panic("mock out the GetStoreType method")
		},
		HasFunc: func(key []byte) bool {
			panic("mock out the Has method")
		},
		IteratorFunc: func(start []byte, end []byte) db.Iterator {
			panic("mock out the Iterator method")
		},
		ReverseIteratorFunc: func(start []byte, end []byte) db.Iterator {
			panic("mock out the ReverseIterator method")
		},
		SetFunc: func(key []byte, value []byte)  {
			panic("mock out the Set method")
		},
	}

	// use mockedKVStore in code that requires interfaces.KVStore
	// and then make assertions.

}

func (*KVStoreMock) CacheWrap

func (mock *KVStoreMock) CacheWrap() types.CacheWrap

CacheWrap calls CacheWrapFunc.

func (*KVStoreMock) CacheWrapCalls

func (mock *KVStoreMock) CacheWrapCalls() []struct {
}

CacheWrapCalls gets all the calls that were made to CacheWrap. Check the length with:

len(mockedKVStore.CacheWrapCalls())

func (*KVStoreMock) CacheWrapWithTrace

func (mock *KVStoreMock) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap

CacheWrapWithTrace calls CacheWrapWithTraceFunc.

func (*KVStoreMock) CacheWrapWithTraceCalls

func (mock *KVStoreMock) CacheWrapWithTraceCalls() []struct {
	W  io.Writer
	Tc types.TraceContext
}

CacheWrapWithTraceCalls gets all the calls that were made to CacheWrapWithTrace. Check the length with:

len(mockedKVStore.CacheWrapWithTraceCalls())

func (*KVStoreMock) Delete

func (mock *KVStoreMock) Delete(key []byte)

Delete calls DeleteFunc.

func (*KVStoreMock) DeleteCalls

func (mock *KVStoreMock) DeleteCalls() []struct {
	Key []byte
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedKVStore.DeleteCalls())

func (*KVStoreMock) Get

func (mock *KVStoreMock) Get(key []byte) []byte

Get calls GetFunc.

func (*KVStoreMock) GetCalls

func (mock *KVStoreMock) GetCalls() []struct {
	Key []byte
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedKVStore.GetCalls())

func (*KVStoreMock) GetStoreType

func (mock *KVStoreMock) GetStoreType() types.StoreType

GetStoreType calls GetStoreTypeFunc.

func (*KVStoreMock) GetStoreTypeCalls

func (mock *KVStoreMock) GetStoreTypeCalls() []struct {
}

GetStoreTypeCalls gets all the calls that were made to GetStoreType. Check the length with:

len(mockedKVStore.GetStoreTypeCalls())

func (*KVStoreMock) Has

func (mock *KVStoreMock) Has(key []byte) bool

Has calls HasFunc.

func (*KVStoreMock) HasCalls

func (mock *KVStoreMock) HasCalls() []struct {
	Key []byte
}

HasCalls gets all the calls that were made to Has. Check the length with:

len(mockedKVStore.HasCalls())

func (*KVStoreMock) Iterator

func (mock *KVStoreMock) Iterator(start []byte, end []byte) db.Iterator

Iterator calls IteratorFunc.

func (*KVStoreMock) IteratorCalls

func (mock *KVStoreMock) IteratorCalls() []struct {
	Start []byte
	End   []byte
}

IteratorCalls gets all the calls that were made to Iterator. Check the length with:

len(mockedKVStore.IteratorCalls())

func (*KVStoreMock) ReverseIterator

func (mock *KVStoreMock) ReverseIterator(start []byte, end []byte) db.Iterator

ReverseIterator calls ReverseIteratorFunc.

func (*KVStoreMock) ReverseIteratorCalls

func (mock *KVStoreMock) ReverseIteratorCalls() []struct {
	Start []byte
	End   []byte
}

ReverseIteratorCalls gets all the calls that were made to ReverseIterator. Check the length with:

len(mockedKVStore.ReverseIteratorCalls())

func (*KVStoreMock) Set

func (mock *KVStoreMock) Set(key []byte, value []byte)

Set calls SetFunc.

func (*KVStoreMock) SetCalls

func (mock *KVStoreMock) SetCalls() []struct {
	Key   []byte
	Value []byte
}

SetCalls gets all the calls that were made to Set. Check the length with:

len(mockedKVStore.SetCalls())

type MultiStoreMock

type MultiStoreMock struct {
	// CacheMultiStoreFunc mocks the CacheMultiStore method.
	CacheMultiStoreFunc func() types.CacheMultiStore

	// CacheMultiStoreWithVersionFunc mocks the CacheMultiStoreWithVersion method.
	CacheMultiStoreWithVersionFunc func(version int64) (types.CacheMultiStore, error)

	// CacheWrapFunc mocks the CacheWrap method.
	CacheWrapFunc func() types.CacheWrap

	// CacheWrapWithTraceFunc mocks the CacheWrapWithTrace method.
	CacheWrapWithTraceFunc func(w io.Writer, tc types.TraceContext) types.CacheWrap

	// GetKVStoreFunc mocks the GetKVStore method.
	GetKVStoreFunc func(storeKey types.StoreKey) types.KVStore

	// GetStoreFunc mocks the GetStore method.
	GetStoreFunc func(storeKey types.StoreKey) types.Store

	// GetStoreTypeFunc mocks the GetStoreType method.
	GetStoreTypeFunc func() types.StoreType

	// SetTracerFunc mocks the SetTracer method.
	SetTracerFunc func(w io.Writer) types.MultiStore

	// SetTracingContextFunc mocks the SetTracingContext method.
	SetTracingContextFunc func(traceContext types.TraceContext) types.MultiStore

	// TracingEnabledFunc mocks the TracingEnabled method.
	TracingEnabledFunc func() bool
	// contains filtered or unexported fields
}

MultiStoreMock is a mock implementation of interfaces.MultiStore.

func TestSomethingThatUsesMultiStore(t *testing.T) {

	// make and configure a mocked interfaces.MultiStore
	mockedMultiStore := &MultiStoreMock{
		CacheMultiStoreFunc: func() types.CacheMultiStore {
			panic("mock out the CacheMultiStore method")
		},
		CacheMultiStoreWithVersionFunc: func(version int64) (types.CacheMultiStore, error) {
			panic("mock out the CacheMultiStoreWithVersion method")
		},
		CacheWrapFunc: func() types.CacheWrap {
			panic("mock out the CacheWrap method")
		},
		CacheWrapWithTraceFunc: func(w io.Writer, tc types.TraceContext) types.CacheWrap {
			panic("mock out the CacheWrapWithTrace method")
		},
		GetKVStoreFunc: func(storeKey types.StoreKey) types.KVStore {
			panic("mock out the GetKVStore method")
		},
		GetStoreFunc: func(storeKey types.StoreKey) types.Store {
			panic("mock out the GetStore method")
		},
		GetStoreTypeFunc: func() types.StoreType {
			panic("mock out the GetStoreType method")
		},
		SetTracerFunc: func(w io.Writer) types.MultiStore {
			panic("mock out the SetTracer method")
		},
		SetTracingContextFunc: func(traceContext types.TraceContext) types.MultiStore {
			panic("mock out the SetTracingContext method")
		},
		TracingEnabledFunc: func() bool {
			panic("mock out the TracingEnabled method")
		},
	}

	// use mockedMultiStore in code that requires interfaces.MultiStore
	// and then make assertions.

}

func (*MultiStoreMock) CacheMultiStore

func (mock *MultiStoreMock) CacheMultiStore() types.CacheMultiStore

CacheMultiStore calls CacheMultiStoreFunc.

func (*MultiStoreMock) CacheMultiStoreCalls

func (mock *MultiStoreMock) CacheMultiStoreCalls() []struct {
}

CacheMultiStoreCalls gets all the calls that were made to CacheMultiStore. Check the length with:

len(mockedMultiStore.CacheMultiStoreCalls())

func (*MultiStoreMock) CacheMultiStoreWithVersion

func (mock *MultiStoreMock) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)

CacheMultiStoreWithVersion calls CacheMultiStoreWithVersionFunc.

func (*MultiStoreMock) CacheMultiStoreWithVersionCalls

func (mock *MultiStoreMock) CacheMultiStoreWithVersionCalls() []struct {
	Version int64
}

CacheMultiStoreWithVersionCalls gets all the calls that were made to CacheMultiStoreWithVersion. Check the length with:

len(mockedMultiStore.CacheMultiStoreWithVersionCalls())

func (*MultiStoreMock) CacheWrap

func (mock *MultiStoreMock) CacheWrap() types.CacheWrap

CacheWrap calls CacheWrapFunc.

func (*MultiStoreMock) CacheWrapCalls

func (mock *MultiStoreMock) CacheWrapCalls() []struct {
}

CacheWrapCalls gets all the calls that were made to CacheWrap. Check the length with:

len(mockedMultiStore.CacheWrapCalls())

func (*MultiStoreMock) CacheWrapWithTrace

func (mock *MultiStoreMock) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap

CacheWrapWithTrace calls CacheWrapWithTraceFunc.

func (*MultiStoreMock) CacheWrapWithTraceCalls

func (mock *MultiStoreMock) CacheWrapWithTraceCalls() []struct {
	W  io.Writer
	Tc types.TraceContext
}

CacheWrapWithTraceCalls gets all the calls that were made to CacheWrapWithTrace. Check the length with:

len(mockedMultiStore.CacheWrapWithTraceCalls())

func (*MultiStoreMock) GetKVStore

func (mock *MultiStoreMock) GetKVStore(storeKey types.StoreKey) types.KVStore

GetKVStore calls GetKVStoreFunc.

func (*MultiStoreMock) GetKVStoreCalls

func (mock *MultiStoreMock) GetKVStoreCalls() []struct {
	StoreKey types.StoreKey
}

GetKVStoreCalls gets all the calls that were made to GetKVStore. Check the length with:

len(mockedMultiStore.GetKVStoreCalls())

func (*MultiStoreMock) GetStore

func (mock *MultiStoreMock) GetStore(storeKey types.StoreKey) types.Store

GetStore calls GetStoreFunc.

func (*MultiStoreMock) GetStoreCalls

func (mock *MultiStoreMock) GetStoreCalls() []struct {
	StoreKey types.StoreKey
}

GetStoreCalls gets all the calls that were made to GetStore. Check the length with:

len(mockedMultiStore.GetStoreCalls())

func (*MultiStoreMock) GetStoreType

func (mock *MultiStoreMock) GetStoreType() types.StoreType

GetStoreType calls GetStoreTypeFunc.

func (*MultiStoreMock) GetStoreTypeCalls

func (mock *MultiStoreMock) GetStoreTypeCalls() []struct {
}

GetStoreTypeCalls gets all the calls that were made to GetStoreType. Check the length with:

len(mockedMultiStore.GetStoreTypeCalls())

func (*MultiStoreMock) SetTracer

func (mock *MultiStoreMock) SetTracer(w io.Writer) types.MultiStore

SetTracer calls SetTracerFunc.

func (*MultiStoreMock) SetTracerCalls

func (mock *MultiStoreMock) SetTracerCalls() []struct {
	W io.Writer
}

SetTracerCalls gets all the calls that were made to SetTracer. Check the length with:

len(mockedMultiStore.SetTracerCalls())

func (*MultiStoreMock) SetTracingContext

func (mock *MultiStoreMock) SetTracingContext(traceContext types.TraceContext) types.MultiStore

SetTracingContext calls SetTracingContextFunc.

func (*MultiStoreMock) SetTracingContextCalls

func (mock *MultiStoreMock) SetTracingContextCalls() []struct {
	TraceContext types.TraceContext
}

SetTracingContextCalls gets all the calls that were made to SetTracingContext. Check the length with:

len(mockedMultiStore.SetTracingContextCalls())

func (*MultiStoreMock) TracingEnabled

func (mock *MultiStoreMock) TracingEnabled() bool

TracingEnabled calls TracingEnabledFunc.

func (*MultiStoreMock) TracingEnabledCalls

func (mock *MultiStoreMock) TracingEnabledCalls() []struct {
}

TracingEnabledCalls gets all the calls that were made to TracingEnabled. Check the length with:

len(mockedMultiStore.TracingEnabledCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL