Skip to content

Commit

Permalink
Bring back pool id for single swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse committed Oct 13, 2023
1 parent 42e0785 commit 600209d
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 109 deletions.
4 changes: 2 additions & 2 deletions proto/osmosis/poolmanager/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ message EstimateSwapExactAmountInWithPrimitiveTypesRequest {

message EstimateSinglePoolSwapExactAmountInRequest {
uint64 pool_id = 1
[ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ];
[ (gogoproto.moretags) = "yaml:\"pool_id\""];
string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ];
string token_out_denom = 3
[ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
Expand Down Expand Up @@ -181,7 +181,7 @@ message EstimateSwapExactAmountOutWithPrimitiveTypesRequest {

message EstimateSinglePoolSwapExactAmountOutRequest {
uint64 pool_id = 1
[ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ];
[ (gogoproto.moretags) = "yaml:\"pool_id\""];
string token_in_denom = 2
[ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ];
string token_out = 3 [ (gogoproto.moretags) = "yaml:\"token_out\"" ];
Expand Down
4 changes: 2 additions & 2 deletions x/poolmanager/client/query_proto_wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ func (q Querier) EstimateSwapExactAmountOutWithPrimitiveTypes(ctx sdk.Context, r
func (q Querier) EstimateSinglePoolSwapExactAmountOut(ctx sdk.Context, req queryproto.EstimateSinglePoolSwapExactAmountOutRequest) (*queryproto.EstimateSwapExactAmountOutResponse, error) {
routeReq := &queryproto.EstimateSwapExactAmountOutRequest{
TokenOut: req.TokenOut,
Routes: types.SwapAmountOutRoutes{{TokenInDenom: req.TokenInDenom}},
Routes: types.SwapAmountOutRoutes{{TokenInDenom: req.TokenInDenom, PoolId: req.PoolId}},
}
return q.EstimateSwapExactAmountOut(ctx, *routeReq)
}

func (q Querier) EstimateSinglePoolSwapExactAmountIn(ctx sdk.Context, req queryproto.EstimateSinglePoolSwapExactAmountInRequest) (*queryproto.EstimateSwapExactAmountInResponse, error) {
routeReq := &queryproto.EstimateSwapExactAmountInRequest{
TokenIn: req.TokenIn,
Routes: types.SwapAmountInRoutes{{TokenOutDenom: req.TokenOutDenom}},
Routes: types.SwapAmountInRoutes{{TokenOutDenom: req.TokenOutDenom, PoolId: req.PoolId}},
}
return q.EstimateSwapExactAmountIn(ctx, *routeReq)
}
Expand Down
Loading

0 comments on commit 600209d

Please sign in to comment.