dex

package
v0.0.0-...-f42d900 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyExecTermSignal    = CtxKeyType("execution-termination-signals")
	CtxKeyExecutingContract = CtxKeyType("executing-contract")
)
View Source
const SynchronizationTimeoutInSeconds = 5

Variables

This section is empty.

Functions

func DeepDelete

func DeepDelete(kvStore sdk.KVStore, storePrefix []byte, matcher func([]byte) bool)

func GetAllDownstreamContracts

func GetAllDownstreamContracts(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error)) []string

BFS traversal over a acyclic graph Includes the root contract itself.

func GetExecutingContract

func GetExecutingContract(ctx sdk.Context) *types.ContractInfoV2

func GetTerminationSignals

func GetTerminationSignals(ctx sdk.Context) *datastructures.TypedSyncMap[string, chan struct{}]

Types

type BlockCancellations

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

func NewCancels

func NewCancels(cancelStore prefix.Store) *BlockCancellations

func (*BlockCancellations) Add

func (o *BlockCancellations) Add(newItem *types.Cancellation)

func (*BlockCancellations) Get

func (o *BlockCancellations) Get() (list []*types.Cancellation)

func (*BlockCancellations) GetIdsToCancel

func (o *BlockCancellations) GetIdsToCancel() (list []uint64)

func (*BlockCancellations) Has

func (o *BlockCancellations) Has(cancel *types.Cancellation) bool

type BlockOrders

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

func NewOrders

func NewOrders(orderStore prefix.Store) *BlockOrders

func (*BlockOrders) Add

func (o *BlockOrders) Add(newItem *types.Order)

func (*BlockOrders) Get

func (o *BlockOrders) Get() (list []*types.Order)

func (*BlockOrders) GetByID

func (o *BlockOrders) GetByID(id uint64) *types.Order

func (*BlockOrders) GetLimitOrders

func (o *BlockOrders) GetLimitOrders(direction types.PositionDirection) []*types.Order

func (*BlockOrders) GetSortedMarketOrders

func (o *BlockOrders) GetSortedMarketOrders(direction types.PositionDirection) []*types.Order

func (*BlockOrders) MarkFailedToPlace

func (o *BlockOrders) MarkFailedToPlace(failedOrders []types.UnsuccessfulOrder)

type CtxKeyType

type CtxKeyType string

type DepositInfo

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

func NewDepositInfo

func NewDepositInfo(store prefix.Store) *DepositInfo

func (*DepositInfo) Add

func (d *DepositInfo) Add(newItem *types.DepositInfoEntry)

func (*DepositInfo) Get

func (d *DepositInfo) Get() (list []*types.DepositInfoEntry)

type MemState

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

func NewMemState

func NewMemState(storeKey sdk.StoreKey) *MemState

func (*MemState) Clear

func (s *MemState) Clear(ctx sdk.Context)

func (*MemState) ClearCancellationForPair

func (s *MemState) ClearCancellationForPair(ctx sdk.Context, contractAddr types.ContractAddress, pair types.PairString)

func (*MemState) ClearContractToDependencies

func (s *MemState) ClearContractToDependencies()

func (*MemState) DeepCopy

func (s *MemState) DeepCopy() *MemState

func (*MemState) DeepFilterAccount

func (s *MemState) DeepFilterAccount(ctx sdk.Context, account string)

func (*MemState) GetAllBlockOrders

func (s *MemState) GetAllBlockOrders(ctx sdk.Context, contractAddr types.ContractAddress) (list []*types.Order)

func (*MemState) GetBlockCancels

func (s *MemState) GetBlockCancels(ctx sdk.Context, contractAddr types.ContractAddress, pair types.PairString) *BlockCancellations

func (*MemState) GetBlockOrders

func (s *MemState) GetBlockOrders(ctx sdk.Context, contractAddr types.ContractAddress, pair types.PairString) *BlockOrders

func (*MemState) GetContractToDependencies

func (s *MemState) GetContractToDependencies(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error)) []string

func (*MemState) GetContractToProcess

func (s *MemState) GetContractToProcess() *datastructures.SyncSet[string]

func (*MemState) GetDepositInfo

func (s *MemState) GetDepositInfo(ctx sdk.Context, contractAddr types.ContractAddress) *DepositInfo

func (*MemState) SetDownstreamsToProcess

func (s *MemState) SetDownstreamsToProcess(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error))

func (*MemState) SynchronizeAccess

func (s *MemState) SynchronizeAccess(ctx sdk.Context, contractAddr types.ContractAddress)

Jump to

Keyboard shortcuts

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