steps

package
v0.73.0-preview.16 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Account

func Account(name string) (types.AccountType, error)

func AccountID

func AccountID(marketID, partyID, asset string, ty types.AccountType) string

func AuctionTrigger

func AuctionTrigger(name string) (types.AuctionTrigger, error)

func Bool

func Bool(rawValue string) (bool, error)

func ClearAllEvents

func ClearAllEvents(broker *stubs.BrokerStub)

func ClearTransferResponseEvents

func ClearTransferResponseEvents(broker *stubs.BrokerStub)

func CreateNetworkTreasuryAccount added in v0.73.0

func CreateNetworkTreasuryAccount(col *collateral.Engine, asset string) error

func DebugAccounts

func DebugAccounts(broker *stubs.BrokerStub, log *logging.Logger)

func DebugAllEvents

func DebugAllEvents(broker *stubs.BrokerStub, log *logging.Logger)

func DebugAuctionEvents

func DebugAuctionEvents(broker *stubs.BrokerStub, log *logging.Logger)

func DebugLPDetail

func DebugLPDetail(log *logging.Logger, broker *stubs.BrokerStub)

func DebugLPSTxErrors

func DebugLPSTxErrors(broker *stubs.BrokerStub, log *logging.Logger)

func DebugLPs

func DebugLPs(broker *stubs.BrokerStub, log *logging.Logger)

func DebugLastNEvents added in v0.68.0

func DebugLastNEvents(n int, broker *stubs.BrokerStub, log *logging.Logger)

func DebugMarketData

func DebugMarketData(
	exec Execution,
	log *logging.Logger,
	market string,
) error

func DebugNetworkParameter added in v0.73.0

func DebugNetworkParameter(log *logging.Logger, netParams *netparams.Store, key string) error

func DebugOrders

func DebugOrders(broker *stubs.BrokerStub, log *logging.Logger)

func DebugTrades

func DebugTrades(broker *stubs.BrokerStub, log *logging.Logger)

func DebugTransfers

func DebugTransfers(broker *stubs.BrokerStub, log *logging.Logger)

func DebugTxErrors

func DebugTxErrors(broker *stubs.BrokerStub, log *logging.Logger)

func DebugVolumesForMarket

func DebugVolumesForMarket(log *logging.Logger, broker *stubs.BrokerStub, marketID string) error

func DebugVolumesForMarketDetail

func DebugVolumesForMarketDetail(log *logging.Logger, broker *stubs.BrokerStub, marketID string) error

func Decimal

func Decimal(rawValue string) (num.Decimal, error)

func EventType

func EventType(rawValue string) (events.Type, error)

func ExpectingEventsInTheSecenarioSoFar added in v0.68.0

func ExpectingEventsInTheSecenarioSoFar(broker *stubs.BrokerStub, expected int) error

func ExpectingEventsOverStep added in v0.68.0

func ExpectingEventsOverStep(broker *stubs.BrokerStub, eventsBeforeStep, expected int) error

func ExpiryStrategy added in v0.72.0

func ExpiryStrategy(rawValue string) (types.StopOrderExpiryStrategy, error)

func F64

func F64(rawValue string) (float64, error)

func F64Slice

func F64Slice(rawValue string, sep string) ([]float64, error)

func I64

func I64(rawValue string) (int64, error)

func I64Slice

func I64Slice(rawValue string, sep string) ([]int64, error)

func LiquidityStatus

func LiquidityStatus(rawValue string) (types.LiquidityProvisionStatus, error)

func MarketOpeningAuctionPeriodEnds

func MarketOpeningAuctionPeriodEnds(execEngine Execution, timeStub *stubs.TimeStub, markets []types.Market, marketID string) error

func MarketState

func MarketState(name string) (types.MarketState, error)

func MarketStateUpdate added in v0.73.0

func MarketStateUpdate(name string) (types.MarketStateUpdateType, error)

func OracleSpecConditionOperator

func OracleSpecConditionOperator(name string) (datav1.Condition_Operator, error)

func OracleSpecPropertyType

func OracleSpecPropertyType(name string) (datav1.PropertyKey_Type, error)

func OracleSpecSettlementDataDecimals added in v0.56.0

func OracleSpecSettlementDataDecimals(config *market.Config, name string, settlementDP string) error

func OraclesBroadcastDataSignedWithKeys

func OraclesBroadcastDataSignedWithKeys(
	oracleEngine *spec.Engine,
	timesvc *stubs.TimeStub,
	rawPubKeys string,
	rawProperties *godog.Table,
) error

func OraclesBroadcastDataWithBlockTimeSignedWithKeys added in v0.73.0

func OraclesBroadcastDataWithBlockTimeSignedWithKeys(
	oracleEngine *spec.Engine,
	timesvc *stubs.TimeStub,
	rawPubKeys string,
	rawProperties *godog.Table,
) error

func OrderStatus

func OrderStatus(rawValue string) (types.OrderStatus, error)

func OrderType

func OrderType(rawValue string) (types.OrderType, error)

