stubs

package
v0.78.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountDoesNotExistErr = errors.New("account does not exist")

Functions

func NewIsAssetStub

func NewIsAssetStub(id string, dp uint64, quantum *num.Decimal) *assets.Asset

Types

type AssetParty

type AssetParty struct {
	Asset, Party string
}

type AssetStub

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

func NewAssetStub

func NewAssetStub() *AssetStub

func (*AssetStub) ApplyAssetUpdate

func (a *AssetStub) ApplyAssetUpdate(_ context.Context, assetID string) error

func (AssetStub) Enable

func (AssetStub) Enable(_ context.Context, assetID string) error

func (*AssetStub) Get

func (a *AssetStub) Get(id string) (*assets.Asset, error)

func (*AssetStub) Register

func (a *AssetStub) Register(id string, decimals uint64, quantum *num.Decimal)

func (*AssetStub) SetPermissive

func (a *AssetStub) SetPermissive()

func (*AssetStub) SetStrict

func (a *AssetStub) SetStrict()

type BridgeViewStub

type BridgeViewStub struct{}

func NewBridgeViewStub

func NewBridgeViewStub() *BridgeViewStub

func (*BridgeViewStub) CollateralBridgeAddress added in v0.77.0

func (*BridgeViewStub) CollateralBridgeAddress() string

func (*BridgeViewStub) FindAssetLimitsUpdated

func (*BridgeViewStub) FindAssetLimitsUpdated(w *types.ERC20AssetLimitsUpdated, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error

func (*BridgeViewStub) FindAssetList

func (*BridgeViewStub) FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64, txHash string) error

func (*BridgeViewStub) FindBridgeResumed

func (*BridgeViewStub) FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64, txHash string) error

func (*BridgeViewStub) FindBridgeStopped

func (*BridgeViewStub) FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64, txHash string) error

func (*BridgeViewStub) FindDeposit

func (*BridgeViewStub) FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error

type BrokerStub

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

func NewBrokerStub

func NewBrokerStub() *BrokerStub

func (*BrokerStub) ClearAllEvents

func (b *BrokerStub) ClearAllEvents()

func (*BrokerStub) ClearOrderByReference

func (b *BrokerStub) ClearOrderByReference(party, ref string) error

func (*BrokerStub) ClearTradeEvents added in v0.74.0

func (b *BrokerStub) ClearTradeEvents()

func (*BrokerStub) ClearTransferResponseEvents

func (b *BrokerStub) ClearTransferResponseEvents()

func (*BrokerStub) GetAMMPoolEventMap added in v0.77.0

func (b *BrokerStub) GetAMMPoolEventMap() map[string]map[string][]*events.AMMPool

func (*BrokerStub) GetAMMPoolEvents added in v0.77.0

func (b *BrokerStub) GetAMMPoolEvents() []*events.AMMPool

func (*BrokerStub) GetAMMPoolEventsByMarket added in v0.77.0

func (b *BrokerStub) GetAMMPoolEventsByMarket(id string) []*events.AMMPool

func (*BrokerStub) GetAMMPoolEventsByParty added in v0.77.0

func (b *BrokerStub) GetAMMPoolEventsByParty(party string) []*events.AMMPool

func (*BrokerStub) GetAMMPoolEventsByPartyAndMarket added in v0.77.0

func (b *BrokerStub) GetAMMPoolEventsByPartyAndMarket(party, mID string) []*events.AMMPool

func (*BrokerStub) GetAccountEvents

func (b *BrokerStub) GetAccountEvents() []events.Acc

func (*BrokerStub) GetAccounts

func (b *BrokerStub) GetAccounts() []vegapb.Account

func (*BrokerStub) GetActiveOrderDepth

func (b *BrokerStub) GetActiveOrderDepth(marketID string) (sell []*vegapb.Order, buy []*vegapb.Order)

func (*BrokerStub) GetAllEvents

func (b *BrokerStub) GetAllEvents() []events.Event

func (*BrokerStub) GetAllEventsSinceCleared added in v0.68.0

func (b *BrokerStub) GetAllEventsSinceCleared() []events.Event

func (*BrokerStub) GetAssetGlobalInsuranceAccount added in v0.73.0

func (b *BrokerStub) GetAssetGlobalInsuranceAccount(asset string) (vegapb.Account, error)

func (*BrokerStub) GetAssetNetworkTreasuryAccount

func (b *BrokerStub) GetAssetNetworkTreasuryAccount(asset string) (vegapb.Account, error)

func (*BrokerStub) GetAuctionEvents

