mocks

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorStoreAccess = errors.New("store", 1, "error accessing store")

Functions

func FlorinKeeper

func FlorinKeeper() (*keeper.Keeper, sdk.Context)

func FlorinWithKeepers

func FlorinWithKeepers(bank BankKeeper) (*keeper.Keeper, sdk.Context)

func NoOpSendRestrictionFn

func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error)

Types

type BankKeeper

type BankKeeper struct {
	Balances    map[string]sdk.Coins
	Restriction SendRestrictionFn
}

func (BankKeeper) BurnCoins

func (k BankKeeper) BurnCoins(_ context.Context, moduleName string, amt sdk.Coins) error

func (BankKeeper) GetBalance

func (k BankKeeper) GetBalance(_ context.Context, addr sdk.AccAddress, denom string) sdk.Coin

func (BankKeeper) GetSupply

func (k BankKeeper) GetSupply(_ context.Context, denom string) sdk.Coin

func (BankKeeper) MintCoins

func (k BankKeeper) MintCoins(_ context.Context, moduleName string, amt sdk.Coins) error

func (BankKeeper) SendCoins

func (k BankKeeper) SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error

func (BankKeeper) SendCoinsFromAccountToModule

func (k BankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error

func (BankKeeper) SendCoinsFromModuleToAccount

func (k BankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error

func (BankKeeper) WithSendCoinsRestriction

func (k BankKeeper) WithSendCoinsRestriction(check SendRestrictionFn) BankKeeper

type FailingMethod

type FailingMethod string
const (
	Get             FailingMethod = "get"
	Has             FailingMethod = "has"
	Set             FailingMethod = "set"
	Delete          FailingMethod = "delete"
	Iterator        FailingMethod = "iterator"
	ReverseIterator FailingMethod = "reverseIterator"
)

type SendRestrictionFn

type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error)

type StoreService

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

func FailingStore

func FailingStore(failingMethod FailingMethod, original types.KVStore) *StoreService

FailingStore returns a store.KVStoreService that can be used to test specific errors within collections.

func (StoreService) NewStoreContext

func (s StoreService) NewStoreContext() context.Context

func (StoreService) OpenKVStore

func (s StoreService) OpenKVStore(_ context.Context) store.KVStore

Jump to

Keyboard shortcuts

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