Skip to content

Commit

Permalink
Merge pull request #1529 from oasisprotocol/lw/negative-allowance
Browse files Browse the repository at this point in the history
Fix displaying negative allowance changes
  • Loading branch information
lukaw3d authored Sep 6, 2024
2 parents 8fdba88 + 2f58849 commit 9ac3f49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/1529.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix displaying negative allowance changes
4 changes: 3 additions & 1 deletion src/app/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export const getConsensusTransactionToAddress = (transaction: Transaction) => {
export const getConsensusTransactionAmount = (transaction: Transaction) => {
switch (transaction.method) {
case ConsensusTxMethod.stakingAllow:
return transaction.body?.amount_change
return transaction.body?.negative
? `-${transaction.body?.amount_change}`
: transaction.body?.amount_change
case ConsensusTxMethod.stakingAddEscrow:
case ConsensusTxMethod.stakingTransfer:
return transaction.body?.amount
Expand Down

0 comments on commit 9ac3f49

Please sign in to comment.