func (b *BrokerStub) GetAuctionEvents() []events.Auction

func (*BrokerStub) GetBatch

func (b *BrokerStub) GetBatch(t events.Type) []events.Event

func (*BrokerStub) GetBookDepth

func (b *BrokerStub) GetBookDepth(market string) (sell map[string]uint64, buy map[string]uint64)

func (*BrokerStub) GetByReference

func (b *BrokerStub) GetByReference(party, ref string) (vegapb.Order, error)

func (*BrokerStub) GetCancelledOrderEvents added in v0.76.0

func (b *BrokerStub) GetCancelledOrderEvents() []events.CancelledOrders

func (*BrokerStub) GetCancelledOrdersPerMarket added in v0.76.0

func (b *BrokerStub) GetCancelledOrdersPerMarket() map[string]map[string]struct{}

func (*BrokerStub) GetCurrentEpoch added in v0.73.0

func (b *BrokerStub) GetCurrentEpoch() *events.EpochEvent

func (*BrokerStub) GetDelegationBalance

func (b *BrokerStub) GetDelegationBalance(epochSeq string) []vegapb.Delegation

func (*BrokerStub) GetDelegationBalanceEvents

func (b *BrokerStub) GetDelegationBalanceEvents(epochSeq string) []events.DelegationBalance

func (*BrokerStub) GetDeposits added in v0.68.0

func (b *BrokerStub) GetDeposits() []vegapb.Deposit

func (*BrokerStub) GetDistressedOrders added in v0.71.0

func (b *BrokerStub) GetDistressedOrders() []events.DistressedOrders

func (*BrokerStub) GetFirstByReference

func (b *BrokerStub) GetFirstByReference(party, ref string) (vegapb.Order, error)

func (*BrokerStub) GetFundingPeriodEvents added in v0.75.0

func (b *BrokerStub) GetFundingPeriodEvents() []events.FundingPeriod

func (*BrokerStub) GetImmBatch

func (b *BrokerStub) GetImmBatch(t events.Type) []events.Event

func (*BrokerStub) GetLPEvents

func (b *BrokerStub) GetLPEvents() []events.LiquidityProvision

func (*BrokerStub) GetLPSErrors

func (b *BrokerStub) GetLPSErrors() []events.TxErr

func (*BrokerStub) GetLastAMMPoolEvents added in v0.77.0

func (b *BrokerStub) GetLastAMMPoolEvents() map[string]map[string]*events.AMMPool

func (*BrokerStub) GetLastMarketUpdateState added in v0.72.0

func (b *BrokerStub) GetLastMarketUpdateState(marketID string) *vegapb.Market

func (*BrokerStub) GetLedgerMovements added in v0.56.0

func (b *BrokerStub) GetLedgerMovements(mutable bool) []events.LedgerMovements

GetLedgerMovements returns ledger movements, `mutable` argument specifies if these should be all the scenario events or events that can be cleared by the user.

func (*BrokerStub) GetLossSoc added in v0.73.14

func (b *BrokerStub) GetLossSoc() []*events.LossSoc

func (*BrokerStub) GetLossSocializationEvents added in v0.71.0

func (b *BrokerStub) GetLossSocializationEvents() []events.LossSocialization

func (*BrokerStub) GetMarginByPartyAndMarket

func (b *BrokerStub) GetMarginByPartyAndMarket(partyID, marketID string) (vegapb.MarginLevels, error)

func (*BrokerStub) GetMarkPriceSettings added in v0.74.0

func (b *BrokerStub) GetMarkPriceSettings(marketID string) *vegapb.CompositePriceConfiguration

func (*BrokerStub) GetMarket

func (b *BrokerStub) GetMarket(marketID string) *vegapb.Market

func (*BrokerStub) GetMarketInfrastructureFeePoolAccount

func (b *BrokerStub) GetMarketInfrastructureFeePoolAccount(asset string) (vegapb.Account, error)

func (*BrokerStub) GetMarketInsurancePoolAccount

func (b *BrokerStub) GetMarketInsurancePoolAccount(market string) (vegapb.Account, error)

func (*BrokerStub) GetMarketLPLiquidityBondAccount added in v0.73.0

func (b *BrokerStub) GetMarketLPLiquidityBondAccount(party, market string) (vegapb.Account, error)

func (*BrokerStub) GetMarketLPLiquidityFeePoolAccount added in v0.73.0

func (b *BrokerStub) GetMarketLPLiquidityFeePoolAccount(party, market string) (vegapb.Account, error)

func (*BrokerStub) GetMarketLiquidityFeePoolAccount

