Documentation
¶
Index ¶
- Constants
- func AccountPlusKeepers(t testing.TB) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func AffiliatesKeepers(t testing.TB, msgSenderEnabled bool) (ctx sdk.Context, keeper *affiliateskeeper.Keeper, ...)
- func AssertMarketCreateEventInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context, ...)
- func AssertMarketEventsNotInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context)
- func AssertMarketModifyEventInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context, ...)
- func AssertMarketPriceUpdateEventInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context, ...)
- func AssertNMarketEventsNotInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context, n int)
- func AssertPriceUpdateEventsInIndexerBlock(t testing.TB, k *keeper.Keeper, ctx sdk.Context, ...)
- func AssetsKeepers(t testing.TB, msgSenderEnabled bool) (ctx sdk.Context, keeper *keeper.Keeper, pricesKeeper *priceskeeper.Keeper, ...)
- func BridgeKeepers(t testing.TB) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func CreateLiquidityTiersAndNPerpetuals(t testing.TB, ctx sdk.Context, keeper *keeper.Keeper, ...) []types.Perpetual
- func CreateMarketsInMarketMapFromParams(t testing.TB, ctx sdk.Context, mmk *marketmapkeeper.Keeper, ...)
- func CreateNClobPair(t testing.TB, keeper *keeper.Keeper, perpKeeper *perpkeeper.Keeper, ...) []types.ClobPair
- func CreateNMarkets(t testing.TB, ctx sdk.Context, keeper *keeper.Keeper, n int) []types.MarketParamPrice
- func CreateNPerpetuals(t testing.TB, ctx sdk.Context, keeper *keeper.Keeper, ...) ([]types.Perpetual, error)
- func CreateTestClobPairs(t testing.TB, ctx sdk.Context, clobKeeper *keeper.Keeper, ...)
- func CreateTestLiquidityTiers(t testing.TB, ctx sdk.Context, k *keeper.Keeper)
- func CreateTestMarket(t testing.TB, ctx sdk.Context, k *keeper.Keeper, marketParam types.MarketParam, ...) (types.MarketParam, error)
- func CreateTestMarkets(t testing.TB, ctx sdk.Context, k *keeper.Keeper)
- func CreateTestPerpetuals(t testing.TB, ctx sdk.Context, k *keeper.Keeper)
- func CreateTestPriceMarkets(t testing.TB, ctx sdk.Context, pricesKeeper *keeper.Keeper, ...)
- func CreateTestPricesAndPerpetualMarkets(t testing.TB, ctx sdk.Context, perpKeeper *keeper.Keeper, ...)
- func CreateUsdcAsset(ctx sdk.Context, assetsKeeper *keeper.Keeper) error
- func DelayMsgKeeperWithMockBridgeKeeper(t testing.TB) (ctx sdk.Context, delayMsgKeeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func DelayMsgKeepers(t testing.TB) (ctx sdk.Context, delayMsgKeeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func EpochsKeeper(t testing.TB) (ctx sdk.Context, epochsKeeper *keeper.Keeper, storeKey storetypes.StoreKey)
- func GetAssetCreateEventsFromIndexerBlock(ctx sdk.Context, keeper *keeper.Keeper) []*indexerevents.AssetCreateEventV1
- func GetLiquidityTierUpsertEventsFromIndexerBlock(ctx sdk.Context, keeper *keeper.Keeper) []*indexerevents.LiquidityTierUpsertEventV1
- func GetNumMarkets(t testing.TB, ctx sdk.Context, keeper *keeper.Keeper) uint32
- func GetSubaccountUpdateEventsFromIndexerBlock(ctx sdk.Context, keeper *keeper.Keeper) []*indexerevents.SubaccountUpdateEventV1
- func GetTradingRewardEventsFromIndexerTendermintBlock(block indexer_manager.IndexerTendermintBlock) []*indexerevents.TradingRewardsEventV1
- func ListingKeepers(t testing.TB, bankKeeper bankkeeper.Keeper) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func PopulateTestPremiumStore(t testing.TB, ctx sdk.Context, k *keeper.Keeper, perpetuals []types.Perpetual, ...)
- func PricesKeepers(t testing.TB) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func RevShareKeepers(t testing.TB) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- func RewardsKeepers(t testing.TB) (ctx sdk.Context, rewardsKeeper *rewardskeeper.Keeper, ...)
- func SubaccountsKeepers(t testing.TB, msgSenderEnabled bool) (ctx sdk.Context, keeper *keeper.Keeper, pricesKeeper *priceskeeper.Keeper, ...)
- func VaultKeepers(t testing.TB) (ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey)
- func VestKeepers(t testing.TB) (ctx sdk.Context, vestKeeper *keeper.Keeper, storeKey storetypes.StoreKey, ...)
- type ClobKeepersTestContext
- type GenesisInitializer
- type PerpKeepersTestContext
- type SendingKeepersTestContext
Constants ¶
const ( TestEpochInfoName = "name" TestEpochDuration = uint32(20) TestCreateEpochBlockTimeSec = 1656900000 )
Variables ¶
This section is empty.
Functions ¶
func AccountPlusKeepers ¶
func AccountPlusKeepers(t testing.TB) ( ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, mockTimeProvider *mocks.TimeProvider, )
func AffiliatesKeepers ¶
func AffiliatesKeepers(t testing.TB, msgSenderEnabled bool) ( ctx sdk.Context, keeper *affiliateskeeper.Keeper, statsKeeper *statskeeper.Keeper, storeKey storetypes.StoreKey, )
func AssertMarketCreateEventInIndexerBlock ¶
func AssertMarketCreateEventInIndexerBlock( t testing.TB, k *keeper.Keeper, ctx sdk.Context, createdMarketParam types.MarketParam, )
AssertMarketCreateEventInIndexerBlock verifies that the market create has a corresponding market create event included in the Indexer block message.
func AssertMarketEventsNotInIndexerBlock ¶
AssertMarketEventsNotInIndexerBlock verifies that no market events were included in the Indexer block message.
func AssertMarketModifyEventInIndexerBlock ¶
func AssertMarketModifyEventInIndexerBlock( t testing.TB, k *keeper.Keeper, ctx sdk.Context, updatedMarketParam types.MarketParam, )
AssertMarketModifyEventInIndexerBlock verifies that the market update has a corresponding market modify event included in the Indexer block message.
func AssertNMarketEventsNotInIndexerBlock ¶
func AssertNMarketEventsNotInIndexerBlock( t testing.TB, k *keeper.Keeper, ctx sdk.Context, n int, )
AssertNMarketEventsNotInIndexerBlock verifies that N market events were included in the Indexer block message.
func AssertPriceUpdateEventsInIndexerBlock ¶
func AssertPriceUpdateEventsInIndexerBlock( t testing.TB, k *keeper.Keeper, ctx sdk.Context, updatedMarketPrices []types.MarketPrice, )
AssertPriceUpdateEventsInIndexerBlock verifies that the market update has a corresponding price update event included in the Indexer block message.
func AssetsKeepers ¶
func AssetsKeepers( t testing.TB, msgSenderEnabled bool, ) ( ctx sdk.Context, keeper *keeper.Keeper, pricesKeeper *priceskeeper.Keeper, accountKeeper *authkeeper.AccountKeeper, bankKeeper *bankkeeper.BaseKeeper, storeKey storetypes.StoreKey, )
func BridgeKeepers ¶
func BridgeKeepers( t testing.TB, ) ( ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, mockTimeProvider *mocks.TimeProvider, bridgeEventManager *bridgeserver_types.BridgeEventManager, bankKeeper *bankkeeper.BaseKeeper, mockDelayMsgKeeper *mocks.DelayMsgKeeper, )
func CreateMarketsInMarketMapFromParams ¶
func CreateMarketsInMarketMapFromParams( t testing.TB, ctx sdk.Context, mmk *marketmapkeeper.Keeper, allMarketParams []types.MarketParam, )
Convert MarketParams into MarketMap markets and create them in the MarketMap keeper.
func CreateNClobPair ¶
func CreateNClobPair( t testing.TB, keeper *keeper.Keeper, perpKeeper *perpkeeper.Keeper, pricesKeeper *priceskeeper.Keeper, ctx sdk.Context, n int, mockIndexerEventManager *mocks.IndexerEventManager, ) []types.ClobPair
func CreateNMarkets ¶
func CreateNMarkets(t testing.TB, ctx sdk.Context, keeper *keeper.Keeper, n int) []types.MarketParamPrice
CreateNMarkets creates N MarketParam, MarketPrice pairs for testing.
func CreateNPerpetuals ¶
func CreateTestClobPairs ¶
func CreateTestMarket ¶
func CreateTestMarket( t testing.TB, ctx sdk.Context, k *keeper.Keeper, marketParam types.MarketParam, marketPrice types.MarketPrice, ) (types.MarketParam, error)
CreateTestMarket creates a market with the given MarketParam and MarketPrice. It creates this market in the market map first.
func CreateTestMarkets ¶
CreateTestMarkets creates a standard set of test markets for testing. This function assumes no markets exist and will create markets as id `0`, `1`, and `2`, ... using markets defined in constants.TestMarkets.
func CreateTestPerpetuals ¶
func CreateTestPriceMarkets ¶
func CreateTestPriceMarkets( t testing.TB, ctx sdk.Context, pricesKeeper *keeper.Keeper, markets []types.MarketParamPrice, )
CreateTestPriceMarkets is a test utility function that creates list of given price markets in state.
func CreateTestPricesAndPerpetualMarkets ¶
func CreateTestPricesAndPerpetualMarkets( t testing.TB, ctx sdk.Context, perpKeeper *keeper.Keeper, pricesKeeper *priceskeeper.Keeper, perpetuals []types.Perpetual, markets []pricestypes.MarketParamPrice, )
CreateTestPricesAndPerpetualMarkets is a test utility function that creates list of given prices and perpetual markets in state.
func CreateUsdcAsset ¶
CreateUsdcAsset creates USDC in the assets module for tests.
func DelayMsgKeepers ¶
func DelayMsgKeepers( t testing.TB, ) ( ctx sdk.Context, delayMsgKeeper *keeper.Keeper, storeKey storetypes.StoreKey, bridgeKeeper *bridgekeeper.Keeper, bankKeeper bankkeeper.Keeper, authorities []string, )
func EpochsKeeper ¶
func GetAssetCreateEventsFromIndexerBlock ¶
func GetAssetCreateEventsFromIndexerBlock( ctx sdk.Context, keeper *keeper.Keeper, ) []*indexerevents.AssetCreateEventV1
GetAssetCreateEventsFromIndexerBlock returns the asset create events in the Indexer Block event Kafka message.
func GetLiquidityTierUpsertEventsFromIndexerBlock ¶
func GetLiquidityTierUpsertEventsFromIndexerBlock( ctx sdk.Context, keeper *keeper.Keeper, ) []*indexerevents.LiquidityTierUpsertEventV1
GetLiquidityTierUpsertEventsFromIndexerBlock returns the liquidityTier upsert events in the Indexer Block event Kafka message. TODO(IND-365): Consider using generics here to reduce duplicated code.
func GetNumMarkets ¶
func GetSubaccountUpdateEventsFromIndexerBlock ¶
func GetSubaccountUpdateEventsFromIndexerBlock( ctx sdk.Context, keeper *keeper.Keeper, ) []*indexerevents.SubaccountUpdateEventV1
GetSubaccountUpdateEventsFromIndexerBlock returns the subaccount update events in the Indexer Block event Kafka message.
func GetTradingRewardEventsFromIndexerTendermintBlock ¶
func GetTradingRewardEventsFromIndexerTendermintBlock( block indexer_manager.IndexerTendermintBlock, ) []*indexerevents.TradingRewardsEventV1
func ListingKeepers ¶
func ListingKeepers( t testing.TB, bankKeeper bankkeeper.Keeper, ) ( ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, mockTimeProvider *mocks.TimeProvider, pricesKeeper *priceskeeper.Keeper, perpetualsKeeper *perpetualskeeper.Keeper, clobKeeper *clobkeeper.Keeper, marketMapKeeper *marketmapkeeper.Keeper, assetsKeeper *assetskeeper.Keeper, bankKeeper_out *bankkeeper.BaseKeeper, subaccountsKeeper *subaccountskeeper.Keeper, )
func PopulateTestPremiumStore ¶
func PopulateTestPremiumStore( t testing.TB, ctx sdk.Context, k *keeper.Keeper, perpetuals []types.Perpetual, testFundingPremiums []int32, isVote bool, )
PopulateTestPremiumStore populates either `PremiumVotes` (`isVote` is true) or `PremiumSamples` (`isVote` is false) for test. For each perpetual in the given perpetuals, insert the same list of testFundingSamples into state.
func PricesKeepers ¶
func PricesKeepers(t testing.TB) ( ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, indexPriceCache *pricefeedserver_types.MarketToExchangePrices, mockTimeProvider *mocks.TimeProvider, revShareKeeper *revsharekeeper.Keeper, marketMapKeeper *marketmapkeeper.Keeper, )
func RevShareKeepers ¶
func RevShareKeepers(t testing.TB) ( ctx sdk.Context, keeper *keeper.Keeper, storeKey storetypes.StoreKey, mockTimeProvider *mocks.TimeProvider, )
func RewardsKeepers ¶
func RewardsKeepers( t testing.TB, ) ( ctx sdk.Context, rewardsKeeper *rewardskeeper.Keeper, feetiersKeeper *feetierskeeper.Keeper, bankKeeper bankkeeper.Keeper, assetsKeeper *assetskeeper.Keeper, pricesKeeper *priceskeeper.Keeper, indexerEventManager indexer_manager.IndexerEventManager, storeKey storetypes.StoreKey, )
func SubaccountsKeepers ¶
func SubaccountsKeepers(t testing.TB, msgSenderEnabled bool) ( ctx sdk.Context, keeper *keeper.Keeper, pricesKeeper *priceskeeper.Keeper, perpetualsKeeper *perpskeeper.Keeper, accountKeeper *authkeeper.AccountKeeper, bankKeeper *bankkeeper.BaseKeeper, assetsKeeper *asskeeper.Keeper, blocktimeKeeper *blocktimekeeper.Keeper, revShareKeeper *revsharekeeper.Keeper, affiliatesKeeper *affiliateskeeper.Keeper, storeKey storetypes.StoreKey, )
func VaultKeepers ¶
func VestKeepers ¶
func VestKeepers( t testing.TB, ) ( ctx sdk.Context, vestKeeper *keeper.Keeper, storeKey storetypes.StoreKey, bankKeeper *bankkeeper.BaseKeeper, blocktimeKeeper *blocktimekeeper.Keeper, authorities []string, )
Types ¶
type ClobKeepersTestContext ¶
type ClobKeepersTestContext struct {
Ctx sdk.Context
ClobKeeper *keeper.Keeper
MarketMapKeeper *marketmapkeeper.Keeper
PricesKeeper *priceskeeper.Keeper
AssetsKeeper *asskeeper.Keeper
BlockTimeKeeper *blocktimekeeper.Keeper
FeeTiersKeeper *feetierskeeper.Keeper
PerpetualsKeeper *perpkeeper.Keeper
StatsKeeper *statskeeper.Keeper
RewardsKeeper *rewardskeeper.Keeper
SubaccountsKeeper *subkeeper.Keeper
AffiliatesKeeper *affiliateskeeper.Keeper
VaultKeeper *vaultkeeper.Keeper
AccountPlusKeeper *accountpluskeeper.Keeper
StoreKey storetypes.StoreKey
MemKey storetypes.StoreKey
Cdc *codec.ProtoCodec
}
func NewClobKeepersTestContext ¶
func NewClobKeepersTestContext( t testing.TB, memClob types.MemClob, bankKeeper bankkeeper.Keeper, indexerEventManager indexer_manager.IndexerEventManager, ) (ks ClobKeepersTestContext)
func NewClobKeepersTestContextWithUninitializedMemStore ¶
func NewClobKeepersTestContextWithUninitializedMemStore( t testing.TB, memClob types.MemClob, bankKeeper bankkeeper.Keeper, indexerEventManager indexer_manager.IndexerEventManager, ) (ks ClobKeepersTestContext)
type GenesisInitializer ¶
type PerpKeepersTestContext ¶
type PerpKeepersTestContext struct {
Ctx sdk.Context
PricesKeeper *priceskeeper.Keeper
IndexPriceCache *pricefeedserver_types.MarketToExchangePrices
AssetsKeeper *assetskeeper.Keeper
EpochsKeeper *epochskeeper.Keeper
PerpetualsKeeper *keeper.Keeper
MarketMapKeeper *marketmapkeeper.Keeper
StoreKey storetypes.StoreKey
MemKey storetypes.StoreKey
Cdc *codec.ProtoCodec
MockTimeProvider *mocks.TimeProvider
TransientStoreKey storetypes.StoreKey
}
func PerpetualsKeepers ¶
func PerpetualsKeepers( t testing.TB, ) (pc PerpKeepersTestContext)
func PerpetualsKeepersWithClobHelpers ¶
func PerpetualsKeepersWithClobHelpers( t testing.TB, clobKeeper types.PerpetualsClobKeeper, ) (pc PerpKeepersTestContext)
type SendingKeepersTestContext ¶
type SendingKeepersTestContext struct {
Ctx sdk.Context
SendingKeeper *keeper.Keeper
AccountKeeper *authkeeper.AccountKeeper
BankKeeper *bankkeeper.BaseKeeper
PricesKeeper *priceskeeper.Keeper
PerpetualsKeeper *perpkeeper.Keeper
AssetsKeeper *assetskeeper.Keeper
SubaccountsKeeper types.SubaccountsKeeper
StoreKey storetypes.StoreKey
}
func SendingKeepers ¶
func SendingKeepers(t testing.TB) ( ks SendingKeepersTestContext, )
func SendingKeepersWithSubaccountsKeeper ¶
func SendingKeepersWithSubaccountsKeeper(t testing.TB, saKeeper types.SubaccountsKeeper) ( ks SendingKeepersTestContext, )