Documentation ¶
Index ¶
- Variables
- type MockRoutablePool
- func WithChainPoolModel(mockPool *MockRoutablePool, chainPool poolmanagertypes.PoolI) *MockRoutablePool
- func WithDenoms(mockPool *MockRoutablePool, denoms []string) *MockRoutablePool
- func WithPoolID(mockPool *MockRoutablePool, id uint64) *MockRoutablePool
- func WithTakerFee(mockPool *MockRoutablePool, takerFee osmomath.Dec) *MockRoutablePool
- func WithTokenOutDenom(mockPool *MockRoutablePool, tokenOutDenom string) *MockRoutablePool
- func (mp *MockRoutablePool) CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error)
- func (*MockRoutablePool) ChargeTakerFeeExactIn(tokenIn sdk.Coin) (tokenInAfterFee sdk.Coin)
- func (mp *MockRoutablePool) GetId() uint64
- func (mp *MockRoutablePool) GetPoolDenoms() []string
- func (mp *MockRoutablePool) GetSQSPoolModel() domain.SQSPool
- func (mp *MockRoutablePool) GetSpreadFactor() math.LegacyDec
- func (mp *MockRoutablePool) GetTakerFee() math.LegacyDec
- func (mp *MockRoutablePool) GetTickModel() (*domain.TickModel, error)
- func (mp *MockRoutablePool) GetTokenOutDenom() string
- func (mp *MockRoutablePool) GetTotalValueLockedUOSMO() math.Int
- func (mp *MockRoutablePool) GetType() poolmanagertypes.PoolType
- func (mp *MockRoutablePool) GetUnderlyingPool() poolmanagertypes.PoolI
- func (mp *MockRoutablePool) SetTickModel(tickModel *domain.TickModel) error
- func (*MockRoutablePool) SetTokenOutDenom(tokenOutDenom string)
- func (*MockRoutablePool) String() string
- func (*MockRoutablePool) Validate(minUOSMOTVL math.Int) error
- type PoolsUsecaseMock
- func (pm *PoolsUsecaseMock) GetAllPools(ctx context.Context) ([]domain.PoolI, error)
- func (pm *PoolsUsecaseMock) GetRoutesFromCandidates(ctx context.Context, candidateRoutes route.CandidateRoutes, ...) ([]route.RouteImpl, error)
- func (pm *PoolsUsecaseMock) GetTickModelMap(ctx context.Context, poolIDs []uint64) (map[uint64]domain.TickModel, error)
- type RedisPoolsRepositoryMock
- func (*RedisPoolsRepositoryMock) ClearAllPools(ctx context.Context, tx mvc.Tx) error
- func (r *RedisPoolsRepositoryMock) GetAllPools(context.Context) ([]domain.PoolI, error)
- func (r *RedisPoolsRepositoryMock) GetPools(ctx context.Context, poolIDs map[uint64]struct{}) (map[uint64]domain.PoolI, error)
- func (r *RedisPoolsRepositoryMock) GetTickModelForPools(ctx context.Context, pools []uint64) (map[uint64]domain.TickModel, error)
- func (r *RedisPoolsRepositoryMock) StorePools(ctx context.Context, tx mvc.Tx, allPools []domain.PoolI) error
- type RedisRouterRepositoryMock
- func (r *RedisRouterRepositoryMock) GetAllTakerFees(ctx context.Context) (domain.TakerFeeMap, error)
- func (r *RedisRouterRepositoryMock) GetRoutes(ctx context.Context, denom0 string, denom1 string) (route.CandidateRoutes, error)
- func (r *RedisRouterRepositoryMock) GetTakerFee(ctx context.Context, denom0 string, denom1 string) (math.LegacyDec, error)
- func (r *RedisRouterRepositoryMock) SetRoutes(ctx context.Context, denom0 string, denom1 string, ...) error
- func (r *RedisRouterRepositoryMock) SetRoutesTx(ctx context.Context, tx mvc.Tx, denom0 string, denom1 string, ...) error
- func (r *RedisRouterRepositoryMock) SetTakerFee(ctx context.Context, tx mvc.Tx, denom0 string, denom1 string, ...) error
- type TokensUseCaseMock
Constants ¶
This section is empty.
Variables ¶
var DefaultSpreadFactor = osmomath.MustNewDecFromStr("0.005")
Functions ¶
This section is empty.
Types ¶
type MockRoutablePool ¶
type MockRoutablePool struct { ChainPoolModel poolmanagertypes.PoolI TickModel *domain.TickModel ID uint64 Balances sdk.Coins Denoms []string TotalValueLockedUSDC osmomath.Int PoolType poolmanagertypes.PoolType TokenOutDenom string TakerFee osmomath.Dec SpreadFactor osmomath.Dec }
func WithChainPoolModel ¶
func WithChainPoolModel(mockPool *MockRoutablePool, chainPool poolmanagertypes.PoolI) *MockRoutablePool
func WithDenoms ¶
func WithDenoms(mockPool *MockRoutablePool, denoms []string) *MockRoutablePool
func WithPoolID ¶
func WithPoolID(mockPool *MockRoutablePool, id uint64) *MockRoutablePool
func WithTakerFee ¶
func WithTakerFee(mockPool *MockRoutablePool, takerFee osmomath.Dec) *MockRoutablePool
func WithTokenOutDenom ¶
func WithTokenOutDenom(mockPool *MockRoutablePool, tokenOutDenom string) *MockRoutablePool
func (*MockRoutablePool) CalculateTokenOutByTokenIn ¶
CalculateTokenOutByTokenIn implements routerusecase.RoutablePool.
func (*MockRoutablePool) ChargeTakerFeeExactIn ¶
func (*MockRoutablePool) ChargeTakerFeeExactIn(tokenIn sdk.Coin) (tokenInAfterFee sdk.Coin)
ChargeTakerFee implements domain.RoutablePool.
func (*MockRoutablePool) GetId ¶
func (mp *MockRoutablePool) GetId() uint64
GetId implements domain.PoolI.
func (*MockRoutablePool) GetPoolDenoms ¶
func (mp *MockRoutablePool) GetPoolDenoms() []string
GetPoolDenoms implements domain.PoolI.
func (*MockRoutablePool) GetSQSPoolModel ¶
func (mp *MockRoutablePool) GetSQSPoolModel() domain.SQSPool
GetSQSPoolModel implements domain.PoolI.
func (*MockRoutablePool) GetSpreadFactor ¶
func (mp *MockRoutablePool) GetSpreadFactor() math.LegacyDec
GetSpreadFactor implements domain.RoutablePool.
func (*MockRoutablePool) GetTakerFee ¶
func (mp *MockRoutablePool) GetTakerFee() math.LegacyDec
GetTakerFee implements domain.PoolI.
func (*MockRoutablePool) GetTickModel ¶
func (mp *MockRoutablePool) GetTickModel() (*domain.TickModel, error)
GetTickModel implements domain.RoutablePool.
func (*MockRoutablePool) GetTokenOutDenom ¶
func (mp *MockRoutablePool) GetTokenOutDenom() string
GetTokenOutDenom implements routerusecase.RoutablePool.
func (*MockRoutablePool) GetTotalValueLockedUOSMO ¶
func (mp *MockRoutablePool) GetTotalValueLockedUOSMO() math.Int
GetTotalValueLockedUOSMO implements domain.PoolI.
func (*MockRoutablePool) GetType ¶
func (mp *MockRoutablePool) GetType() poolmanagertypes.PoolType
GetType implements domain.PoolI.
func (*MockRoutablePool) GetUnderlyingPool ¶
func (mp *MockRoutablePool) GetUnderlyingPool() poolmanagertypes.PoolI
GetUnderlyingPool implements routerusecase.RoutablePool.
func (*MockRoutablePool) SetTickModel ¶
func (mp *MockRoutablePool) SetTickModel(tickModel *domain.TickModel) error
SetTickModel implements domain.PoolI.
func (*MockRoutablePool) SetTokenOutDenom ¶
func (*MockRoutablePool) SetTokenOutDenom(tokenOutDenom string)
SetTokenOutDenom implements domain.RoutablePool.
func (*MockRoutablePool) String ¶
func (*MockRoutablePool) String() string
String implements domain.RoutablePool.
type PoolsUsecaseMock ¶
func (*PoolsUsecaseMock) GetAllPools ¶
GetAllPools implements domain.PoolsUsecase.
func (*PoolsUsecaseMock) GetRoutesFromCandidates ¶
func (pm *PoolsUsecaseMock) GetRoutesFromCandidates(ctx context.Context, candidateRoutes route.CandidateRoutes, takerFeeMap domain.TakerFeeMap, tokenInDenom string, tokenOutDenom string) ([]route.RouteImpl, error)
GetRoutesFromCandidates implements mvc.PoolsUsecase. Note that taker fee are ignored and not set Note that tick models are not set
func (*PoolsUsecaseMock) GetTickModelMap ¶
func (pm *PoolsUsecaseMock) GetTickModelMap(ctx context.Context, poolIDs []uint64) (map[uint64]domain.TickModel, error)
GetTickModelMap implements mvc.PoolsUsecase.
type RedisPoolsRepositoryMock ¶
func (*RedisPoolsRepositoryMock) ClearAllPools ¶
ClearAllPools implements domain.PoolsRepository.
func (*RedisPoolsRepositoryMock) GetAllPools ¶
GetAllPools implements domain.PoolsRepository.
func (*RedisPoolsRepositoryMock) GetPools ¶
func (r *RedisPoolsRepositoryMock) GetPools(ctx context.Context, poolIDs map[uint64]struct{}) (map[uint64]domain.PoolI, error)
GetPools implements mvc.PoolsRepository.
func (*RedisPoolsRepositoryMock) GetTickModelForPools ¶
func (r *RedisPoolsRepositoryMock) GetTickModelForPools(ctx context.Context, pools []uint64) (map[uint64]domain.TickModel, error)
GetTickModelForPools implements mvc.PoolsRepository.
func (*RedisPoolsRepositoryMock) StorePools ¶
func (r *RedisPoolsRepositoryMock) StorePools(ctx context.Context, tx mvc.Tx, allPools []domain.PoolI) error
StorePools implements domain.PoolsRepository.
type RedisRouterRepositoryMock ¶
type RedisRouterRepositoryMock struct { TakerFees domain.TakerFeeMap Routes map[domain.DenomPair]route.CandidateRoutes }
func (*RedisRouterRepositoryMock) GetAllTakerFees ¶
func (r *RedisRouterRepositoryMock) GetAllTakerFees(ctx context.Context) (domain.TakerFeeMap, error)
GetAllTakerFees implements domain.RouterRepository.
func (*RedisRouterRepositoryMock) GetRoutes ¶
func (r *RedisRouterRepositoryMock) GetRoutes(ctx context.Context, denom0 string, denom1 string) (route.CandidateRoutes, error)
GetRoutes implements domain.RouterRepository.
func (*RedisRouterRepositoryMock) GetTakerFee ¶
func (r *RedisRouterRepositoryMock) GetTakerFee(ctx context.Context, denom0 string, denom1 string) (math.LegacyDec, error)
GetTakerFee implements domain.RouterRepository.
func (*RedisRouterRepositoryMock) SetRoutes ¶
func (r *RedisRouterRepositoryMock) SetRoutes(ctx context.Context, denom0 string, denom1 string, routes route.CandidateRoutes) error
SetRoutes implements domain.RouterRepository.
func (*RedisRouterRepositoryMock) SetRoutesTx ¶
func (r *RedisRouterRepositoryMock) SetRoutesTx(ctx context.Context, tx mvc.Tx, denom0 string, denom1 string, routes route.CandidateRoutes) error
SetRoutesTx implements domain.RouterRepository.
type TokensUseCaseMock ¶
type TokensUseCaseMock struct {
// contains filtered or unexported fields
}
func (*TokensUseCaseMock) GetDenomPrecisions ¶
GetDenomPrecisions implements domain.TokensUsecase.