Rename destroyed to replaced
MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
@@ -227,10 +227,10 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Equal(Money.Coins(1.0m), originalCoin.Amount);
// Remove the created coin by the transaction.
- Assert.Equal(3, e.DestroyedCoins.Count());
- Assert.Single(e.DestroyedCoins, coin => coin.HdPubKey.Label == "B");
- Assert.Single(e.DestroyedCoins, coin => coin.HdPubKey.Label == "C");
- Assert.Single(e.DestroyedCoins, coin => coin.HdPubKey.Label == "D");
+ Assert.Equal(3, e.ReplacedCoins.Count());
+ Assert.Single(e.ReplacedCoins, coin => coin.HdPubKey.Label == "B");
+ Assert.Single(e.ReplacedCoins, coin => coin.HdPubKey.Label == "C");
+ Assert.Single(e.ReplacedCoins, coin => coin.HdPubKey.Label == "D");
replaceTransactionReceivedCalled++;
};

MODIFY
WalletWasabi/Blockchain/Transactions/ReplaceTransactionReceivedEventArgs.cs
WalletWasabi/Blockchain/Transactions/ReplaceTransactionReceivedEventArgs.cs
@@ -5,15 +5,15 @@ namespace WalletWasabi.Blockchain.Transactions
{
public class ReplaceTransactionReceivedEventArgs
{
- public ReplaceTransactionReceivedEventArgs(SmartTransaction smartTransaction, IEnumerable<SmartCoin> destroyedCoins, IEnumerable<SmartCoin> restoredCoins)
+ public ReplaceTransactionReceivedEventArgs(SmartTransaction smartTransaction, IEnumerable<SmartCoin> replacedCoins, IEnumerable<SmartCoin> restoredCoins)
{
SmartTransaction = smartTransaction;
- DestroyedCoins = destroyedCoins;
+ ReplacedCoins = replacedCoins;
RestoredCoins = restoredCoins;
}
public SmartTransaction SmartTransaction { get; }
- public IEnumerable<SmartCoin> DestroyedCoins { get; }
+ public IEnumerable<SmartCoin> ReplacedCoins { get; }
public IEnumerable<SmartCoin> RestoredCoins { get; }
}
}

MODIFY
WalletWasabi/Blockchain/Transactions/TransactionProcessor.cs
WalletWasabi/Blockchain/Transactions/TransactionProcessor.cs
@@ -97,15 +97,14 @@ namespace WalletWasabi.Blockchain.Transactions
if (isReplacemenetTx)
{
// Undo the replaced transaction by removing the coins it created (if other coin
- // spends it, remove that too and so on) and restoring those that it destroyed
- // ones. After undoing the replaced transaction it will process the replacement
- // transaction.
+ // spends it, remove that too and so on) and restoring those that it replaced.
+ // After undoing the replaced transaction it will process the replacement transaction.
var replacedTxId = doubleSpends.First().TransactionId;
- var (destroyed, restored) = Coins.Undo(replacedTxId);
+ var (replaced, restored) = Coins.Undo(replacedTxId);
- ReplaceTransactionReceived?.Invoke(this, new ReplaceTransactionReceivedEventArgs(tx, destroyed, restored));
+ ReplaceTransactionReceived?.Invoke(this, new ReplaceTransactionReceivedEventArgs(tx, replaced, restored));
- foreach (var replacedTransactionId in destroyed.Select(coin => coin.TransactionId))
+ foreach (var replacedTransactionId in replaced.Select(coin => coin.TransactionId))
{
TransactionStore.MempoolStore.TryRemove(replacedTransactionId, out _);
}

Rename destroyed to replaced