mock

package
v0.20.0-alpha.2 Latest Latest
Warning

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

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

Documentation

Overview

Package mock is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCtxWithMockLogger

func AppendCtxWithMockLogger(t *testing.T, ctx sdk.Context) (sdk.Context, *sdktestsmocks.MockLogger)
AppendCtxWithMockLogger sets the logger for an input context as a mock logger

with 'EXPECT' statements. This enables testing on functions logged to the context. For example,

```go // This is a passing test example import (

gomock "github.com/golang/mock/gomock"
sdktestsmocks "github.com/cosmos/cosmos-sdk/tests/mocks"

)

// assume t is a *testing.T variable.
ctx, logger := AppendCtxWithMockLogger(t, ctx)
logger.EXPECT().Debug("debug")
logger.EXPECT().Info("info")
logger.EXPECT().Error("error")

ctx.Logger().Debug("debug")
ctx.Logger().Info("info")
ctx.Logger().Error("error")

```

func SpotPool

func SpotPool(poolId uint64, assets sdk.Coins, shares int64) types.Pool

helper function to create dummy test pools

func SpotStablePool

func SpotStablePool(poolId uint64, assets sdk.Coins, shares int64) types.Pool

helper function to create dummy test pools

Types

type MockAccountKeeper

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

MockAccountKeeper is a mock of AccountKeeper interface.

func NewMockAccountKeeper

func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper

NewMockAccountKeeper creates a new mock instance.

func (*MockAccountKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAccountKeeper) GetAccount

func (m *MockAccountKeeper) GetAccount(arg0 types1.Context, arg1 types1.AccAddress) types2.AccountI

GetAccount mocks base method.

func (*MockAccountKeeper) GetModuleAccount

func (m *MockAccountKeeper) GetModuleAccount(arg0 types1.Context, arg1 string) types2.ModuleAccountI

GetModuleAccount mocks base method.

func (*MockAccountKeeper) GetModuleAddress

func (m *MockAccountKeeper) GetModuleAddress(arg0 string) types1.AccAddress

GetModuleAddress mocks base method.

type MockAccountKeeperMockRecorder

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

MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper.

func (*MockAccountKeeperMockRecorder) GetAccount

func (mr *MockAccountKeeperMockRecorder) GetAccount(arg0, arg1 interface{}) *gomock.Call

GetAccount indicates an expected call of GetAccount.

func (*MockAccountKeeperMockRecorder) GetModuleAccount

func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(arg0, arg1 interface{}) *gomock.Call

GetModuleAccount indicates an expected call of GetModuleAccount.

func (*MockAccountKeeperMockRecorder) GetModuleAddress

func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(arg0 interface{}) *gomock.Call

GetModuleAddress indicates an expected call of GetModuleAddress.

type MockBankKeeper

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

MockBankKeeper is a mock of BankKeeper interface.

func NewMockBankKeeper

func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper

NewMockBankKeeper creates a new mock instance.

func (*MockBankKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBankKeeper) GetAllBalances

func (m *MockBankKeeper) GetAllBalances(arg0 types1.Context, arg1 types1.AccAddress) types1.Coins

GetAllBalances mocks base method.

func (*MockBankKeeper) GetBalance

func (m *MockBankKeeper) GetBalance(arg0 types1.Context, arg1 types1.AccAddress, arg2 string) types1.Coin

GetBalance mocks base method.

func (*MockBankKeeper) MintCoins

func (m *MockBankKeeper) MintCoins(arg0 types1.Context, arg1 string, arg2 types1.Coins) error

MintCoins mocks base method.

func (*MockBankKeeper) SendCoinsFromAccountToModule

func (m *MockBankKeeper) SendCoinsFromAccountToModule(arg0 types1.Context, arg1 types1.AccAddress, arg2 string, arg3 types1.Coins) error

SendCoinsFromAccountToModule mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToAccount

func (m *MockBankKeeper) SendCoinsFromModuleToAccount(arg0 types1.Context, arg1 string, arg2 types1.AccAddress, arg3 types1.Coins) error

SendCoinsFromModuleToAccount mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToModule

func (m *MockBankKeeper) SendCoinsFromModuleToModule(arg0 types1.Context, arg1, arg2 string, arg3 types1.Coins) error