func PartiesAmendTheFollowingOrders

func PartiesAmendTheFollowingOrders(
	broker *stubs.BrokerStub,
	exec Execution,
	table *godog.Table,
) error

func PartiesAmendTheFollowingPeggedIcebergOrders added in v0.73.0

func PartiesAmendTheFollowingPeggedIcebergOrders(
	broker *stubs.BrokerStub,
	exec Execution,
	ts *stubs.TimeStub,
	table *godog.Table,
) error

func PartiesApplyTheFollowingReferralCode added in v0.73.0

func PartiesApplyTheFollowingReferralCode(referralEngine *referral.Engine, teamsEngine *teams.Engine, table *godog.Table) error

func PartiesCancelAllTheirOrdersForTheMarkets

func PartiesCancelAllTheirOrdersForTheMarkets(
	broker *stubs.BrokerStub,
	exec Execution,
	table *godog.Table,
) error

func PartiesCancelTheFollowingOrders

func PartiesCancelTheFollowingOrders(
	broker *stubs.BrokerStub,
	exec Execution,
	table *godog.Table,
) error

func PartiesCancelTheFollowingStopOrders added in v0.72.0

func PartiesCancelTheFollowingStopOrders(
	broker *stubs.BrokerStub,
	exec Execution,
	table *godog.Table,
) error

func PartiesCancelTransfers

func PartiesCancelTransfers(
	engine *banking.Engine,
	table *godog.Table,
) error

func PartiesCreateTheFollowingReferralCode added in v0.73.0

func PartiesCreateTheFollowingReferralCode(referralEngine *referral.Engine, teamsEngine *teams.Engine, table *godog.Table) error

func PartiesDelegateTheFollowingStake

func PartiesDelegateTheFollowingStake(
	engine *delegation.Engine,
	table *godog.Table,
) error

func PartiesDepositTheFollowingAssets

func PartiesDepositTheFollowingAssets(
	collateralEngine *collateral.Engine,
	broker *stubs.BrokerStub,
	netDeposits *num.Uint,
	table *godog.Table,
) error

func PartiesHaveTheFollowingProfitAndLoss

func PartiesHaveTheFollowingProfitAndLoss(
	positionService *plugins.Positions,
	table *godog.Table,
) error

func PartiesPlaceTheFollowingIcebergOrders added in v0.72.0

func PartiesPlaceTheFollowingIcebergOrders(
	exec Execution,
	ts *stubs.TimeStub,
	table *godog.Table,
) error

func PartiesPlaceTheFollowingOrders

func PartiesPlaceTheFollowingOrders(
	exec Execution,
	ts *stubs.TimeStub,
	table *godog.Table,
) error

func PartiesPlaceTheFollowingOrdersBlocksApart added in v0.63.0

func PartiesPlaceTheFollowingOrdersBlocksApart(exec Execution, time *stubs.TimeStub, block *helpers.Block, epochService EpochService, table *godog.Table, blockCount string) error

func PartiesPlaceTheFollowingOrdersWithTicks added in v0.63.0

func PartiesPlaceTheFollowingOrdersWithTicks(exec Execution, time *stubs.TimeStub, epochService EpochService, table *godog.Table) error

func PartiesPlaceTheFollowingPeggedIcebergOrders added in v0.72.0

func PartiesPlaceTheFollowingPeggedIcebergOrders(
	exec Execution,
	ts *stubs.TimeStub,
	table *godog.Table,
) error

func PartiesPlaceTheFollowingPeggedOrders

func PartiesPlaceTheFollowingPeggedOrders(exec Execution, table *godog.Table) error

func PartiesShouldHaveTheFollowingAccountBalances

func PartiesShouldHaveTheFollowingAccountBalances(
	broker *stubs.BrokerStub,
	table *godog.Table,
) error

func PartiesShouldHaveTheFollowingDelegationBalances

func PartiesShouldHaveTheFollowingDelegationBalances(
	broker *stubs.BrokerStub,
	table *godog.Table,
	epochSeq string,
) error

func PartiesShouldHaveTheFollowingPositionStatus added in v0.71.0

func PartiesShouldHaveTheFollowingPositionStatus(
	broker *stubs.BrokerStub,
	market string,
	table *godog.Table,
) error

func PartiesShouldHaveTheFollowingPositionStatusAgg added in v0.71.0

func PartiesShouldHaveTheFollowingPositionStatusAgg(
	broker *stubs.BrokerStub,
	market string,
	table *godog.Table,
) error

func PartiesShouldHaveTheFollowingStakingAccountBalances

func PartiesShouldHaveTheFollowingStakingAccountBalances(
	stakingAccounts *stubs.StakingAccountStub,
	table *godog.Table,
) error

func PartiesShouldHaveVestedAccountBalances added in v0.73.0

func PartiesShouldHaveVestedAccountBalances(broker *stubs.BrokerStub, table *godog.Table) error

func PartiesShouldHaveVestingAccountBalances added in v0.73.0

func PartiesShouldHaveVestingAccountBalances(broker *stubs.BrokerStub, table *godog.Table) error

