assertion

package
v0.21.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AMMShouldBeEqual

func AMMShouldBeEqual(pair asset.Pair, ammCheckers ...AMMChecker) ammShouldBeEqual

func ContainsLiquidateEvent added in v0.21.4

func ContainsLiquidateEvent(
	expectedEvent *types.LiquidationFailedEvent,
) action.Action

ContainsLiquidateEvent checks if a typed event (proto.Message) is contained in the event manager of the app context.

func MarketShouldBeEqual

func MarketShouldBeEqual(pair asset.Pair, marketCheckers ...MarketChecker) marketShouldBeEqual

func ModuleBalanceShouldBeEqualTo

func ModuleBalanceShouldBeEqualTo(module string, expectedBalance sdk.Coins) action.Action

func PositionChangedEventShouldBeEqual

func PositionChangedEventShouldBeEqual(
	expectedEvent *types.PositionChangedEvent,
) action.Action

PositionChangedEventShouldBeEqual checks that the position changed event is equal to the expected event.

func PositionNotionalTWAPShouldBeEqualTo

func PositionNotionalTWAPShouldBeEqualTo(pair asset.Pair, trader sdk.AccAddress, twapLookbackWindow time.Duration, expectedNotionalValue sdk.Dec) action.Action

func PositionShouldBeEqual

func PositionShouldBeEqual(
	account sdk.AccAddress, pair asset.Pair, positionCheckers ...PositionChecker,
) action.Action

func PositionShouldNotExist

func PositionShouldNotExist(account sdk.AccAddress, pair asset.Pair) action.Action

func TwapShouldBe

func TwapShouldBe(pair asset.Pair, twapCalcOpt types.TwapCalcOption, dir types.Direction, assetAmt sdk.Dec, twapLookbackWindow time.Duration, expectedTwap sdk.Dec) action.Action

Types

type AMMChecker

type AMMChecker func(amm types.AMM) error

func AMM_BaseReserveShouldBeEqual

func AMM_BaseReserveShouldBeEqual(expectedBaseReserve sdk.Dec) AMMChecker

func AMM_BiasShouldBeEqual

func AMM_BiasShouldBeEqual(expectedBias sdk.Dec) AMMChecker

func AMM_PriceMultiplierShouldBeEqual

func AMM_PriceMultiplierShouldBeEqual(expectedPriceMultiplier sdk.Dec) AMMChecker

func AMM_QuoteReserveShouldBeEqual

func AMM_QuoteReserveShouldBeEqual(expectedQuoteReserve sdk.Dec) AMMChecker

func AMM_SqrtDepthShouldBeEqual

func AMM_SqrtDepthShouldBeEqual(expectedSqrtDepth sdk.Dec) AMMChecker

func AMM_SwapInvariantShouldBeEqual

func AMM_SwapInvariantShouldBeEqual(expectedSwapInvariant sdk.Dec) AMMChecker

type MarketChecker

type MarketChecker func(resp types.Market) error

func Market_EnableShouldBeEqualTo

func Market_EnableShouldBeEqualTo(expectedEnabled bool) MarketChecker

func Market_LatestCPFShouldBeEqualTo

func Market_LatestCPFShouldBeEqualTo(expectedCPF sdk.Dec) MarketChecker

func Market_PrepaidBadDebtShouldBeEqualTo

func Market_PrepaidBadDebtShouldBeEqualTo(expectedAmount sdkmath.Int) MarketChecker

type PositionChecker

type PositionChecker func(resp types.Position) error

func Position_PositionShouldBeEqualTo

func Position_PositionShouldBeEqualTo(expectedPosition types.Position) PositionChecker

Position_PositionShouldBeEqualTo checks if the position is equal to the expected position

func Position_PositionSizeShouldBeEqualTo

func Position_PositionSizeShouldBeEqualTo(expectedSize sdk.Dec) PositionChecker

Position_PositionSizeShouldBeEqualTo checks if the position size is equal to the expected position size

Jump to

Keyboard shortcuts

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