SendCoinsFromModuleToModule mocks base method.

func (*MockBankKeeper) SpendableCoins

func (m *MockBankKeeper) SpendableCoins(arg0 types1.Context, arg1 types1.AccAddress) types1.Coins

SpendableCoins mocks base method.

type MockBankKeeperMockRecorder

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

MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper.

func (*MockBankKeeperMockRecorder) GetAllBalances

func (mr *MockBankKeeperMockRecorder) GetAllBalances(arg0, arg1 interface{}) *gomock.Call

GetAllBalances indicates an expected call of GetAllBalances.

func (*MockBankKeeperMockRecorder) GetBalance

func (mr *MockBankKeeperMockRecorder) GetBalance(arg0, arg1, arg2 interface{}) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockBankKeeperMockRecorder) MintCoins

func (mr *MockBankKeeperMockRecorder) MintCoins(arg0, arg1, arg2 interface{}) *gomock.Call

MintCoins indicates an expected call of MintCoins.

func (*MockBankKeeperMockRecorder) SendCoinsFromAccountToModule

func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule.

func (*MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount

func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount.

func (*MockBankKeeperMockRecorder) SendCoinsFromModuleToModule

func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule.

func (*MockBankKeeperMockRecorder) SpendableCoins

func (mr *MockBankKeeperMockRecorder) SpendableCoins(arg0, arg1 interface{}) *gomock.Call

SpendableCoins indicates an expected call of SpendableCoins.

type MockEpochKeeper

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

MockEpochKeeper is a mock of EpochKeeper interface.

func NewMockEpochKeeper

func NewMockEpochKeeper(ctrl *gomock.Controller) *MockEpochKeeper

NewMockEpochKeeper creates a new mock instance.

func (*MockEpochKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEpochKeeper) GetEpochInfo

func (m *MockEpochKeeper) GetEpochInfo(arg0 types1.Context, arg1 string) types.EpochInfo

GetEpochInfo mocks base method.

type MockEpochKeeperMockRecorder

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

MockEpochKeeperMockRecorder is the mock recorder for MockEpochKeeper.

func (*MockEpochKeeperMockRecorder) GetEpochInfo

func (mr *MockEpochKeeperMockRecorder) GetEpochInfo(arg0, arg1 interface{}) *gomock.Call

GetEpochInfo indicates an expected call of GetEpochInfo.

type MockOracleKeeper

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

MockOracleKeeper is a mock of OracleKeeper interface.

func NewMockOracleKeeper

func NewMockOracleKeeper(ctrl *gomock.Controller) *MockOracleKeeper

NewMockOracleKeeper creates a new mock instance.

func (*MockOracleKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOracleKeeper) GetExchangeRate

func (m *MockOracleKeeper) GetExchangeRate(arg0 types1.Context, arg1 asset.Pair) (types1.Dec, error)

GetExchangeRate mocks base method.

func (*MockOracleKeeper) GetExchangeRateTwap

func (m *MockOracleKeeper) GetExchangeRateTwap(arg0 types1.Context, arg1 asset.Pair) (types1.Dec, error)

GetExchangeRateTwap mocks base method.

func (*MockOracleKeeper) SetPrice

func (m *MockOracleKeeper) SetPrice(arg0 types1.Context, arg1 asset.Pair, arg2 types1.Dec)

SetPrice mocks base method.

type MockOracleKeeperMockRecorder

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

MockOracleKeeperMockRecorder is the mock recorder for MockOracleKeeper.

func (*MockOracleKeeperMockRecorder) GetExchangeRate

func (mr *MockOracleKeeperMockRecorder) GetExchangeRate(arg0, arg1 interface{}) *gomock.Call

GetExchangeRate indicates an expected call of GetExchangeRate.

func (*MockOracleKeeperMockRecorder) GetExchangeRateTwap

func (mr *MockOracleKeeperMockRecorder) GetExchangeRateTwap(arg0, arg1 interface{}) *gomock.Call

GetExchangeRateTwap indicates an expected call of GetExchangeRateTwap.

func (*MockOracleKeeperMockRecorder) SetPrice

func (mr *MockOracleKeeperMockRecorder) SetPrice(arg0, arg1, arg2 interface{}) *gomock.Call

SetPrice indicates an expected call of SetPrice.

type MockPerpAmmKeeper

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

MockPerpAmmKeeper is a mock of PerpAmmKeeper interface.

func NewMockPerpAmmKeeper

func NewMockPerpAmmKeeper(ctrl *gomock.Controller) *MockPerpAmmKeeper

NewMockPerpAmmKeeper creates a new mock instance.

func (*MockPerpAmmKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPerpAmmKeeper) EditPoolPegMultiplier

func (m *MockPerpAmmKeeper) EditPoolPegMultiplier(arg0 types1.Context, arg1 asset.Pair, arg2 types1.Dec) error

EditPoolPegMultiplier mocks base method.

func (*MockPerpAmmKeeper) ExistsPool

func (m *MockPerpAmmKeeper) ExistsPool(arg0 types1.Context, arg1 asset.Pair) bool

ExistsPool mocks base method.

func (*MockPerpAmmKeeper) GetAllPools

func (m *MockPerpAmmKeeper) GetAllPools(arg0 types1.Context) []types0.Market

GetAllPools mocks base method.

func (*MockPerpAmmKeeper) GetBaseAssetPrice

func (m *MockPerpAmmKeeper) GetBaseAssetPrice(arg0 types0.Market, arg1 types0.Direction, arg2 types1.Dec) (types1.Dec, error)

GetBaseAssetPrice mocks base method.

func (*MockPerpAmmKeeper) GetBaseAssetTWAP

func (m *MockPerpAmmKeeper) GetBaseAssetTWAP(arg0 types1.Context, arg1 asset.Pair, arg2 types0.Direction, arg3 types1.Dec, arg4 time.Duration) (types1.Dec, error)

GetBaseAssetTWAP mocks base method.

func (*MockPerpAmmKeeper) GetLastSnapshot

func (m *MockPerpAmmKeeper) GetLastSnapshot(arg0 types1.Context, arg1 types0.Market) (types0.ReserveSnapshot, error)

GetLastSnapshot mocks base method.

func (*MockPerpAmmKeeper) GetMaintenanceMarginRatio

func (m *MockPerpAmmKeeper) GetMaintenanceMarginRatio(arg0 types1.Context, arg1 asset.Pair) (types1.Dec, error)

GetMaintenanceMarginRatio mocks base method.

func (*MockPerpAmmKeeper) GetMarkPrice

func (m *MockPerpAmmKeeper) GetMarkPrice(arg0 types1.Context, arg1 asset.Pair) (types1.Dec, error)

GetMarkPrice mocks base method.

func (*MockPerpAmmKeeper) GetMarkPriceTWAP

func (m *MockPerpAmmKeeper) GetMarkPriceTWAP(arg0 types1.Context, arg1 asset.Pair, arg2 time.Duration) (types1.Dec, error)

GetMarkPriceTWAP mocks base method.

func (*MockPerpAmmKeeper) GetPool

func (m *MockPerpAmmKeeper) GetPool(arg0 types1.Context, arg1 asset.Pair) (types0.Market, error)

GetPool mocks base method.

func (*MockPerpAmmKeeper) GetSettlementPrice

func (m *MockPerpAmmKeeper) GetSettlementPrice(arg0 types1.Context, arg1 asset.Pair) (types1.Dec, error)

GetSettlementPrice mocks base method.

func (*MockPerpAmmKeeper) IsOverSpreadLimit

func (m *MockPerpAmmKeeper) IsOverSpreadLimit(arg0 types1.Context, arg1 asset.Pair) (bool, error)

IsOverSpreadLimit mocks base method.

func (*MockPerpAmmKeeper) SwapBaseForQuote

func (m *MockPerpAmmKeeper) SwapBaseForQuote(arg0 types1.Context, arg1 types0.Market, arg2 types0.Direction, arg3, arg4 types1.Dec, arg5 bool) (types0.Market, types1.Dec, error)

SwapBaseForQuote mocks base method.

func (*MockPerpAmmKeeper) SwapQuoteForBase

func (m *MockPerpAmmKeeper) SwapQuoteForBase(arg0 types1.Context, arg1 types0.Market, arg2 types0.Direction, arg3, arg4 types1.Dec, arg5 bool) (types0.Market, types1.Dec, error)

SwapQuoteForBase mocks base method.

type MockPerpAmmKeeperMockRecorder

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

MockPerpAmmKeeperMockRecorder is the mock recorder for MockPerpAmmKeeper.

func (*MockPerpAmmKeeperMockRecorder) EditPoolPegMultiplier

func (mr *MockPerpAmmKeeperMockRecorder) EditPoolPegMultiplier(arg0, arg1, arg2 interface{}) *gomock.Call

EditPoolPegMultiplier indicates an expected call of EditPoolPegMultiplier.

func (*MockPerpAmmKeeperMockRecorder) ExistsPool

func (mr *MockPerpAmmKeeperMockRecorder) ExistsPool(arg0, arg1 interface{}) *gomock.Call

ExistsPool indicates an expected call of ExistsPool.

func (*MockPerpAmmKeeperMockRecorder) GetAllPools

func (mr *MockPerpAmmKeeperMockRecorder) GetAllPools(arg0 interface{}) *gomock.Call

GetAllPools indicates an expected call of GetAllPools.

func (*MockPerpAmmKeeperMockRecorder) GetBaseAssetPrice

func (mr *MockPerpAmmKeeperMockRecorder) GetBaseAssetPrice(arg0, arg1, arg2 interface{}) *gomock.Call

GetBaseAssetPrice indicates an expected call of GetBaseAssetPrice.

func (*MockPerpAmmKeeperMockRecorder) GetBaseAssetTWAP

func (mr *MockPerpAmmKeeperMockRecorder) GetBaseAssetTWAP(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

GetBaseAssetTWAP indicates an expected call of GetBaseAssetTWAP.

func (*MockPerpAmmKeeperMockRecorder) GetLastSnapshot

func (mr *MockPerpAmmKeeperMockRecorder) GetLastSnapshot(arg0, arg1 interface{}) *gomock.Call

GetLastSnapshot indicates an expected call of GetLastSnapshot.

func (*MockPerpAmmKeeperMockRecorder) GetMaintenanceMarginRatio

func (mr *MockPerpAmmKeeperMockRecorder) GetMaintenanceMarginRatio(arg0, arg1 interface{}) *gomock.Call

GetMaintenanceMarginRatio indicates an expected call of GetMaintenanceMarginRatio.

func (*MockPerpAmmKeeperMockRecorder) GetMarkPrice

func (mr *MockPerpAmmKeeperMockRecorder) GetMarkPrice(arg0, arg1 interface{}) *gomock.Call

GetMarkPrice indicates an expected call of GetMarkPrice.

func (*MockPerpAmmKeeperMockRecorder) GetMarkPriceTWAP

func (mr *MockPerpAmmKeeperMockRecorder) GetMarkPriceTWAP(arg0, arg1, arg2 interface{}) *gomock.Call

GetMarkPriceTWAP indicates an expected call of GetMarkPriceTWAP.

func (*MockPerpAmmKeeperMockRecorder) GetPool

func (mr *MockPerpAmmKeeperMockRecorder) GetPool(arg0, arg1 interface{}) *gomock.Call

GetPool indicates an expected call of GetPool.

func (*MockPerpAmmKeeperMockRecorder) GetSettlementPrice

func (mr *MockPerpAmmKeeperMockRecorder) GetSettlementPrice(arg0, arg1 interface{}) *gomock.Call

GetSettlementPrice indicates an expected call of GetSettlementPrice.

func (*MockPerpAmmKeeperMockRecorder) IsOverSpreadLimit

func (mr *MockPerpAmmKeeperMockRecorder) IsOverSpreadLimit(arg0, arg1 interface{}) *gomock.Call

IsOverSpreadLimit indicates an expected call of IsOverSpreadLimit.

func (*MockPerpAmmKeeperMockRecorder) SwapBaseForQuote

func (mr *MockPerpAmmKeeperMockRecorder) SwapBaseForQuote(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

SwapBaseForQuote indicates an expected call of SwapBaseForQuote.

func (*MockPerpAmmKeeperMockRecorder) SwapQuoteForBase

func (mr *MockPerpAmmKeeperMockRecorder) SwapQuoteForBase(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

SwapQuoteForBase indicates an expected call of SwapQuoteForBase.

Jump to

Keyboard shortcuts

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