show n/x confirms while unconfirmed

This commit is contained in:
julian 2024-07-15 15:19:00 -06:00 committed by julian-CStack
parent 4acfbde791
commit 816eb37477
2 changed files with 25 additions and 12 deletions

View file

@ -192,6 +192,9 @@ class TransactionV2 {
required int currentChainHeight,
required int minConfirms,
}) {
String prettyConfirms() =>
"(${getConfirmations(currentChainHeight)}/$minConfirms)";
if (subType == TransactionSubType.cashFusion ||
subType == TransactionSubType.mint ||
(subType == TransactionSubType.sparkMint &&
@ -199,7 +202,7 @@ class TransactionV2 {
if (isConfirmed(currentChainHeight, minConfirms)) {
return "Anonymized";
} else {
return "Anonymizing";
return "Anonymizing ${prettyConfirms()}";
}
}
@ -219,7 +222,7 @@ class TransactionV2 {
} else if ((numberOfMessages ?? 0) > 1) {
return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no)
} else {
return "Receiving";
return "Receiving ${prettyConfirms()}";
}
}
} else if (type == TransactionType.outgoing) {
@ -231,7 +234,7 @@ class TransactionV2 {
} else if ((numberOfMessages ?? 0) > 1) {
return "Sending (waiting for confirmations)";
} else {
return "Sending";
return "Sending ${prettyConfirms()}";
}
}
}
@ -244,16 +247,20 @@ class TransactionV2 {
if (isConfirmed(currentChainHeight, minConfirms)) {
return "Received";
} else {
return "Receiving";
return "Receiving ${prettyConfirms()}";
}
} else if (type == TransactionType.outgoing) {
if (isConfirmed(currentChainHeight, minConfirms)) {
return "Sent";
} else {
return "Sending";
return "Sending ${prettyConfirms()}";
}
} else if (type == TransactionType.sentToSelf) {
return "Sent to self";
if (isConfirmed(currentChainHeight, minConfirms)) {
return "Sent to self";
} else {
return "Sent to self ${prettyConfirms()}";
}
} else {
return type.name;
}

View file

@ -134,13 +134,15 @@ class _TransactionDetailsViewState
}
String whatIsIt(Transaction tx, int height) {
String prettyConfirms() => "(${tx.getConfirmations(height)}/$minConfirms)";
final type = tx.type;
if (coin is Firo) {
if (tx.subType == TransactionSubType.mint) {
if (tx.isConfirmed(height, minConfirms)) {
return "Minted";
} else {
return "Minting";
return "Minting ${prettyConfirms()}";
}
}
}
@ -157,7 +159,7 @@ class _TransactionDetailsViewState
} else if ((_transaction.numberOfMessages ?? 0) > 1) {
return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no)
} else {
return "Receiving";
return "Receiving ${prettyConfirms()}";
}
}
} else if (type == TransactionType.outgoing) {
@ -169,7 +171,7 @@ class _TransactionDetailsViewState
} else if ((_transaction.numberOfMessages ?? 0) > 1) {
return "Sending (waiting for confirmations)";
} else {
return "Sending";
return "Sending ${prettyConfirms()}";
}
}
}
@ -182,16 +184,20 @@ class _TransactionDetailsViewState
if (tx.isConfirmed(height, minConfirms)) {
return "Received";
} else {
return "Receiving";
return "Receiving ${prettyConfirms()}";
}
} else if (type == TransactionType.outgoing) {
if (tx.isConfirmed(height, minConfirms)) {
return "Sent";
} else {
return "Sending";
return "Sending ${prettyConfirms()}";
}
} else if (type == TransactionType.sentToSelf) {
return "Sent to self";
if (tx.isConfirmed(height, minConfirms)) {
return "Sent to self";
} else {
return "Sent to self ${prettyConfirms()}";
}
} else {
return type.name;
}