Skip to content

Commit

Permalink
fix: fix pool query (include missing fields in response)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcre committed Aug 17, 2023
1 parent 6fb60b5 commit cacfcf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions x/amm/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func (s *KeeperTestSuite) TestQueryPool() {
s.Require().EqualValues(1, resp.Pool.Id)
s.Require().Equal("71751002uatom", resp.Pool.Balance0.String())
s.Require().Equal("1390716312uusd", resp.Pool.Balance1.String())
s.Require().Equal("cosmos1srphgsfqllr85ndknjme24txux8m0sz0hhpnnksn2339d3a788rsawjx77", resp.Pool.RewardsPool)
s.AssertEqual(utils.ParseDec("1"), resp.Pool.MinOrderQuantity)
s.AssertEqual(sdk.NewInt(12470981864), resp.Pool.TotalLiquidity)
},
},
{
Expand Down
4 changes: 3 additions & 1 deletion x/amm/types/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ func NewPoolResponse(pool Pool, poolState PoolState, balances sdk.Coins) PoolRes
MarketId: pool.MarketId,
Balance0: sdk.NewCoin(pool.Denom0, balances.AmountOf(pool.Denom0)),
Balance1: sdk.NewCoin(pool.Denom1, balances.AmountOf(pool.Denom1)),
TickSpacing: pool.TickSpacing,
ReserveAddress: pool.ReserveAddress,
RewardsPool: pool.RewardsPool,
TickSpacing: pool.TickSpacing,
MinOrderQuantity: pool.MinOrderQuantity,
CurrentTick: poolState.CurrentTick,
CurrentPrice: poolState.CurrentPrice,
CurrentLiquidity: poolState.CurrentLiquidity,
Expand Down

0 comments on commit cacfcf3

Please sign in to comment.