func PartiesShouldReceiveTheFollowingReward

func PartiesShouldReceiveTheFollowingReward(
	broker *stubs.BrokerStub,
	table *godog.Table,
	epochSeq string,
) error

func PartiesSubmitLiquidityProvision

func PartiesSubmitLiquidityProvision(exec Execution, table *godog.Table) error

func PartiesSubmitRecurringTransfers

func PartiesSubmitRecurringTransfers(
	engine *banking.Engine,
	table *godog.Table,
) error

func PartiesSubmitTransfers

func PartiesSubmitTransfers(
	engine *banking.Engine,
	table *godog.Table,
) error

func PartiesTransferToStakingAccount

func PartiesTransferToStakingAccount(
	stakingAccountStub *stubs.StakingAccountStub,
	broker *stubs.BrokerStub,
	table *godog.Table,
	epoch string,
) error

func PartiesUndelegateTheFollowingStake

func PartiesUndelegateTheFollowingStake(
	engine *delegation.Engine,
	table *godog.Table,
) error

func PartiesWithdrawFromStakingAccount

func PartiesWithdrawFromStakingAccount(
	stakingAccountStub *stubs.StakingAccountStub,
	broker *stubs.BrokerStub,
	table *godog.Table,
) error

func PartiesWithdrawTheFollowingAssets

func PartiesWithdrawTheFollowingAssets(
	collateral *collateral.Engine,
	broker *stubs.BrokerStub,
	netDeposits *num.Uint,
	table *godog.Table,
) error

func PartyAddsTheFollowingIcebergOrdersToABatch added in v0.72.0

func PartyAddsTheFollowingIcebergOrdersToABatch(party string, exec Execution, time *stubs.TimeStub, table *godog.Table) error

func PartyAddsTheFollowingOrdersToABatch added in v0.72.0

func PartyAddsTheFollowingOrdersToABatch(party string, exec Execution, time *stubs.TimeStub, table *godog.Table) error

func PartyCancelsAllTheirStopOrders added in v0.72.0

func PartyCancelsAllTheirStopOrders(
	exec Execution,
	partyID string,
) error

func PartyCancelsAllTheirStopOrdersForTheMarket added in v0.72.0

func PartyCancelsAllTheirStopOrdersForTheMarket(
	exec Execution,
	partyID string,
	marketID string,
) error

func PartyCancelsTheirLiquidityProvision

func PartyCancelsTheirLiquidityProvision(exec Execution, marketID, party string) error

func PartyHasTheFollowingDiscountFactor added in v0.73.0

func PartyHasTheFollowingDiscountFactor(party, discountFactor string, vde *volumediscount.Engine) error

func PartyHasTheFollowingTakerNotional added in v0.73.0

func PartyHasTheFollowingTakerNotional(party, notional string, vde *volumediscount.Engine) error

func PartyShouldHaveGeneralAccountBalanceForAsset

func PartyShouldHaveGeneralAccountBalanceForAsset(
	broker *stubs.BrokerStub,
	party, asset, rawBalance string,
) error

func PartyShouldHaveHoldingAccountBalanceForAsset added in v0.73.0

func PartyShouldHaveHoldingAccountBalanceForAsset(
	broker *stubs.BrokerStub,
	party, asset, rawBalance string,
) error

func PartyShouldHaveOneAccountPerAsset

func PartyShouldHaveOneAccountPerAsset(
	broker *stubs.BrokerStub,
	owner string,
) error

func PartyShouldHaveOneMarginAccountPerMarket

func PartyShouldHaveOneMarginAccountPerMarket(
	broker *stubs.BrokerStub,
	owner string,
) error

func PartyShouldHaveVestedAccountBalanceForAsset added in v0.73.0

func PartyShouldHaveVestedAccountBalanceForAsset(
	broker *stubs.BrokerStub,
	party, asset, rawBalance string,
) error

func PartyShouldHaveVestingAccountBalanceForAsset added in v0.73.0

func PartyShouldHaveVestingAccountBalanceForAsset(
	broker *stubs.BrokerStub,
	party, asset, rawBalance string,
) error

func PartyStartsABatchInstruction added in v0.72.0

func PartyStartsABatchInstruction(party string, exec Execution) error

func PartySubmitsTheirBatchInstruction added in v0.72.0

func PartySubmitsTheirBatchInstruction(party string, exec Execution) error

func PositionStatus added in v0.71.0

func PositionStatus(rawValue string) (proto.PositionStatus, error)

func RegisterAsset

func RegisterAsset(tbl *godog.Table, asset *stubs.AssetStub, col *collateral.Engine) error

func RewardAccountBalanceForAssetShouldMatch

func RewardAccountBalanceForAssetShouldMatch(
	broker *stubs.BrokerStub,
	accountType, asset, rawBalance string,
) error

func Side

func Side(rawValue string) (types.Side, error)

func StopOrderStatus added in v0.72.0

func StopOrderStatus(rawValue string) (types.StopOrderStatus, error)

