Skip to content
Permalink
Browse files

[skip ci] Add SmartCoinStatus

  • Loading branch information...
nopara73 committed Nov 16, 2018
1 parent 88483f0 commit c3b90836f32690c50535791e8cbf7ef4fb7e69aa
@@ -7,17 +7,14 @@
using NBitcoin;
using System.Reactive.Linq;
using System.Linq;
using WalletWasabi.Gui.Models;

namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public enum CoinStatusEnum
{
None,
}
public class CoinViewModel : ViewModelBase
{
private bool _isSelected;
private CoinStatusEnum _status;
private SmartCoinStatus _status;

public CoinViewModel(SmartCoin model)
{
@@ -82,12 +79,10 @@ public bool IsSelected

public string History => string.Join(", ", Global.WalletService.GetHistory(Model, Enumerable.Empty<SmartCoin>()).Select(x => x.Label).Distinct());

public CoinStatusEnum Status
{
get => _status;
set { this.RaiseAndSetIfChanged(ref _status, value); }
public SmartCoinStatus Status
{
get => _status;
set { this.RaiseAndSetIfChanged(ref _status, value); }
}


}
}
@@ -147,7 +147,7 @@ private void RewriteTable()
var txinfo = new TransactionInfo
{
DateTime = txr.dateTime.ToLocalTime(),
Confirmed = txr.height != Models.Height.MemPool && txr.height != Models.Height.Unknown,
Confirmed = txr.height != WalletWasabi.Models.Height.MemPool && txr.height != WalletWasabi.Models.Height.Unknown,
AmountBtc = $"{txr.amount.ToString(fplus: true, trimExcessZero: true)}",
Label = txr.label,
TransactionId = txr.transactionId.ToString()
@@ -5,6 +5,7 @@
using System.Globalization;
using System.Text;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Models;
using WalletWasabi.Models.ChaumianCoinJoin;

namespace WalletWasabi.Gui.Converters
@@ -13,12 +14,13 @@ public class CoinStatusColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is CoinStatusEnum status)
if (value is SmartCoinStatus status)
{
switch (status)
{
case CoinStatusEnum.None:
case SmartCoinStatus.Confirmed:
return Brushes.Black;

default:
return Brushes.Transparent;
}
@@ -4,6 +4,7 @@
using System.Globalization;
using System.Text;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Models;
using WalletWasabi.Models.ChaumianCoinJoin;

namespace WalletWasabi.Gui.Converters
@@ -12,7 +13,7 @@ public class CoinStatusStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is CoinStatusEnum status)
if (value is SmartCoinStatus status)
{
return status.ToString();
}
@@ -23,7 +24,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var s = value.ToString();
return Enum.Parse<CoinStatusEnum>(s);
return Enum.Parse<SmartCoinStatus>(s);
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WalletWasabi.Gui.Models
{
public enum SmartCoinStatus
{
Unconfirmed, // The coin is unconfirmed.
Confirmed, // The coin is confirmed.
SpentAccordingToBackend, // The coin is spent according to the backend, but the wallet does not know about it yet. Probably a lost mempool transaction.
MixingBanned, // The coin is banned from mixing.
MixingWaitingForConfirmation, // The coin is on the mixing waiting list, but it is unconfirmed, so it cannot be registered yet.
MixingOnWaitingList, // The coin is on the mixing waiting list.
MixingInputRegistration, // The coin is registered for mixing.
MixingConnectionConfirmation, // The coin being mixed and in ConnectionConfirmation phase already.
MixingOutputRegistration, // The coin being mixed and in OutputRegistration phase already.
MixingSigning // The coin being mixed and in Signing phase already.
}
}

0 comments on commit c3b9083

Please sign in to comment.
You can’t perform that action at this time.