Documentation ¶
Index ¶
- func AppendCtxWithMockLogger(t *testing.T, ctx sdk.Context) (sdk.Context, *sdktestsmocks.MockLogger)
- func SpotPool(poolId uint64, assets sdk.Coins, shares int64) types.Pool
- func SpotStablePool(poolId uint64, assets sdk.Coins, shares int64) types.Pool
- func TestAMM(sqrtK sdk.Dec, priceMultiplier sdk.Dec) *types.AMM
- func TestAMMDefault() *types.AMM
- func TestMarket() *types.Market
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 SpotStablePool ¶
helper function to create dummy test pools
func TestAMMDefault ¶ added in v0.21.0
default market with sensible values for tests
func TestMarket ¶ added in v0.21.0
default market with sensible values for tests
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.