-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1480 from oasisprotocol/mz/consensusTxDetails
Add missing props to Consensus tx details
- Loading branch information
Showing
9 changed files
with
113 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add missing props to Consensus tx details |
2 changes: 1 addition & 1 deletion
2
...lPage/__tests__/CurrentFiatValue.test.tsx → ...Value/__tests__/CurrentFiatValue.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ConsensusTxMethod, Transaction } from '../../oasis-nexus/api' | ||
|
||
export const getConsensusTransactionToAddress = (transaction: Transaction) => { | ||
switch (transaction.method) { | ||
case ConsensusTxMethod.stakingAddEscrow: | ||
return transaction.body?.address | ||
case ConsensusTxMethod.stakingAllow: | ||
return transaction.body?.beneficiary | ||
case ConsensusTxMethod.stakingReclaimEscrow: | ||
return transaction.body?.account | ||
case ConsensusTxMethod.stakingTransfer: | ||
return transaction.body?.to | ||
default: | ||
return undefined | ||
} | ||
} | ||
|
||
export const getConsensusTransactionAmount = (transaction: Transaction) => { | ||
switch (transaction.method) { | ||
case ConsensusTxMethod.stakingAllow: | ||
return transaction.body?.amount_change | ||
case ConsensusTxMethod.stakingAddEscrow: | ||
case ConsensusTxMethod.stakingTransfer: | ||
return transaction.body?.amount | ||
default: | ||
return undefined | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters