From fa9e2f7d455a878a6b630eef342f79715ecd5e4d Mon Sep 17 00:00:00 2001 From: Javi Romero Date: Sat, 17 Feb 2024 20:57:28 +0000 Subject: [PATCH 1/3] fix(account_page_header) The token balances dropdown was adding obligations to the total balance, this has been removed --- src/rippled/accountState.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/rippled/accountState.js b/src/rippled/accountState.js index 8a03d309d..36d23abaa 100644 --- a/src/rippled/accountState.js +++ b/src/rippled/accountState.js @@ -28,14 +28,6 @@ const formatBalances = (info, data) => { const { assets = {}, obligations = {} } = data const tokens = [] - Object.keys(obligations).forEach((currency) => { - if (!balances[currency]) { - balances[currency] = 0 - } - - balances[currency] += Number(obligations[currency]) - }) - Object.keys(assets).forEach((issuer) => { assets[issuer].forEach((d) => { if (!balances[d.currency]) { From d383e418396ad45e5975448863cba0cad44b1620 Mon Sep 17 00:00:00 2001 From: Javi Romero Date: Sat, 17 Feb 2024 21:02:11 +0000 Subject: [PATCH 2/3] chore(lint): fix linting --- src/rippled/accountState.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rippled/accountState.js b/src/rippled/accountState.js index 36d23abaa..74acbaec4 100644 --- a/src/rippled/accountState.js +++ b/src/rippled/accountState.js @@ -25,7 +25,7 @@ const log = logger({ name: 'account balances' }) const formatBalances = (info, data) => { const balances = { XRP: Number(info.Balance) / 1000000 } - const { assets = {}, obligations = {} } = data + const { assets = {} } = data const tokens = [] Object.keys(assets).forEach((issuer) => { From 5937f7a8e88fc80a38f48d83ab30497699cf6e22 Mon Sep 17 00:00:00 2001 From: Javi Romero Date: Sat, 17 Feb 2024 21:28:36 +0000 Subject: [PATCH 3/3] chore: fix balances tests --- src/containers/Accounts/AccountHeader/test/actions.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/containers/Accounts/AccountHeader/test/actions.test.js b/src/containers/Accounts/AccountHeader/test/actions.test.js index 797787a05..f012cfbb3 100644 --- a/src/containers/Accounts/AccountHeader/test/actions.test.js +++ b/src/containers/Accounts/AccountHeader/test/actions.test.js @@ -95,10 +95,10 @@ describe('AccountHeader Actions', () => { CHF: 0.7519685210971255, CNY: 12.328638002, DYM: 95.13258522535791, - EUR: 53.426387263174405, - GBP: 79.51188949705619, + EUR: 28.42638726317441, + GBP: 78.5098894970562, JPY: 4986.30908732758, - USD: 936.8290046958887, + USD: 275.7836054268899, XAU: 3.419442510305086, XRP: 1172875.760329, },