From 4ac8b6273a7b5253670cad0183f66bdedd8d8170 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 11 Nov 2021 16:12:09 +0300 Subject: [PATCH] Flow --- .../api/ada/lib/storage/bridge/updateTransactions.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/yoroi-extension/app/api/ada/lib/storage/bridge/updateTransactions.js b/packages/yoroi-extension/app/api/ada/lib/storage/bridge/updateTransactions.js index 2dc8862aac..3f8b5d7e44 100644 --- a/packages/yoroi-extension/app/api/ada/lib/storage/bridge/updateTransactions.js +++ b/packages/yoroi-extension/app/api/ada/lib/storage/bridge/updateTransactions.js @@ -371,9 +371,13 @@ export async function rawGetTransactions( ?.get(rewardAddr.payment_cred()); // happens if the MIR is to another pot if (rewardAmount == null) continue; - const rewardAmountStr = rewardAmount.is_positive() - ? rewardAmount.as_positive().to_str() - : ('-' + rewardAmount.as_negative().to_str()); + const isPositive = rewardAmount.is_positive(); + const rewardAmountBigInt = isPositive + ? rewardAmount.as_positive() + : rewardAmount.as_negative(); + if (rewardAmountBigInt == null) continue; + const rewardAmountStr = + (isPositive ? '' : '-') + rewardAmountBigInt.to_str(); implicitOutputSum.add({ identifier: defaultToken.defaultIdentifier, networkId: defaultToken.defaultNetworkId,