Make BitcoinFactory more feature complete
MODIFY
WalletWasabi.Tests/Helpers/BitcoinFactory.cs
WalletWasabi.Tests/Helpers/BitcoinFactory.cs
@@ -31,25 +31,23 @@ public static class BitcoinFactory
var tx = Transaction.Create(Network.Main);
var walletInputs = new HashSet<SmartCoin>();
var walletOutputs = new HashSet<SmartCoin>();
-
for (int i = 0; i < othersInputCount; i++)
{
tx.Inputs.Add(CreateOutPoint());
}
- var idx = (uint)othersInputCount - 1;
+
foreach (var (value, anonset, hdpk) in ownInputs)
{
- idx++;
- var sc = CreateSmartCoin(hdpk, value, idx, anonymitySet: anonset);
+ var sc = CreateSmartCoin(hdpk, value, anonymitySet: anonset);
tx.Inputs.Add(sc.OutPoint);
walletInputs.Add(sc);
}
-
foreach (var output in othersOutputs)
{
tx.Outputs.Add(output);
}
- idx = (uint)othersOutputs.Count() - 1;
+
+ var idx = (uint)othersOutputs.Count() - 1;
foreach (var txo in ownOutputs)
{
idx++;
@@ -58,19 +56,15 @@ public static class BitcoinFactory
var sc = new SmartCoin(new SmartTransaction(tx, Height.Mempool), idx, hdpk);
walletOutputs.Add(sc);
}
-
var stx = new SmartTransaction(tx, Height.Mempool);
-
foreach (var sc in walletInputs)
{
stx.WalletInputs.Add(sc);
}
-
foreach (var sc in walletOutputs)
{
stx.WalletOutputs.Add(sc);
}
-
return stx;
}

Make BitcoinFactory more feature complete