func (b *BrokerStub) GetMarketLiquidityFeePoolAccount(market string) (vegapb.Account, error)

func (*BrokerStub) GetMarketSettlementAccount

func (b *BrokerStub) GetMarketSettlementAccount(market string) (vegapb.Account, error)

func (*BrokerStub) GetOrderEvents

func (b *BrokerStub) GetOrderEvents() []events.Order

func (*BrokerStub) GetOrdersByPartyAndMarket

func (b *BrokerStub) GetOrdersByPartyAndMarket(party, market string) []vegapb.Order

func (*BrokerStub) GetPartyBondAccount

func (b *BrokerStub) GetPartyBondAccount(party, asset string) (ba vegapb.Account, err error)

func (*BrokerStub) GetPartyBondAccountForMarket

func (b *BrokerStub) GetPartyBondAccountForMarket(party, asset, marketID string) (ba vegapb.Account, err error)

func (*BrokerStub) GetPartyGeneralAccount

func (b *BrokerStub) GetPartyGeneralAccount(party, asset string) (ga vegapb.Account, err error)

GetPartyGeneralAccount returns the latest event WRT the party's general account.

func (*BrokerStub) GetPartyHoldingAccount added in v0.73.0

func (b *BrokerStub) GetPartyHoldingAccount(party, asset string) (ga vegapb.Account, err error)

GetPartyGeneralAccount returns the latest event WRT the party's general account.

func (*BrokerStub) GetPartyMarginAccount

func (b *BrokerStub) GetPartyMarginAccount(party, market string) (vegapb.Account, error)

func (*BrokerStub) GetPartyOrderMarginAccount added in v0.74.0

func (b *BrokerStub) GetPartyOrderMarginAccount(party, market string) (vegapb.Account, error)

func (*BrokerStub) GetPartyVestedAccount added in v0.73.0

func (b *BrokerStub) GetPartyVestedAccount(party, asset string) (ga vegapb.Account, err error)

GetPartyVestingAccount returns the latest event WRT the party's general account.

func (*BrokerStub) GetPartyVestedAccountForMarket added in v0.73.0

func (b *BrokerStub) GetPartyVestedAccountForMarket(party, asset, marketID string) (vegapb.Account, error)

func (*BrokerStub) GetPartyVestingAccount added in v0.73.0

func (b *BrokerStub) GetPartyVestingAccount(party, asset string) (ga vegapb.Account, err error)

GetPartyVestingAccount returns the latest event WRT the party's general account.

func (*BrokerStub) GetPartyVestingAccountForMarket added in v0.73.0

func (b *BrokerStub) GetPartyVestingAccountForMarket(party, asset, marketID string) (vegapb.Account, error)

func (*BrokerStub) GetRejectedOrderAmendments

func (b *BrokerStub) GetRejectedOrderAmendments() []events.TxErr

func (*BrokerStub) GetRewardAccountBalance

func (b *BrokerStub) GetRewardAccountBalance(accountType, asset string) (ga vegapb.Account, err error)

GetRewardAccountBalance returns the latest event WRT the reward accounts with the given type for the asset.

func (*BrokerStub) GetRewards

func (b *BrokerStub) GetRewards(epochSeq string) map[AssetParty]events.RewardPayout

func (*BrokerStub) GetSettleDistressed added in v0.71.0

func (b *BrokerStub) GetSettleDistressed() []events.SettleDistressed

func (*BrokerStub) GetStakingRewardAccount added in v0.73.0

func (b *BrokerStub) GetStakingRewardAccount(asset string) (vegapb.Account, error)

func (*BrokerStub) GetStopByReference added in v0.72.0

func (b *BrokerStub) GetStopByReference(party, ref string) (eventspb.StopOrderEvent, error)

func (*BrokerStub) GetStopOrderEvents added in v0.72.0

func (b *BrokerStub) GetStopOrderEvents() []events.StopOrder

func (*BrokerStub) GetTradeEvents

func (b *BrokerStub) GetTradeEvents() []events.Trade

func (*BrokerStub) GetTrades

func (b *BrokerStub) GetTrades() []vegapb.Trade

func (*BrokerStub) GetTransfers added in v0.68.0

func (b *BrokerStub) GetTransfers(mutable bool) []*vegapb.LedgerEntry

GetTransfers returns ledger entries, mutable argument specifies if these should be all the scenario events or events that can be cleared by the user.

func (*BrokerStub) GetTxErrors

func (b *BrokerStub) GetTxErrors() []events.TxErr

func (*BrokerStub) GetValidatorScores

