Fix ReceiveWasabiCoinJoinTransactionAsync
MODIFY
WalletWasabi.Tests/Helpers/Common.cs
WalletWasabi.Tests/Helpers/Common.cs
@@ -37,5 +37,13 @@ namespace WalletWasabi.Tests.Helpers
{
return Path.Combine(DataDir, EnvironmentHelpers.ExtractFileName(callerFilePath), callerMemberName);
}
+
+ public static IEnumerable<TResult> Repeat<TResult>(Func<TResult> action, int count)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ yield return action();
+ }
+ }
}
}

MODIFY
WalletWasabi.Tests/UnitTests/BlockchainAnalysis/PubKeyReuseAnonScoreTests.cs
WalletWasabi.Tests/UnitTests/BlockchainAnalysis/PubKeyReuseAnonScoreTests.cs
@@ -183,7 +183,7 @@ namespace WalletWasabi.Tests.UnitTests.BlockchainAnalysis
var reusedTxOut = new TxOut(equalOutputAmount, new Key());
var tx = BitcoinFactory.CreateSmartTransaction(
9,
- Repeat(() => new TxOut(equalOutputAmount, new Key()), 7).Concat(new[] { reusedTxOut, reusedTxOut }),
+ Common.Repeat(() => new TxOut(equalOutputAmount, new Key()), 7).Concat(new[] { reusedTxOut, reusedTxOut }),
new[] { (Money.Coins(1.1m), 1, BitcoinFactory.CreateHdPubKey(km)) },
new[] { (equalOutputAmount, HdPubKey.DefaultHighAnonymitySet, BitcoinFactory.CreateHdPubKey(km)) });
@@ -194,13 +194,5 @@ namespace WalletWasabi.Tests.UnitTests.BlockchainAnalysis
// Normally it'd be 10, but because of reuse it should be only 8.
Assert.Equal(8, tx.WalletOutputs.First().HdPubKey.AnonymitySet);
}
-
- public IEnumerable<TResult> Repeat<TResult>(Func<TResult> action, int count)
- {
- for (int i = 0; i < count; i++)
- {
- yield return action();
- }
- }
}
}

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
@@ -712,8 +712,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
tx.Version = 1;
tx.LockTime = LockTime.Zero;
tx.Outputs.Add(amount, keys.Skip(1).First().P2wpkhScript);
- var txOut = new TxOut(Money.Coins(0.1m), BitcoinFactory.CreateScript());
- tx.Outputs.AddRange(Enumerable.Repeat(txOut, 5)); // 6 indistinguishable txouts
+ tx.Outputs.AddRange(Common.Repeat(() => new TxOut(Money.Coins(0.1m), BitcoinFactory.CreateScript()), 5)); // 6 indistinguishable txouts
tx.Inputs.Add(createdCoin.Outpoint, Script.Empty, WitScript.Empty);
tx.Inputs.AddRange(Enumerable.Repeat(new TxIn(GetRandomOutPoint(), Script.Empty), 4));

Fix ReceiveWasabiCoinJoinTransactionAsync