Workaround NBitcoin's backwards incompatible change.
MODIFY
WalletWasabi.Tests/IntegrationTests/RegTests.cs
WalletWasabi.Tests/IntegrationTests/RegTests.cs
@@ -2373,19 +2373,12 @@ namespace WalletWasabi.Tests.IntegrationTests
var partSignedCj1 = Transaction.Parse(unsignedCoinJoin.ToHex(), network);
var partSignedCj2 = Transaction.Parse(unsignedCoinJoin.ToHex(), network);
- var builder = Network.RegTest.CreateTransactionBuilder();
- partSignedCj1 = builder
- .ContinueToBuild(partSignedCj1)
- .AddKeys(key1)
- .AddCoins(new Coin(tx1, input1.N))
- .BuildTransaction(true);
-
- builder = Network.RegTest.CreateTransactionBuilder();
- partSignedCj2 = builder
- .ContinueToBuild(partSignedCj2)
- .AddKeys(key2)
- .AddCoins(new Coin(tx2, input2.N))
- .BuildTransaction(true);
+ partSignedCj1.Sign(
+ key1.GetBitcoinSecret(network),
+ new Coin(tx1, input1.N));
+ partSignedCj2.Sign(
+ key2.GetBitcoinSecret(network),
+ new Coin(tx2, input2.N));
var myDic1 = new Dictionary<int, WitScript>();
var myDic2 = new Dictionary<int, WitScript>();
@@ -2546,12 +2539,10 @@ namespace WalletWasabi.Tests.IntegrationTests
}
// Sign the transaction
- var builder = Network.RegTest.CreateTransactionBuilder();
- var partSignedCj = builder
- .ContinueToBuild(unsignedTransaction)
- .AddKeys(inputs.Select(x => x.key).ToArray())
- .AddCoins(inputs.Select(x => x.coin))
- .BuildTransaction(true);
+ var partSignedCj = unsignedTransaction.Clone();
+ partSignedCj.Sign(
+ inputs.Select(x => x.key.GetBitcoinSecret(network)),
+ inputs.Select(x => x.coin));
var witnesses = partSignedCj.Inputs
.AsIndexedInputs()
@@ -3014,11 +3005,9 @@ namespace WalletWasabi.Tests.IntegrationTests
foreach (var user in users)
{
var partSignedCj = Transaction.Parse(unsignedCoinJoin.ToHex(), network);
- partSignedCj = Network.RegTest.CreateTransactionBuilder()
- .ContinueToBuild(partSignedCj)
- .AddKeys(user.userInputData.Select(x => x.key).ToArray())
- .AddCoins(user.userInputData.Select(x => new Coin(x.tx, x.input.N)).ToArray())
- .BuildTransaction(true);
+ partSignedCj.Sign(
+ user.userInputData.Select(x => x.key.GetBitcoinSecret(network)),
+ user.userInputData.Select(x => new Coin(x.tx, x.input.N)));
var myDic = new Dictionary<int, WitScript>();

MODIFY
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -402,12 +402,14 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
transaction.Outputs.AddWithOptimize(coordinatorFee, coordinatorAddress);
}
+ // https://github.com/zkSNACKs/WalletWasabi/pull/2899#issuecomment-569039237
// 7. Create the unsigned transaction.
- var builder = Network.CreateTransactionBuilder();
- UnsignedCoinJoin = builder
- .ContinueToBuild(transaction)
- .AddCoins(spentCoins) // It makes sure the UnsignedCoinJoin goes through TransactionBuilder optimizations.
- .BuildTransaction(false);
+ UnsignedCoinJoin = transaction.Clone();
+ //var builder = Network.CreateTransactionBuilder();
+ //UnsignedCoinJoin = builder
+ // .ContinueToBuild(transaction)
+ // .AddCoins(spentCoins) // It makes sure the UnsignedCoinJoin goes through TransactionBuilder optimizations.
+ // .BuildTransaction(false);
// 8. Try optimize fees.
await TryOptimizeFeesAsync(spentCoins).ConfigureAwait(false);

Workaround NBitcoin's backwards incompatible change.