mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Small esthetic refacotring
This commit is contained in:
@@ -330,20 +330,7 @@ namespace BTCPayServer.Controllers
|
|||||||
vm.SigningContext.OriginalPSBT = psbt.ToBase64();
|
vm.SigningContext.OriginalPSBT = psbt.ToBase64();
|
||||||
proposedPayjoin.Finalize();
|
proposedPayjoin.Finalize();
|
||||||
var hash = proposedPayjoin.ExtractTransaction().GetHash();
|
var hash = proposedPayjoin.ExtractTransaction().GetHash();
|
||||||
_EventAggregator.Publish(new UpdateTransactionLabel()
|
_EventAggregator.Publish(new UpdateTransactionLabel(walletId, hash, UpdateTransactionLabel.PayjoinLabelTemplate()));
|
||||||
{
|
|
||||||
WalletId = walletId,
|
|
||||||
TransactionLabels = new Dictionary<uint256, List<(string color, string label)>>()
|
|
||||||
{
|
|
||||||
{
|
|
||||||
hash,
|
|
||||||
new List<(string color, string label)>
|
|
||||||
{
|
|
||||||
UpdateTransactionLabel.PayjoinLabelTemplate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
TempData.SetStatusMessageModel(new StatusMessageModel()
|
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||||
{
|
{
|
||||||
Severity = StatusMessageModel.StatusSeverity.Success,
|
Severity = StatusMessageModel.StatusSeverity.Success,
|
||||||
|
|||||||
@@ -50,12 +50,7 @@ namespace BTCPayServer.HostedServices
|
|||||||
labels.Add(UpdateTransactionLabel.PayjoinLabelTemplate());
|
labels.Add(UpdateTransactionLabel.PayjoinLabelTemplate());
|
||||||
}
|
}
|
||||||
|
|
||||||
_eventAggregator.Publish(new UpdateTransactionLabel()
|
_eventAggregator.Publish(new UpdateTransactionLabel(walletId, transactionId, labels));
|
||||||
{
|
|
||||||
WalletId = walletId,
|
|
||||||
TransactionLabels =
|
|
||||||
new Dictionary<uint256, List<(string color, string label)>>() {{transactionId, labels}}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else if (evt is UpdateTransactionLabel updateTransactionLabel)
|
else if (evt is UpdateTransactionLabel updateTransactionLabel)
|
||||||
{
|
{
|
||||||
@@ -96,6 +91,22 @@ namespace BTCPayServer.HostedServices
|
|||||||
|
|
||||||
public class UpdateTransactionLabel
|
public class UpdateTransactionLabel
|
||||||
{
|
{
|
||||||
|
public UpdateTransactionLabel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public UpdateTransactionLabel(WalletId walletId, uint256 txId, (string color, string label) colorLabel)
|
||||||
|
{
|
||||||
|
WalletId = walletId;
|
||||||
|
TransactionLabels = new Dictionary<uint256, List<(string color, string label)>>();
|
||||||
|
TransactionLabels.Add(txId, new List<(string color, string label)>() { colorLabel });
|
||||||
|
}
|
||||||
|
public UpdateTransactionLabel(WalletId walletId, uint256 txId, List<(string color, string label)> colorLabels)
|
||||||
|
{
|
||||||
|
WalletId = walletId;
|
||||||
|
TransactionLabels = new Dictionary<uint256, List<(string color, string label)>>();
|
||||||
|
TransactionLabels.Add(txId, colorLabels);
|
||||||
|
}
|
||||||
public static (string color, string label) PayjoinLabelTemplate()
|
public static (string color, string label) PayjoinLabelTemplate()
|
||||||
{
|
{
|
||||||
return ("#51b13e", "payjoin");
|
return ("#51b13e", "payjoin");
|
||||||
|
|||||||
Reference in New Issue
Block a user