Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwire the legacy router #3757

Merged
merged 11 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions packages/pools/src/router/__tests__/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
RoutablePool,
Route,
RouteWithInAmount,
TokenOutGivenInRouter,
} from "..";

// Mock RoutablePool for testing purposes
Expand Down Expand Up @@ -82,10 +81,7 @@ export const makeMockRoutablePool = (
*/

// Mock OptimizedRoutes for testing purposes to get access to protected methods
export class TestOptimizedRoutes
extends OptimizedRoutes
implements TokenOutGivenInRouter
{
export class TestOptimizedRoutes extends OptimizedRoutes {
constructor(...args: ConstructorParameters<typeof OptimizedRoutes>) {
super(...args);
}
Expand Down Expand Up @@ -125,10 +121,7 @@ export function makeDefaultTestRouterParams(
return new TestOptimizedRoutes(params);
}

export class RoutesTestOptimizedRoutes
extends OptimizedRoutes
implements TokenOutGivenInRouter
{
export class RoutesTestOptimizedRoutes extends OptimizedRoutes {
private testRoutes: Route[];

constructor(
Expand Down
11 changes: 2 additions & 9 deletions packages/pools/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ import {
RouteWithInAmount,
validateRoute,
} from "./route";
import {
Logger,
Quote,
RoutablePool,
SplitTokenInQuote,
Token,
TokenOutGivenInRouter,
} from "./types";
import { Logger, Quote, RoutablePool, SplitTokenInQuote, Token } from "./types";
import {
cacheKeyForTokenOutGivenIn,
invertRoute,
Expand Down Expand Up @@ -60,7 +53,7 @@ export type OptimizedRoutesParams = {
* @throws NotEnoughLiquidityError if there is not enough liquidity in a route.
* @throws NoRouteError if there is no route between the tokens.
*/
export class OptimizedRoutes implements TokenOutGivenInRouter {
export class OptimizedRoutes {
protected readonly _sortedPools: RoutablePool[];
protected readonly _preferredPoolIds?: string[];
protected readonly _getPoolTotalValueLocked: (poolId: string) => Dec;
Expand Down
9 changes: 0 additions & 9 deletions packages/pools/src/router/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ export type Token = {
amount: Int;
};

export interface TokenOutGivenInRouter {
/** Route, with splits, given an in token and out denom. */
routeByTokenIn(
tokenIn: Token,
tokenOutDenom: string,
forcePoolId?: string
): Promise<SplitTokenInQuote>;
}

export interface RoutablePool {
/** Unique identifier across pools. */
id: string;
Expand Down
1 change: 0 additions & 1 deletion packages/server/src/queries/complex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export * from "./osmosis";
export * from "./pools";
export * from "./portfolio";
export * from "./staking";
export * from "./swap-routers";
export * from "./transactions";
1 change: 0 additions & 1 deletion packages/server/src/queries/complex/pools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export * from "./bonding";
export * from "./env";
export * from "./incentives";
export * from "./providers";
export * from "./route-token-out-given-in";
export * from "./share";
export * from "./superfluid";
export * from "./transmuter";
Expand Down
Loading
Loading