func (b *BrokerStub) GetValidatorScores(epochSeq string) map[string]events.ValidatorScore

func (*BrokerStub) GetWithdrawals added in v0.68.0

func (b *BrokerStub) GetWithdrawals() []vegapb.Withdrawal

func (*BrokerStub) IsCancelledOrder added in v0.76.0

func (b *BrokerStub) IsCancelledOrder(mkt, party, id string) bool

func (*BrokerStub) PartyActivityStreaks added in v0.73.0

func (b *BrokerStub) PartyActivityStreaks() []eventspb.PartyActivityStreak

func (*BrokerStub) ReferralSetStats added in v0.73.0

func (b *BrokerStub) ReferralSetStats() []*types.ReferralSetStats

func (*BrokerStub) Reset

func (b *BrokerStub) Reset()

func (*BrokerStub) ResetType

func (b *BrokerStub) ResetType(t events.Type)

func (*BrokerStub) Send

func (b *BrokerStub) Send(e events.Event)

func (*BrokerStub) SendBatch

func (b *BrokerStub) SendBatch(evts []events.Event)

func (*BrokerStub) SetStreaming

func (b *BrokerStub) SetStreaming(v bool) bool

func (*BrokerStub) Stage added in v0.74.2

func (b *BrokerStub) Stage(e events.Event)

func (*BrokerStub) Subscribe

func (b *BrokerStub) Subscribe(sub broker.Subscriber) int

func (*BrokerStub) SubscribeBatch

func (b *BrokerStub) SubscribeBatch(subs ...broker.Subscriber)

func (*BrokerStub) Unsubscribe

func (b *BrokerStub) Unsubscribe(k int)

func (*BrokerStub) VestingStats added in v0.73.0

func (b *BrokerStub) VestingStats() []eventspb.VestingStatsUpdated

func (*BrokerStub) VolumeDiscountStats added in v0.73.0

func (b *BrokerStub) VolumeDiscountStats() []eventspb.VolumeDiscountStatsUpdated

type CommanderStub

type CommanderStub struct{}

func NewCommanderStub

func NewCommanderStub() *CommanderStub

func (*CommanderStub) Command

func (*CommanderStub) Command(ctx context.Context, cmd txn.Command, payload proto.Message, f func(string, error), bo *backoff.ExponentialBackOff)

func (*CommanderStub) CommandSync

func (*CommanderStub) CommandSync(ctx context.Context, cmd txn.Command, payload proto.Message, f func(string, error), bo *backoff.ExponentialBackOff)

type ReferralDiscountRewardService added in v0.73.0

type ReferralDiscountRewardService struct{}

func (*ReferralDiscountRewardService) GetReferrer added in v0.73.0

func (*ReferralDiscountRewardService) GetReferrer(referee types.PartyID) (types.PartyID, error)

func (*ReferralDiscountRewardService) ReferralDiscountFactorsForParty added in v0.77.8

func (*ReferralDiscountRewardService) ReferralDiscountFactorsForParty(party types.PartyID) num.Decimal

func (*ReferralDiscountRewardService) RewardsFactorsMultiplierAppliedForParty added in v0.77.8

func (*ReferralDiscountRewardService) RewardsFactorsMultiplierAppliedForParty(party types.PartyID) num.Decimal

type StakingAccountStub

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

func NewStakingAccountStub

func NewStakingAccountStub() *StakingAccountStub

func (*StakingAccountStub) DecrementBalance

func (t *StakingAccountStub) DecrementBalance(party string, amount *num.Uint) error

func (*StakingAccountStub) GetAllStakingParties added in v0.78.0

func (t *StakingAccountStub) GetAllStakingParties() []string

func (*StakingAccountStub) GetAvailableBalance

func (t *StakingAccountStub) GetAvailableBalance(party string) (*num.Uint, error)

func (*StakingAccountStub) GetAvailableBalanceInRange

func (t *StakingAccountStub) GetAvailableBalanceInRange(party string, from, _ time.Time) (*num.Uint, error)

func (*StakingAccountStub) IncrementBalance

func (t *StakingAccountStub) IncrementBalance(party string, amount *num.Uint) error

func (*StakingAccountStub) OnEpochEvent

func (t *StakingAccountStub) OnEpochEvent(ctx context.Context, epoch types.Epoch)

func (*StakingAccountStub) OnEpochRestore

func (t *StakingAccountStub) OnEpochRestore(_ context.Context, _ types.Epoch)

type StateVarStub

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

func NewStateVar

func NewStateVar() *StateVarStub

func (*StateVarStub) NewEvent

