mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 14:04:12 +01:00
Small esthetic refacotring
This commit is contained in:
parent
e865d85c2c
commit
9e16b506e5
2 changed files with 18 additions and 20 deletions
|
@ -330,20 +330,7 @@ namespace BTCPayServer.Controllers
|
|||
vm.SigningContext.OriginalPSBT = psbt.ToBase64();
|
||||
proposedPayjoin.Finalize();
|
||||
var hash = proposedPayjoin.ExtractTransaction().GetHash();
|
||||
_EventAggregator.Publish(new UpdateTransactionLabel()
|
||||
{
|
||||
WalletId = walletId,
|
||||
TransactionLabels = new Dictionary<uint256, List<(string color, string label)>>()
|
||||
{
|
||||
{
|
||||
hash,
|
||||
new List<(string color, string label)>
|
||||
{
|
||||
UpdateTransactionLabel.PayjoinLabelTemplate()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
_EventAggregator.Publish(new UpdateTransactionLabel(walletId, hash, UpdateTransactionLabel.PayjoinLabelTemplate()));
|
||||
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||
{
|
||||
Severity = StatusMessageModel.StatusSeverity.Success,
|
||||
|
|
|
@ -50,12 +50,7 @@ namespace BTCPayServer.HostedServices
|
|||
labels.Add(UpdateTransactionLabel.PayjoinLabelTemplate());
|
||||
}
|
||||
|
||||
_eventAggregator.Publish(new UpdateTransactionLabel()
|
||||
{
|
||||
WalletId = walletId,
|
||||
TransactionLabels =
|
||||
new Dictionary<uint256, List<(string color, string label)>>() {{transactionId, labels}}
|
||||
});
|
||||
_eventAggregator.Publish(new UpdateTransactionLabel(walletId, transactionId, labels));
|
||||
}
|
||||
else if (evt is UpdateTransactionLabel updateTransactionLabel)
|
||||
{
|
||||
|
@ -96,6 +91,22 @@ namespace BTCPayServer.HostedServices
|
|||
|
||||
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()
|
||||
{
|
||||
return ("#51b13e", "payjoin");
|
||||
|
|
Loading…
Add table
Reference in a new issue