Skip to content

Commit

Permalink
Remove TransactionStatus.SpeedUp
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperJMN committed May 26, 2024
1 parent 65baee5 commit 4c51650
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
5 changes: 2 additions & 3 deletions WalletWasabi.Fluent/Models/Wallets/TransactionStatus.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace WalletWasabi.Fluent.Models.Wallets;
namespace WalletWasabi.Fluent.Models.Wallets;

public enum TransactionStatus
{
Unknown,
Confirmed,
Pending,
SpeedUp,
Pending
}
25 changes: 3 additions & 22 deletions WalletWasabi.Fluent/Models/Wallets/TransactionTreeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private TransactionModel CreateSpeedUpGroup(TransactionSummary transactionSummar
Status =
isConfirmed
? TransactionStatus.Confirmed
: TransactionStatus.SpeedUp,
: TransactionStatus.Pending,
};

var dates = children.Select(tx => tx.Date).ToImmutableArray();
Expand Down Expand Up @@ -310,26 +310,9 @@ private TransactionType GetItemType(TransactionSummary transactionSummary)
return TransactionType.Unknown;
}

private TransactionStatus GetItemStatus(TransactionSummary transactionSummary)
private static TransactionStatus GetItemStatus(TransactionSummary transactionSummary)
{
var isConfirmed = transactionSummary.IsConfirmed();

if (isConfirmed)
{
return TransactionStatus.Confirmed;
}

if (!isConfirmed && (transactionSummary.IsSpeedup || transactionSummary.IsCPFPd))
{
return TransactionStatus.SpeedUp;
}

if (!isConfirmed && !transactionSummary.IsSpeedup)
{
return TransactionStatus.Pending;
}

return TransactionStatus.Unknown;
return transactionSummary.IsConfirmed() ? TransactionStatus.Confirmed : TransactionStatus.Pending;
}

private string GetConfirmationToolTip(TransactionStatus status, int confirmations, SmartTransaction smartTransaction)
Expand All @@ -345,8 +328,6 @@ private string GetConfirmationToolTip(TransactionStatus status, int confirmation

return (status, friendlyString != "") switch
{
(TransactionStatus.SpeedUp, true) => $"Pending (accelerated, confirming in ≈ {friendlyString})",
(TransactionStatus.SpeedUp, false) => "Pending (accelerated)",
(TransactionStatus.Pending, true) => $"Pending (confirming in ≈ {friendlyString})",
(TransactionStatus.Pending, false) => "Pending",
_ => "Unknown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<!--First icon (Confirmation Status) -->
<PathIcon Classes.Confirmed="{Binding Transaction.Status, ConverterParameter={x:Static model:TransactionStatus.Confirmed}, Converter={x:Static converters:EnumToBoolConverter.Instance}}"
Classes.Pending="{Binding Transaction.Status, ConverterParameter={x:Static model:TransactionStatus.Pending}, Converter={x:Static converters:EnumToBoolConverter.Instance}}"
Classes.SpeedUp="{Binding Transaction.Status, ConverterParameter={x:Static model:TransactionStatus.SpeedUp}, Converter={x:Static converters:EnumToBoolConverter.Instance}}"
ToolTip.Tip="{Binding Transaction.ConfirmedTooltip}"
Opacity="0.6">
<PathIcon.Styles>
Expand All @@ -26,10 +25,6 @@
<Setter Property="Data" Value="{StaticResource clock_regular}" />
<Setter Property="Height" Value="15" />
</Style>
<Style Selector="PathIcon.SpeedUp">
<Setter Property="Data" Value="{StaticResource rocket_regular}" />
<Setter Property="Height" Value="15" />
</Style>
</PathIcon.Styles>
</PathIcon>

Expand Down

0 comments on commit 4c51650

Please sign in to comment.