fake

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCachedMultiStore added in v0.21.0

func NewCachedMultiStore(ms MultiStore) store.CacheMultiStore

NewCachedMultiStore returns a new CacheMultiStore instance for testing

func NewMultiStore

func NewMultiStore() store.MultiStore

NewMultiStore returns a new Multistore instance used for testing

Types

type CachedMultiStore added in v0.21.0

type CachedMultiStore struct {
	*mock.CacheMultiStoreMock
	// contains filtered or unexported fields
}

CachedMultiStore is a simple cached multistore for testing

type MultiStore

type MultiStore struct {
	*mock.MultiStoreMock
	// contains filtered or unexported fields
}

MultiStore is a simple multistore used for testing

type TestKVStore

type TestKVStore struct {
	// contains filtered or unexported fields
}

TestKVStore is a kv store for testing

func (*TestKVStore) CacheWrap

func (t *TestKVStore) CacheWrap() store.CacheWrap

CacheWrap is not implemented

func (TestKVStore) CacheWrapWithListeners

func (t TestKVStore) CacheWrapWithListeners(storeKey store.StoreKey, listeners []store.MemoryListener) types.CacheWrap

CacheWrapWithListeners is not implemented

func (TestKVStore) CacheWrapWithTrace

func (t TestKVStore) CacheWrapWithTrace(_ io.Writer, _ store.TraceContext) store.CacheWrap

CacheWrapWithTrace is not implemented

func (TestKVStore) Delete

func (t TestKVStore) Delete(key []byte)

Delete deletes a key if it exists

func (TestKVStore) Get

func (t TestKVStore) Get(key []byte) []byte

Get returns the value of the given key, nil if it does not exist

func (TestKVStore) GetStoreType

func (t TestKVStore) GetStoreType() store.StoreType

GetStoreType is not implemented

func (TestKVStore) Has

func (t TestKVStore) Has(key []byte) bool

Has checks if an entry for the given key exists

func (TestKVStore) Iterator

func (t TestKVStore) Iterator(start, end []byte) store.Iterator

Iterator returns an interator over the given key domain

func (TestKVStore) ReverseIterator

func (t TestKVStore) ReverseIterator(start, end []byte) store.Iterator

ReverseIterator returns an iterator that iterates over all keys in the given domain in reverse order

func (TestKVStore) Set

func (t TestKVStore) Set(key, value []byte)

Set stores the given key value pair

func (TestKVStore) Write added in v0.21.0

func (t TestKVStore) Write()

type Tofnd

type Tofnd struct {
	// contains filtered or unexported fields
}

Tofnd is a thread-safe fake that emulates the external tofnd process

func NewTofnd

func NewTofnd() *Tofnd

NewTofnd returns a new Tofnd instance

func (*Tofnd) HasKey

func (t *Tofnd) HasKey(keyID string) bool

HasKey returns true if it holds the key associated with the specified ID

func (*Tofnd) KeyGen

func (t *Tofnd) KeyGen(keyID string) []byte

KeyGen simulates a distributed key generation. Only the first call with the same keyID creates a new key, every consecutive call returns the same one

func (*Tofnd) Sign

func (t *Tofnd) Sign(sigID string, keyID string, msg []byte) []byte

Sign simulates a distributed signature generation. Only the first call with the same sigID creates a new signature from the given key, every consecutive call returns the same one

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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