func StrSlice

func StrSlice(value string, sep string) []string

func TIF

func TIF(rawValue string) (types.OrderTimeInForce, error)

func TheAccumulatedInfrastructureFeesShouldBeForTheMarket

func TheAccumulatedInfrastructureFeesShouldBeForTheMarket(
	broker *stubs.BrokerStub,
	amountStr, asset string,
) error

func TheAccumulatedLiquidityFeesShouldBeForTheMarket

func TheAccumulatedLiquidityFeesShouldBeForTheMarket(
	broker *stubs.BrokerStub,
	amountStr, market string,
) error

func TheActivityStreaksShouldBe added in v0.73.0

func TheActivityStreaksShouldBe(broker *stubs.BrokerStub, epochStr string, table *godog.Table) error

func TheAuctionTradedVolumeAndPriceShouldBe

func TheAuctionTradedVolumeAndPriceShouldBe(broker *stubs.BrokerStub, volume, price string, now time.Time) error

TheAuctionTradedVolumeAndPriceShouldBe pass in time at which the trades should happen in case there are previous trades in the broker stub.

func TheAverageBlockDurationIs

func TheAverageBlockDurationIs(block *helpers.Block, dur string) error

func TheAverageBlockDurationWithVariance

func TheAverageBlockDurationWithVariance(block *helpers.Block, dur, variance string) error

func TheCumulatedBalanceForAllAccountsShouldBeWorth

func TheCumulatedBalanceForAllAccountsShouldBeWorth(broker *stubs.BrokerStub, rawAmount string) error

func TheCurrentEpochIs added in v0.73.0

func TheCurrentEpochIs(broker *stubs.BrokerStub, epoch string) error

func TheFeesConfiguration

func TheFeesConfiguration(config *market.Config, name string, table *godog.Table) error

func TheFollowingEventsShouldBeEmitted

