change obsolate code
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -791,7 +791,7 @@ namespace WalletWasabi.Tests
Assert.Single(res2.OuterWalletOutputs);
Assert.Equal(scp, res2.OuterWalletOutputs.Single().ScriptPubKey);
Assert.Single(res2.InnerWalletOutputs);
- Assert.True(res2.Fee > new Money(2 * 100)); // since there is a sanity check of 2sat/vb in the server
+ Assert.True(res2.Fee > Money.Satoshis(2 * 100)); // since there is a sanity check of 2sat/vb in the server
Assert.InRange(res2.FeePercentOfSent, 0, 1);
Assert.Single(res2.SpentCoins);
Assert.Equal(key.GetP2wpkhScript(), res2.SpentCoins.Single().ScriptPubKey);
@@ -1222,13 +1222,13 @@ namespace WalletWasabi.Tests
// toSend negative sum amount
var operations = new[]{
- new WalletService.Operation(scp, -10000, "") };
+ new WalletService.Operation(scp, Money.Satoshis(-10000), "") };
Assert.Throws<ArgumentException>(() => wallet.BuildTransaction(null, operations, 2));
// toSend negative operation amount
operations = new[]{
- new WalletService.Operation(scp, 20000, ""),
- new WalletService.Operation(scp, -10000, "") };
+ new WalletService.Operation(scp, Money.Satoshis(20000), ""),
+ new WalletService.Operation(scp, Money.Satoshis(-10000), "") };
Assert.Throws<ArgumentException>(() => wallet.BuildTransaction(null, operations, 2));
// allowedInputs cannot be empty
@@ -2495,7 +2495,7 @@ namespace WalletWasabi.Tests
receiveSatoshi = 100000000;
}
BitcoinWitPubKeyAddress inputAddress = key.PubKey.GetSegwitAddress(network);
- uint256 txHash = await rpc.SendToAddressAsync(inputAddress, receiveSatoshi);
+ uint256 txHash = await rpc.SendToAddressAsync(inputAddress, Money.Satoshis(receiveSatoshi));
fundingTxCount++;
Assert.NotNull(txHash);
Transaction transaction = await rpc.GetRawTransactionAsync(txHash);
@@ -2695,7 +2695,7 @@ namespace WalletWasabi.Tests
receiveSatoshi = 100000000;
}
BitcoinWitPubKeyAddress inputAddress = key.PubKey.GetSegwitAddress(network);
- uint256 txHash = await rpc.SendToAddressAsync(inputAddress, receiveSatoshi);
+ uint256 txHash = await rpc.SendToAddressAsync(inputAddress, Money.Satoshis(receiveSatoshi));
fundingTxCount++;
Assert.NotNull(txHash);
Transaction transaction = await rpc.GetRawTransactionAsync(txHash);
@@ -2864,7 +2864,7 @@ namespace WalletWasabi.Tests
var activeOutput = finalCoinjoin.GetIndistinguishableOutputs(includeSingle: true).OrderByDescending(x => x.count).First();
Assert.True(activeOutput.value >= roundConfig.Denomination);
- Assert.True(activeOutput.value >= roundConfig.AnonymitySet);
+ Assert.True(activeOutput.count >= roundConfig.AnonymitySet);
foreach (var aliceClient in aliceClients)
{

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -666,7 +666,7 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
{
// 8.2 If the fee can be lowered, lower it.
// 8.2.1. How much fee can we save?
- Money feeShouldBePaid = new Money(estimatedFinalTxSize * (int)optimalFeeRate.SatoshiPerByte);
+ Money feeShouldBePaid = Money.Satoshis(estimatedFinalTxSize * (int)optimalFeeRate.SatoshiPerByte);
Money toSave = fee - feeShouldBePaid;
// 8.2.2. Get the outputs to divide the savings between.
@@ -716,19 +716,19 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
Money feePerBytes = (feeRate.FeePerK / 1000);
// Make sure min relay fee (1000 sat) is hit.
- feePerInputs = Math.Max(feePerBytes * inputSizeInBytes, new Money(500));
- feePerOutputs = Math.Max(feePerBytes * outputSizeInBytes, new Money(250));
+ feePerInputs = Math.Max(feePerBytes * inputSizeInBytes, Money.Satoshis(500));
+ feePerOutputs = Math.Max(feePerBytes * outputSizeInBytes, Money.Satoshis(250));
}
catch (Exception ex)
{
// If fee hasn't been initialized once, fall back.
if (feePerInputs is null || feePerOutputs is null)
{
- var feePerBytes = new Money(100); // 100 satoshi per byte
+ var feePerBytes = Money.Satoshis(100); // 100 satoshi per byte
// Make sure min relay fee (1000 sat) is hit.
- feePerInputs = Math.Max(feePerBytes * inputSizeInBytes, new Money(500));
- feePerOutputs = Math.Max(feePerBytes * outputSizeInBytes, new Money(250));
+ feePerInputs = Math.Max(feePerBytes * inputSizeInBytes, Money.Satoshis(500));
+ feePerOutputs = Math.Max(feePerBytes * outputSizeInBytes, Money.Satoshis(250));
}
Logger.LogError<CcjRound>(ex);

MODIFY
WalletWasabi/Services/CcjClient.cs
WalletWasabi/Services/CcjClient.cs
@@ -350,7 +350,7 @@ namespace WalletWasabi.Services
minAmountBack -= minimumChangeAmount; // Minus coordinator protections (so it won't create bad coinjoins.)
}
- if (amountBack < minAmountBack && !amountBack.Almost(minAmountBack, new Money(10000))) // I catched an issue here, probably rounding. 1000 dust should be enough to catch it, but let's do 10000, why not.
+ if (amountBack < minAmountBack && !amountBack.Almost(minAmountBack, Money.Satoshis(10000))) // I catched an issue here, probably rounding. 1000 dust should be enough to catch it, but let's do 10000, why not.
{
throw new NotSupportedException("Coordinator did not add enough value to our outputs in the coinjoin.");
}

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -1043,7 +1043,7 @@ namespace WalletWasabi.Services
if (realToSend[i].amount < Money.Zero)
{
- throw new InsufficientBalanceException(fee + 1, realToSend[i].amount + fee);
+ throw new InsufficientBalanceException(fee + Money.Satoshis(1), realToSend[i].amount + fee);
}
}

change obsolate code