common

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIdle     = 3
	IdleTimeout = 240
)

Variables

This section is empty.

Functions

func GetDealsAndMatchResult

func GetDealsAndMatchResult(ctx sdk.Context, orderKeeper types.OrderKeeper) ([]*backend.Deal, []*backend.MatchResult, error)

func GetMatchResults

func GetMatchResults(ctx sdk.Context, orderKeeper types.OrderKeeper) []*backend.MatchResult

func GetNewOrders

func GetNewOrders(ctx sdk.Context, orderKeeper types.OrderKeeper) []*backend.Order

func NewPool

func NewPool(redisURL string, redisPass string, logger log.Logger) (*redis.Pool, error)

func ParseRedisURL

func ParseRedisURL(redisURL, requirePass string) (string, string, error)

Use redis URI scheme. URLs should follow the draft IANA specification for the scheme (https://www.iana.org/assignments/uri-schemes/prov/redis). eg. redis://user:password@localhost:6379, redis://localhost:16379 return: address, password, error

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) AddClaimInfo

func (c *Cache) AddClaimInfo(claimInfo *backend.ClaimInfo)

AddClaimInfo appends claimInfo to cache ClaimInfos

func (*Cache) AddNewSwapTokenPair

func (c *Cache) AddNewSwapTokenPair(swapTokenPair *ammswap.SwapTokenPair)

AddNewSwapTokenPairs appends swapTokenPair to cache newSwapTokenPairs

func (*Cache) AddNewTokenPair

func (c *Cache) AddNewTokenPair(tokenPair *types.TokenPair)

AddNewTokenPair adds a new token pair into cache

func (*Cache) AddSwapInfo

func (c *Cache) AddSwapInfo(swapInfo *backend.SwapInfo)

AddSwapInfo appends swapInfo to cache SwapInfos

func (*Cache) AddTransaction

func (c *Cache) AddTransaction(transaction *backend.Transaction)

func (*Cache) AddUpdatedAccount

func (c *Cache) AddUpdatedAccount(acc auth.Account)

func (*Cache) GetClaimInfos

func (c *Cache) GetClaimInfos() []*backend.ClaimInfo

nolint

func (*Cache) GetNewSwapTokenPairs

func (c *Cache) GetNewSwapTokenPairs() []*ammswap.SwapTokenPair

nolint

func (*Cache) GetNewTokenPairs

func (c *Cache) GetNewTokenPairs() []*types.TokenPair

GetNewTokenPairs returns new token pairs from cache

func (*Cache) GetSwapInfos

func (c *Cache) GetSwapInfos() []*backend.SwapInfo

nolint

func (*Cache) GetTokenPairChanged

func (c *Cache) GetTokenPairChanged() bool

GetTokenPairChanged gets tokenPairChanged

func (*Cache) GetTransactions

func (c *Cache) GetTransactions() []*backend.Transaction

func (*Cache) GetUpdatedAccAddress

func (c *Cache) GetUpdatedAccAddress() (accs []sdk.AccAddress)

func (*Cache) Reset

func (c *Cache) Reset()

Reset temporary cache, called at BeginBlock

func (*Cache) SetTokenPairChanged

func (c *Cache) SetTokenPairChanged(changed bool)

SetTokenPairChanged sets tokenPairChanged

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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