stubs

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIsAssetStub

func NewIsAssetStub(id string, dp uint64) *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)

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) 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) ClearTransferResponseEvents

func (b *BrokerStub) ClearTransferResponseEvents()

func (*BrokerStub) GetAccountEvents

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

func (*BrokerStub) GetAccounts

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

func (*BrokerStub) GetActiveOrderDepth

func (b *BrokerStub) GetActiveOrderDepth(marketID string) (sell []*types.Order, buy []*types.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) GetAssetNetworkTreasuryAccount

func (b *BrokerStub) GetAssetNetworkTreasuryAccount(asset string) (types.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) (types.Order, error)

func (*BrokerStub) GetDelegationBalance

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

func (*BrokerStub) GetDelegationBalanceEvents

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

func (*BrokerStub) GetDeposits added in v0.68.0

func (b *BrokerStub) GetDeposits() []types.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) (types.Order, error)

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) GetLastMarketUpdateState added in v0.72.0

func (b *BrokerStub) GetLastMarketUpdateState(marketID string) *types.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) GetLossSocializationEvents added in v0.71.0

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

func (*BrokerStub) GetMarginByPartyAndMarket

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

func (*BrokerStub) GetMarket

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

func (*BrokerStub) GetMarketInfrastructureFeePoolAccount

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

func (*BrokerStub) GetMarketInsurancePoolAccount

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

func (*BrokerStub) GetMarketLiquidityFeePoolAccount

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

func (*BrokerStub) GetMarketSettlementAccount

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

func (*BrokerStub) GetOrderEvents

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

func (*BrokerStub) GetOrdersByPartyAndMarket

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

func (*BrokerStub) GetPartyBondAccount

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

func (*BrokerStub) GetPartyBondAccountForMarket

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

func (*BrokerStub) GetPartyGeneralAccount

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

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

func (*BrokerStub) GetPartyMarginAccount

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

func (*BrokerStub) GetRejectedOrderAmendments

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

func (*BrokerStub) GetRewardAccountBalance

func (b *BrokerStub) GetRewardAccountBalance(accountType, asset string) (ga types.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) 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() []types.Trade

func (*BrokerStub) GetTransfers added in v0.68.0

func (b *BrokerStub) GetTransfers(mutable bool) []*types.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() []types.Withdrawal

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) 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)

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 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) 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) GetTimeNow

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

func (*TimeStub) NotifyOnTick

func (t *TimeStub) NotifyOnTick(scbs ...func(context.Context, 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 (*TopologyStub) RecalcValidatorSet(ctx context.Context, epochSeq string, delegationState []*types.ValidatorData, stakeScoreParams types.StakeScoreParams)

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

Jump to

Keyboard shortcuts

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