func (e *StateVarStub) NewEvent(asset, market string, eventType statevar.EventType)

func (*StateVarStub) OnFloatingPointUpdatesDurationUpdate

func (e *StateVarStub) OnFloatingPointUpdatesDurationUpdate(ctx context.Context, updateFrequency time.Duration) error

func (*StateVarStub) OnTick

func (e *StateVarStub) OnTick(ctx context.Context, t time.Time)

func (*StateVarStub) ReadyForTimeTrigger

func (e *StateVarStub) ReadyForTimeTrigger(asset, mktID string)

func (*StateVarStub) RegisterStateVariable

func (e *StateVarStub) RegisterStateVariable(asset, market, name string, converter statevar.Converter, startCalculation func(string, statevar.FinaliseCalculation), trigger []statevar.EventType, result func(context.Context, statevar.StateVariableResult) error) error

func (*StateVarStub) UnregisterStateVariable

func (e *StateVarStub) UnregisterStateVariable(asset, market string)

type TimeStub

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

func NewTimeStub

func NewTimeStub() *TimeStub

func (*TimeStub) GetTimeLastBatch added in v0.77.0

func (t *TimeStub) GetTimeLastBatch() time.Time

func (*TimeStub) GetTimeNow

func (t *TimeStub) GetTimeNow() time.Time

func (*TimeStub) NotifyOnTick

func (t *TimeStub) NotifyOnTick(scbs ...func(context.Context, time.Time))

func (*TimeStub) SetPrevTime added in v0.77.0

func (t *TimeStub) SetPrevTime(newNow time.Time)

func (*TimeStub) SetTime

func (t *TimeStub) SetTime(newNow time.Time)

func (*TimeStub) SetTimeNow

func (t *TimeStub) SetTimeNow(_ context.Context, newNow time.Time)

type TopologyStub

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

func NewTopologyStub

func NewTopologyStub(nodeID string, broker *BrokerStub) *TopologyStub

func (*TopologyStub) AddValidator

func (ts *TopologyStub) AddValidator(node string, pubkey string)

func (*TopologyStub) AllNodeIDs

func (ts *TopologyStub) AllNodeIDs() []string

func (*TopologyStub) AllVegaPubKeys

func (ts *TopologyStub) AllVegaPubKeys() []string

func (*TopologyStub) Get

func (*TopologyStub) GetRewardsScores

func (ts *TopologyStub) GetRewardsScores(ctx context.Context, epochSeq string, delegationState []*types.ValidatorData, stakeScoreParams types.StakeScoreParams) (*types.ScoreData, *types.ScoreData)

func (*TopologyStub) GetTotalVotingPower added in v0.64.0

func (*TopologyStub) GetTotalVotingPower() int64

func (*TopologyStub) GetVotingPower added in v0.64.0

func (*TopologyStub) GetVotingPower(pubkey string) int64

func (*TopologyStub) IsTendermintValidator

func (ts *TopologyStub) IsTendermintValidator(pubKey string) bool

func (*TopologyStub) IsValidator

func (ts *TopologyStub) IsValidator() bool

func (*TopologyStub) IsValidatorNodeID

func (ts *TopologyStub) IsValidatorNodeID(nodeID string) bool

func (*TopologyStub) IsValidatorVegaPubKey

func (ts *TopologyStub) IsValidatorVegaPubKey(pubKey string) bool

func (*TopologyStub) Len

func (ts *TopologyStub) Len() int

func (*TopologyStub) OnMinDelegationUpdated

func (ts *TopologyStub) OnMinDelegationUpdated(_ context.Context, minDelegation num.Decimal) error

func (*TopologyStub) RecalcValidatorSet

func (ts *TopologyStub) RecalcValidatorSet(ctx context.Context, epochSeq string, delegationState []*types.ValidatorData, stakeScoreParams types.StakeScoreParams) []*types.PartyContributionScore

func (*TopologyStub) SelfNodeID

func (ts *TopologyStub) SelfNodeID() string

func (*TopologyStub) SelfVegaPubKey

func (ts *TopologyStub) SelfVegaPubKey() string

func (*TopologyStub) ValidatorPerformanceScore

func (ts *TopologyStub) ValidatorPerformanceScore(nodeID string) num.Decimal

type VolumeDiscountService added in v0.73.0

type VolumeDiscountService struct{}

func (*VolumeDiscountService) VolumeDiscountFactorForParty added in v0.73.0

func (*VolumeDiscountService) VolumeDiscountFactorForParty(party types.PartyID) num.Decimal

Jump to

Keyboard shortcuts

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