Skip to content

Commit dd736b6

Browse files
committed
Merge branch 'origin/bengt/balances-fix-issue-758' (#1528)
* origin/bengt/balances-fix-issue-758: fmt, added changelog fix: use the correct storage key to parse balances
2 parents 9ed9ebf + 3e87497 commit dd736b6

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fixing how token balances are displayed in case of missing --token option.
2+
([#1528](https://github.com/anoma/namada/pull/1528))

apps/src/lib/client/rpc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ pub async fn query_transparent_balance<
314314
}
315315
(None, Some(owner)) => {
316316
for token in tokens {
317-
let prefix = token.to_db_key().into();
317+
let prefix =
318+
token::balance_key(&token, &owner.address().unwrap());
318319
let balances =
319320
query_storage_prefix::<C, token::Amount>(client, &prefix)
320321
.await;
@@ -329,7 +330,7 @@ pub async fn query_transparent_balance<
329330
}
330331
}
331332
(Some(token), None) => {
332-
let prefix = token.to_db_key().into();
333+
let prefix = token::balance_prefix(&token);
333334
let balances =
334335
query_storage_prefix::<C, token::Amount>(client, &prefix).await;
335336
if let Some(balances) = balances {

0 commit comments

Comments
 (0)