From 8571e8a5d287975963402d3d701d32587169f89d Mon Sep 17 00:00:00 2001 From: doggystylez <98429202+doggystylez@users.noreply.github.com> Date: Fri, 19 Jan 2024 08:19:05 -0500 Subject: [PATCH 1/3] fix `ListPoolsByDenom` method --- x/poolmanager/router.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/poolmanager/router.go b/x/poolmanager/router.go index dc90adb597b..6a8d1ffd238 100644 --- a/x/poolmanager/router.go +++ b/x/poolmanager/router.go @@ -577,7 +577,10 @@ func (k Keeper) ListPoolsByDenom( var poolsByDenom []types.PoolI for _, pool := range currentModulePools { - poolDenoms := pool.GetPoolDenoms(ctx) + poolDenoms, err := poolModule.GetPoolDenoms(ctx, pool.GetId()) + if err != nil { + return nil, err + } if osmoutils.Contains(poolDenoms, denom) { poolsByDenom = append(poolsByDenom, pool) } From 459dc0db1dc0076c4d86047a77aa34ef62f19218 Mon Sep 17 00:00:00 2001 From: doggystylez <98429202+doggystylez@users.noreply.github.com> Date: Fri, 19 Jan 2024 08:24:39 -0500 Subject: [PATCH 2/3] a test --- x/poolmanager/router_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/poolmanager/router_test.go b/x/poolmanager/router_test.go index 66772f70700..4df708c11d4 100644 --- a/x/poolmanager/router_test.go +++ b/x/poolmanager/router_test.go @@ -3870,6 +3870,14 @@ func (suite *KeeperTestSuite) TestListPoolsByDenom() { denom: BAR, expectedNumPools: 2, }, + "A cosmwasm pool": { + poolType: []types.PoolType{types.CosmWasm}, + poolCoins: []sdk.Coins{ + sdk.NewCoins(sdk.NewCoin(BAR, defaultInitPoolAmount), sdk.NewCoin(UOSMO, defaultInitPoolAmount)), // pool 1 bar-uosmo + }, + denom: BAR, + expectedNumPools: 1, + }, } for name, tc := range tests { From a57a43914c5e3af786e8ed03405eed83d8969075 Mon Sep 17 00:00:00 2001 From: doggystylez <98429202+doggystylez@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:28:31 -0500 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7280917fc..8989776ca94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes * [#7360](https://github.com/osmosis-labs/osmosis/pull/7360) fix: use gov type for SetScalingFactorController +* [#7341](https://github.com/osmosis-labs/osmosis/pull/7341) fix: support CosmWasm pools in ListPoolsByDenom method ### Misc Improvements