moar refactoring
MODIFY
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
@@ -1052,8 +1052,7 @@ namespace WalletWasabi.Tests.RegressionTests
}
FeeRate feeRateTx = finalCoinjoin.GetFeeRate(coins.ToArray());
- var esr = await rpc.EstimateSmartFeeAsync(roundConfig.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true);
- FeeRate feeRateReal = esr.FeeRate;
+ FeeRate feeRateReal = (await rpc.EstimateSmartFeeAsync(roundConfig.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true)).FeeRate;
Assert.True(feeRateReal.FeePerK - feeRateReal.FeePerK / 2 < feeRateTx.FeePerK); // Max 50% mistake.
Assert.True(2 * feeRateReal.FeePerK > feeRateTx.FeePerK); // Max 200% mistake.

MODIFY
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -819,9 +819,7 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
}
// 7.2. Get the most optimal FeeRate.
- EstimateSmartFeeResponse estimateSmartFeeResponse = await RpcClient.EstimateSmartFeeAsync(AdjustedConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false);
-
- FeeRate optimalFeeRate = estimateSmartFeeResponse.FeeRate;
+ FeeRate optimalFeeRate = (await RpcClient.EstimateSmartFeeAsync(AdjustedConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false)).FeeRate;
if (optimalFeeRate is null || optimalFeeRate == FeeRate.Zero || currentFeeRate is null || currentFeeRate == FeeRate.Zero) // This would be really strange if it'd happen.
{
@@ -894,8 +892,7 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
var outputSizeInBytes = Constants.OutputSizeInBytes;
try
{
- var estimateSmartFeeResponse = await rpc.EstimateSmartFeeAsync(confirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false);
- var feeRate = estimateSmartFeeResponse.FeeRate;
+ var feeRate = (await rpc.EstimateSmartFeeAsync(confirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false)).FeeRate;
// Make sure min relay fee (1000 sat) is hit.
feePerInputs = Math.Max(feeRate.GetFee(inputSizeInBytes), Money.Satoshis(500));

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -242,9 +242,9 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
{
if (!Rounds.Values.Any(x => !x.IsBlameRound && x.Phase == Phase.InputRegistration))
{
- var estimateSmartFeeResponse = await Rpc.EstimateSmartFeeAsync((int)Config.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false);
+ var feeRate = (await Rpc.EstimateSmartFeeAsync((int)Config.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true).ConfigureAwait(false)).FeeRate;
- RoundParameters roundParams = new(Config, Network, Random, estimateSmartFeeResponse.FeeRate);
+ RoundParameters roundParams = new(Config, Network, Random, feeRate);
Round r = new(roundParams);
Rounds.Add(r.Id, r);
}

moar refactoring