Skip to content

Commit

Permalink
Fabo/fix fees for 0 balance (#877)
Browse files Browse the repository at this point in the history
* trigger CI

* handle 0 balance fees in Cosmos

* changelog

Co-authored-by: Bitcoinera <[email protected]>
  • Loading branch information
faboweb and Bitcoinera authored Jun 2, 2020
1 parent e3ea46a commit 6e2ced9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/fabo_fix-fees-for-0-balance
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Fixed] Handle fees if user has 0 balance in that token @faboweb
2 changes: 1 addition & 1 deletion data/network-fees.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ const getCosmosFee = async (network, cosmosSource, senderAddress, messageType, m
),
denom: feeDenom
}
const selectedBalance = balances.find(({denom}) => denom === feeDenom)
const selectedBalance = balances.find(({denom}) => denom === feeDenom) || { amount: 0, denom: feeDenom }
if (
Number(transactionAmount) + Number(estimatedFee.amount) >
Number(selectedBalance.amount) &&
Expand Down

0 comments on commit 6e2ced9

Please sign in to comment.