Skip to content

Commit

Permalink
Merge pull request zingolabs#546 from juanky201271/dev_unconfirmed_ne…
Browse files Browse the repository at this point in the history
…w_field_summaries

Unconfirmed field added
  • Loading branch information
juanky201271 authored Oct 29, 2023
2 parents cb77ebb + 7923995 commit bbdd5e6
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ data class Summaries (
val to_address : String?,
val memos : List<String>?,
val kind : String,
val pool : String?
val pool : String?,
val unconfirmed : Boolean
)

@Category(OfflineTest::class)
Expand Down
4 changes: 3 additions & 1 deletion app/rpc/RPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,9 @@ export default class RPC {
if (!currentTxList[0].type && !!type) {
currentTxList[0].type = type;
}
if (!currentTxList[0].confirmations) {
if (tx.unconfirmed) {
currentTxList[0].confirmations = 0;
} else if (!currentTxList[0].confirmations) {
currentTxList[0].confirmations = this.lastServerBlockHeight
? this.lastServerBlockHeight - tx.block_height + 1
: 0;
Expand Down
1 change: 1 addition & 0 deletions app/rpc/types/RPCSummariesType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type RPCSummariesType = {
memos?: string[];
kind: 'Sent' | 'Received' | 'SendToSelf' | 'Fee';
pool?: 'Orchard' | 'Sapling' | 'Transparent' | 'None';
unconfirmed: boolean;
};
2 changes: 1 addition & 1 deletion components/History/components/TxDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const TxDetail: React.FunctionComponent<TxDetailProps> = ({ tx, closeModal, set_
</View>
<View style={{ display: 'flex', alignItems: 'flex-end' }}>
<FadeText>{translate('history.confirmations') as string}</FadeText>
<RegText>{tx.confirmations ? tx.confirmations.toString() : '-'}</RegText>
<RegText>{tx.confirmations.toString()}</RegText>
</View>
</View>

Expand Down
Loading

0 comments on commit bbdd5e6

Please sign in to comment.