func TheFollowingEventsShouldBeEmitted(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingEventsShouldNotBeEmitted added in v0.58.0

func TheFollowingEventsShouldNotBeEmitted(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingLPEventsShouldBeEmitted

func TheFollowingLPEventsShouldBeEmitted(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingNetworkParametersAreSet

func TheFollowingNetworkParametersAreSet(netParams *netparams.Store, table *godog.Table) error

func TheFollowingNetworkTradesShouldBeExecuted

func TheFollowingNetworkTradesShouldBeExecuted(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingOrdersShouldBeRejected

func TheFollowingOrdersShouldBeRejected(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingOrdersShouldBeStopped

func TheFollowingOrdersShouldBeStopped(broker *stubs.BrokerStub, table *godog.Table) error

func TheFollowingTeamsWithRefereesAreCreated added in v0.73.0

func TheFollowingTeamsWithRefereesAreCreated(
	col *collateral.Engine,
	broker *stubs.BrokerStub,
	netDeposits *num.Uint,
	referralEngine *referral.Engine,
	teamsEngine *teams.Engine,
	table *godog.Table,
) error

func TheFollowingTradesShouldBeExecuted

func TheFollowingTradesShouldBeExecuted(
	broker *stubs.BrokerStub,
	table *godog.Table,
) error

func TheFollowingTransfersShouldHappen

func TheFollowingTransfersShouldHappen(
	broker *stubs.BrokerStub,
	table *godog.Table,
) error

func TheGlobalInsuranceBalanceShouldBeForTheAsset added in v0.73.0

func TheGlobalInsuranceBalanceShouldBeForTheAsset(
	broker *stubs.BrokerStub,
	rawAmount, asset string,
) error

func TheIcebergOrdersShouldHaveTheFollowingStates added in v0.72.0

func TheIcebergOrdersShouldHaveTheFollowingStates(broker *stubs.BrokerStub, table *godog.Table) error

func TheInsurancePoolBalanceShouldBeForTheMarket

func TheInsurancePoolBalanceShouldBeForTheMarket(
	broker *stubs.BrokerStub,
	rawAmount, market string,
) error

func TheLPLiquidityBondBalanceShouldBeForTheMarket added in v0.73.0

func TheLPLiquidityBondBalanceShouldBeForTheMarket(
	broker *stubs.BrokerStub,
	party, rawAmount, market string,
) error

func TheLPLiquidityFeeBalanceShouldBeForTheMarket added in v0.73.0

func TheLPLiquidityFeeBalanceShouldBeForTheMarket(
	broker *stubs.BrokerStub,
	party, rawAmount, market string,
) error

func TheLastStateUpdateShouldBeForMarket added in v0.72.0

func TheLastStateUpdateShouldBeForMarket(
	broker *stubs.BrokerStub,
	market, expectedMarketStateStr string,
) error

func TheLiquidityFeeFactorShouldForTheMarket

func TheLiquidityFeeFactorShouldForTheMarket(
	broker *stubs.BrokerStub,
	feeStr, market string,
) error

func TheLiquidityMonitoring added in v0.57.0

func TheLiquidityMonitoring(config *market.Config, table *godog.Table) error

func TheLiquidityProviderFeeSharesForTheMarketShouldBe

func TheLiquidityProviderFeeSharesForTheMarketShouldBe(engine Execution, marketID string, table *godog.Table) error

func TheLiquidityProvisionsShouldHaveTheFollowingStates

func TheLiquidityProvisionsShouldHaveTheFollowingStates(broker *stubs.BrokerStub, table *godog.Table) error

func TheLiquiditySLAPArams added in v0.73.0

func TheLiquiditySLAPArams(config *market.Config, name string, table *godog.Table) error

func TheLogNormalRiskModel

func TheLogNormalRiskModel(config *market.Config, name string, table *godog.Table) error

func TheMarginCalculator

func TheMarginCalculator(config *market.Config, name string, table *godog.Table) error

func TheMarkPriceForTheMarketIs

func TheMarkPriceForTheMarketIs(
	exec Execution,
	market, markPriceStr string,
) error

func TheMarketDataShouldBe

func TheMarketDataShouldBe(engine Execution, mID string, data *godog.Table) error

func TheMarketStateIsUpdatedTo added in v0.73.0

func TheMarketStateIsUpdatedTo(exec Execution, data *godog.Table) error

func TheMarketStateShouldBeForMarket

func TheMarketStateShouldBeForMarket(
	engine Execution,
	market, expectedMarketStateStr string,
) error

func TheMarkets

func TheMarkets(
	config *market.Config,
	executionEngine Execution,
	collateralEngine *collateral.Engine,
	netparams *netparams.Store,
	now time.Time,
	table *godog.Table,
) ([]types.Market, error)

func TheMarketsUpdated added in v0.57.0

func TheMarketsUpdated(
	config *market.Config,
	executionEngine Execution,
	existing []types.Market,
	netparams *netparams.Store,
	table *godog.Table,
) ([]types.Market, error)

func TheNetworkMovesAheadDurationWithBlocks

func TheNetworkMovesAheadDurationWithBlocks(exec Execution, block *helpers.Block, ts *stubs.TimeStub, delta, dur string) error

func TheNetworkMovesAheadNBlocks

func TheNetworkMovesAheadNBlocks(exec Execution, block *helpers.Block, time *stubs.TimeStub, n string, epochService EpochService) error

func TheNetworkMovesAheadNEpochs added in v0.73.0

func TheNetworkMovesAheadNEpochs(broker *stubs.BrokerStub, block *helpers.Block, exec Execution, epochService EpochService, ts *stubs.TimeStub, epochs string) error

func TheNetworkMovesAheadToTheNextEpoch added in v0.73.0

func TheNetworkMovesAheadToTheNextEpoch(broker *stubs.BrokerStub, block *helpers.Block, exec Execution, epochService EpochService, ts *stubs.TimeStub) error

func TheNetworkTreasuryBalanceShouldBeForTheAsset

func TheNetworkTreasuryBalanceShouldBeForTheAsset(
	broker *stubs.BrokerStub,
	rawAmount, asset string,
) error

func TheOpenInterestShouldBeForTheMarket

func TheOpenInterestShouldBeForTheMarket(engine Execution, marketID string, wantOpenInterest string) error

func TheOracleSpec

func TheOracleSpec(config *market.Config, name string, specType string, rawPubKeys string, table *godog.Table) error

func TheOrderBookOfMarketShouldHaveTheFollowingVolumes

func TheOrderBookOfMarketShouldHaveTheFollowingVolumes(broker *stubs.BrokerStub, marketID string, table *godog.Table) error

func TheOrdersShouldHaveTheFollowingStates

func TheOrdersShouldHaveTheFollowingStates(broker *stubs.BrokerStub, table *godog.Table) error

func TheOrdersShouldHaveTheFollowingStatus

func TheOrdersShouldHaveTheFollowingStatus(broker *stubs.BrokerStub, table *godog.Table) error

func ThePartiesShouldHaveTheFollowingMarginLevels

func ThePartiesShouldHaveTheFollowingMarginLevels(
	broker *stubs.BrokerStub,
	table *godog.Table,
) error

func ThePeggedOrdersShouldHaveTheFollowingStates

func ThePeggedOrdersShouldHaveTheFollowingStates(broker *stubs.BrokerStub, table *godog.Table) error

func ThePerpsOracleSpec added in v0.73.0

func ThePerpsOracleSpec(config *market.Config, keys string, table *godog.Table) error

func ThePriceMonitoring

func ThePriceMonitoring(config *market.Config, name string, table *godog.Table) error

func ThePriceMonitoringBoundsForTheMarketShouldBe

func ThePriceMonitoringBoundsForTheMarketShouldBe(engine Execution, marketID string, table *godog.Table) error

func TheReferralBenefitTiersConfiguration added in v0.73.0

func TheReferralBenefitTiersConfiguration(config *referralcfg.Config, name string, table *godog.Table) error

func TheReferralProgram added in v0.73.0

func TheReferralProgram(referralProgramConfig *referralcfg.Config, referralProgramEngine *referral.Engine, table *godog.Table) error

func TheReferralSetStatsShouldBe added in v0.73.0

func TheReferralSetStatsShouldBe(broker *stubs.BrokerStub, code, epochStr, volumeStr string, table *godog.Table) error

func TheReferralStakingTiersConfiguration added in v0.73.0

func TheReferralStakingTiersConfiguration(config *referralcfg.Config, name string, table *godog.Table) error

func TheSettlementAccountShouldHaveBalanceForMarket

func TheSettlementAccountShouldHaveBalanceForMarket(
	broker *stubs.BrokerStub,
	amountStr, market string,
) error

func TheSimpleRiskModel

func TheSimpleRiskModel(config *market.Config, name string, table *godog.Table) error

func TheSpotMarkets added in v0.73.0

func TheSpotMarkets(config *market.Config, executionEngine Execution, collateralEngine *collateral.Engine, netparams *netparams.Store, now time.Time, table *godog.Table) ([]types.Market, error)

func TheSpotMarketsUpdated added in v0.73.0

func TheSpotMarketsUpdated(
	config *market.Config,
	executionEngine Execution,
	existing []types.Market,
	netparams *netparams.Store,
	table *godog.Table,
) ([]types.Market, error)

func TheStopOrdersShouldHaveTheFollowingStates added in v0.72.0

func TheStopOrdersShouldHaveTheFollowingStates(broker *stubs.BrokerStub, table *godog.Table) error

func TheSuccesorMarketIsEnacted added in v0.72.0

func TheSuccesorMarketIsEnacted(sID string, markets []types.Market, exec Execution) error

func TheSuppliedStakeShouldBeForTheMarket

func TheSuppliedStakeShouldBeForTheMarket(engine Execution, marketID string, wantSuppliedStake string) error

func TheTargetStakeShouldBeForMarket

func TheTargetStakeShouldBeForMarket(engine Execution, marketID string, wantTargetStake string) error

func TheTeamHasTheFollowingMembers added in v0.73.0

func TheTeamHasTheFollowingMembers(teamsEngine *teams.Engine, team string, table *godog.Table) error

func TheTradingModeShouldBeForMarket

func TheTradingModeShouldBeForMarket(
	engine Execution,
	market, tradingModeStr string,
) error

func TheValidators

func TheValidators(
	topology *stubs.TopologyStub,
	stakingAcountStub *stubs.StakingAccountStub,
	delegtionEngine *delegation.Engine,
	table *godog.Table,
) error

func TheVestingStatsShouldBe added in v0.73.0

func TheVestingStatsShouldBe(broker *stubs.BrokerStub, epochStr string, table *godog.Table) error

func TheVolumeDiscountStatsShouldBe added in v0.73.0

func TheVolumeDiscountStatsShouldBe(broker *stubs.BrokerStub, epochStr string, table *godog.Table) error

func Time

func Time(rawTime string) (time.Time, error)

func TimeIsUpdatedTo

func TimeIsUpdatedTo(exec Execution, timeService *stubs.TimeStub, newTime string)

func TotalOfEventsShouldBeEmitted

func TotalOfEventsShouldBeEmitted(broker *stubs.BrokerStub, eventCounter int) error

func TradingMode

func TradingMode(name string) (types.MarketTradingMode, error)

func U64

func U64(value string) (uint64, error)

func U64Slice

func U64Slice(rawValue, sep string) ([]uint64, error)

func Uint

func Uint(value string) (*num.Uint, error)

func ValidatorsShouldHaveTheFollowingScores

func ValidatorsShouldHaveTheFollowingScores(
	broker *stubs.BrokerStub,
	table *godog.Table,
	epoch string,
) error

func VolumeDiscountProgram added in v0.73.0

func VolumeDiscountProgram(
	vde *volumediscount.Engine,
	tiers map[string][]*types.VolumeBenefitTier,
	table *godog.Table,
) error

func VolumeDiscountProgramTiers added in v0.73.0

func VolumeDiscountProgramTiers(
	tiers map[string][]*types.VolumeBenefitTier,
	volumeDiscountTierName string,
	table *godog.Table,
) error

Types

type CancelOrderError

type CancelOrderError struct {
	Err error
	// contains filtered or unexported fields
}

func (CancelOrderError) Error

func (c CancelOrderError) Error() string

func (*CancelOrderError) Unwrap

func (c *CancelOrderError) Unwrap() error

type EpochService

type EpochService interface {
	OnBlockEnd(ctx context.Context)
}

type ErrStack

type ErrStack []error

func (ErrStack) Error

func (e ErrStack) Error() string

Error so we print out the wrong matches line by line.

type ErroneousRow

type ErroneousRow interface {
	ExpectError() bool
	Error() string
	Reference() string
}

type Execution

type Execution interface {
	GetMarketData(mktID string) (types.MarketData, error)
	GetMarketState(mktID string) (types.MarketState, error)
	AmendOrder(ctx context.Context, amendment *types.OrderAmendment, party string) (*types.OrderConfirmation, error)
	CancelOrder(ctx context.Context, cancel *types.OrderCancellation, party string) ([]*types.OrderCancellationConfirmation, error)
	CancelStopOrder(ctx context.Context, cancel *types.StopOrdersCancellation, party string) error
	SubmitOrder(ctx context.Context, submission *types.OrderSubmission, party string) (*types.OrderConfirmation, error)
	SubmitStopOrder(ctx context.Context, submission *types.StopOrdersSubmission, party string) (*types.OrderConfirmation, error)
	SubmitLiquidityProvision(ctx context.Context, submission *types.LiquidityProvisionSubmission, party string, lpID string,
		deterministicID string) error
	AmendLiquidityProvision(ctx context.Context, amendment *types.LiquidityProvisionAmendment, party string) error
	CancelLiquidityProvision(ctx context.Context, cancel *types.LiquidityProvisionCancellation, party string) error
	SubmitSpotMarket(ctx context.Context, marketConfig *types.Market, proposer string, oos time.Time) error
	SubmitMarket(ctx context.Context, marketConfig *types.Market, proposer string, oos time.Time) error
	StartOpeningAuction(ctx context.Context, marketID string) error
	UpdateMarket(ctx context.Context, marketConfig *types.Market) error
	UpdateSpotMarket(ctx context.Context, marketConfig *types.Market) error
	BlockEnd(ctx context.Context)
	GetMarket(parentID string, settled bool) (types.Market, bool)
	SucceedMarket(ctx context.Context, successor, parent string) error

	// even though the batch processing is done above the execution engine, from the feature test point of view
	// it is part of the execution engine
	StartBatch(party string) error
	AddSubmitOrderToBatch(submission *types.OrderSubmission, party string) error
	ProcessBatch(ctx context.Context, party string) error
	OnEpochEvent(ctx context.Context, epoch types.Epoch)
	UpdateMarketState(ctx context.Context, changes *types.MarketStateUpdateConfiguration) error
}

the interface for execution engine. The execution engine itself will be wrapped so to use it in steps, we'll need to use an interface.

type LPEventWrapper

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

func (LPEventWrapper) CommitmentAmount

func (l LPEventWrapper) CommitmentAmount() *num.Uint

func (LPEventWrapper) Final

func (l LPEventWrapper) Final() bool

func (LPEventWrapper) ID

func (l LPEventWrapper) ID() string

func (LPEventWrapper) Party

func (l LPEventWrapper) Party() string

func (LPEventWrapper) Version

func (l LPEventWrapper) Version() uint64

type LPUpdate

type LPUpdate struct {
	MarketID         string
	CommitmentAmount *num.Uint
	Fee              num.Decimal
	Reference        string
	LpType           string
	Err              string
}

type MappedMD

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

type Only added in v0.71.0

type Only string
const (
	None   Only = ""
	Post   Only = "post"
	Reduce Only = "reduce"
)

type OrderAmendmentError

type OrderAmendmentError struct {
	OrderAmendment types.OrderAmendment
	OrderReference string
	Err            error
}

func (OrderAmendmentError) Error

func (o OrderAmendmentError) Error() string

type RowWrapper

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

func ParseTable

func ParseTable(dt *godog.Table) []RowWrapper

ParseTable parses the table without verifying its integrity. Prefer the use of StrictParseTable().

func StrictParseFirstRow

func StrictParseFirstRow(table *godog.Table, required, optional []string) RowWrapper

StrictParseFirstRow parses and verifies, table integrity and returns only the first row. This is suitable of table that act more as object than actual table.

func StrictParseTable

func StrictParseTable(dt *godog.Table, required, optional []string) []RowWrapper

StrictParseTable parses and verifies the table integrity.

func (RowWrapper) Bool

func (r RowWrapper) Bool(name string) bool

func (RowWrapper) Decimal

func (r RowWrapper) Decimal(name string) num.Decimal

func (RowWrapper) DecimalB added in v0.73.0

func (r RowWrapper) DecimalB(name string) (num.Decimal, bool)

func (RowWrapper) Duration

func (r RowWrapper) Duration(name string) time.Duration

func (RowWrapper) DurationSec

func (r RowWrapper) DurationSec(name string) time.Duration

func (RowWrapper) F64

func (r RowWrapper) F64(name string) float64

func (RowWrapper) F64Slice

func (r RowWrapper) F64Slice(name, sep string) []float64

func (RowWrapper) HasColumn

func (r RowWrapper) HasColumn(name string) bool

func (RowWrapper) I64

func (r RowWrapper) I64(name string) int64

func (RowWrapper) I64B

func (r RowWrapper) I64B(name string) (int64, bool)

I64B does the same as U64B, but returns a bool indicating whether or not the column was set.

func (RowWrapper) I64Slice

func (r RowWrapper) I64Slice(name, sep string) []int64

func (RowWrapper) MaybeUint

func (r RowWrapper) MaybeUint(name string) *num.Uint

func (RowWrapper) MustAccount

func (r RowWrapper) MustAccount(name string) types.AccountType

func (RowWrapper) MustAuctionTrigger

func (r RowWrapper) MustAuctionTrigger(name string) types.AuctionTrigger

func (RowWrapper) MustBool

func (r RowWrapper) MustBool(name string) bool

func (RowWrapper) MustDecimal

func (r RowWrapper) MustDecimal(name string) num.Decimal

func (RowWrapper) MustDuration

func (r RowWrapper) MustDuration(name string) time.Duration

func (RowWrapper) MustDurationSec

func (r RowWrapper) MustDurationSec(name string) time.Duration

func (RowWrapper) MustDurationSec2 added in v0.72.3

func (r RowWrapper) MustDurationSec2(name string) time.Duration

func (RowWrapper) MustDurationStr

func (r RowWrapper) MustDurationStr(name string) time.Duration

func (RowWrapper) MustEventType

func (r RowWrapper) MustEventType(name string) events.Type

func (RowWrapper) MustExpiryStrategy added in v0.72.0

func (r RowWrapper) MustExpiryStrategy(name string) types.StopOrderExpiryStrategy

func (RowWrapper) MustF64

func (r RowWrapper) MustF64(name string) float64

func (RowWrapper) MustF64Slice

func (r RowWrapper) MustF64Slice(name, sep string) []float64

func (RowWrapper) MustI64

func (r RowWrapper) MustI64(name string) int64

func (RowWrapper) MustI64Slice

func (r RowWrapper) MustI64Slice(name, sep string) []int64

func (RowWrapper) MustLiquidityStatus

func (r RowWrapper) MustLiquidityStatus(name string) types.LiquidityProvisionStatus

func (RowWrapper) MustMarketUpdateState added in v0.73.0

func (r RowWrapper) MustMarketUpdateState(name string) types.MarketStateUpdateType

func (RowWrapper) MustOracleSpecConditionOperator

func (r RowWrapper) MustOracleSpecConditionOperator(name string) datav1.Condition_Operator

func (RowWrapper) MustOracleSpecPropertyType

func (r RowWrapper) MustOracleSpecPropertyType(name string) datav1.PropertyKey_Type

func (RowWrapper) MustOrderStatus

func (r RowWrapper) MustOrderStatus(name string) types.OrderStatus

func (RowWrapper) MustOrderType

func (r RowWrapper) MustOrderType(name string) types.OrderType

func (RowWrapper) MustPeggedReference

func (r RowWrapper) MustPeggedReference(name string) types.PeggedReference

func (RowWrapper) MustPositionStatus added in v0.71.0

func (r RowWrapper) MustPositionStatus(name string) proto.PositionStatus

func (RowWrapper) MustSide

func (r RowWrapper) MustSide(name string) types.Side

func (RowWrapper) MustStopOrderStatus added in v0.72.0

func (r RowWrapper) MustStopOrderStatus(name string) types.StopOrderStatus

func (RowWrapper) MustStr

func (r RowWrapper) MustStr(name string) string

func (RowWrapper) MustStrSlice

func (r RowWrapper) MustStrSlice(name, sep string) []string

func (RowWrapper) MustTIF

func (r RowWrapper) MustTIF(name string) types.OrderTimeInForce

func (RowWrapper) MustTime

func (r RowWrapper) MustTime(name string) time.Time

func (RowWrapper) MustTradingMode

func (r RowWrapper) MustTradingMode(name string) types.MarketTradingMode

func (RowWrapper) MustU32

func (r RowWrapper) MustU32(name string) uint32

func (RowWrapper) MustU64

func (r RowWrapper) MustU64(name string) uint64

func (RowWrapper) MustU64Slice

func (r RowWrapper) MustU64Slice(name, sep string) []uint64

func (RowWrapper) MustUint

func (r RowWrapper) MustUint(name string) *num.Uint

func (RowWrapper) Str

func (r RowWrapper) Str(name string) string

func (RowWrapper) StrB

func (r RowWrapper) StrB(name string) (string, bool)

StrB does the same as Str, but returns a bool indicating whether or not the column was set.

func (RowWrapper) StrSlice

func (r RowWrapper) StrSlice(name, sep string) []string

func (RowWrapper) Time

func (r RowWrapper) Time(name string) time.Time

func (RowWrapper) U32

func (r RowWrapper) U32(name string) uint32

func (RowWrapper) U64

func (r RowWrapper) U64(name string) uint64

func (RowWrapper) U64B

func (r RowWrapper) U64B(name string) (uint64, bool)

U64B does the same as U64, but returns a bool indicating whether or not the column was set.

func (RowWrapper) U64Slice

func (r RowWrapper) U64Slice(name, sep string) []uint64

func (RowWrapper) Uint

func (r RowWrapper) Uint(name string) *num.Uint

type SubmitOrderError

type SubmitOrderError struct {
	Err error
	// contains filtered or unexported fields
}

func (SubmitOrderError) Error

func (s SubmitOrderError) Error() string

func (*SubmitOrderError) Unwrap

func (s *SubmitOrderError) Unwrap() error

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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