Bring AllFeeEstimateAsync from RegTests to BitcoinCore unit tests.
MODIFY
WalletWasabi.Tests/IntegrationTests/RegTests.cs
WalletWasabi.Tests/IntegrationTests/RegTests.cs
@@ -225,28 +225,6 @@ namespace WalletWasabi.Tests.IntegrationTests
}
}
- [Fact]
- public async Task AllFeeEstimateRpcAsync()
- {
- (string password, RPCClient rpc, Network network, Coordinator coordinator, ServiceConfiguration serviceConfiguration, BitcoinStore bitcoinStore, Backend.Global global) = await InitializeTestEnvironmentAsync(1);
-
- var estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Conservative, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: true);
- Assert.Equal(Constants.OneDayConfirmationTarget, estimations.Estimations.Count);
- Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
- Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
- Assert.Equal(EstimateSmartFeeMode.Conservative, estimations.Type);
- estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Economical, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: true);
- Assert.Equal(145, estimations.Estimations.Count);
- Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
- Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
- Assert.Equal(EstimateSmartFeeMode.Economical, estimations.Type);
- estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Economical, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: false);
- Assert.Equal(145, estimations.Estimations.Count);
- Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
- Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
- Assert.Equal(EstimateSmartFeeMode.Economical, estimations.Type);
- }
-
#endregion BackendTests
#region ServicesTests

ADD
WalletWasabi.Tests/UnitTests/BitcoinCore/RpcTests.cs
+using NBitcoin.RPC;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WalletWasabi.Tests.NodeBuilding;
+using Xunit;
+
+namespace WalletWasabi.Tests.UnitTests.BitcoinCore
+{
+ public class RpcTests
+ {
+ [Fact]
+ public async Task AllFeeEstimateAsync()
+ {
+ var coreNode = await CoreNode.CreateAsync();
+ try
+ {
+ var rpc = coreNode.RpcClient;
+ var estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Conservative, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: true);
+ Assert.Equal(Helpers.Constants.OneDayConfirmationTarget, estimations.Estimations.Count);
+ Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
+ Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
+ Assert.Equal(EstimateSmartFeeMode.Conservative, estimations.Type);
+ estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Economical, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: true);
+ Assert.Equal(145, estimations.Estimations.Count);
+ Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
+ Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
+ Assert.Equal(EstimateSmartFeeMode.Economical, estimations.Type);
+ estimations = await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Economical, simulateIfRegTest: true, tolerateBitcoinCoreBrainfuck: false);
+ Assert.Equal(145, estimations.Estimations.Count);
+ Assert.True(estimations.Estimations.First().Key < estimations.Estimations.Last().Key);
+ Assert.True(estimations.Estimations.First().Value > estimations.Estimations.Last().Value);
+ Assert.Equal(EstimateSmartFeeMode.Economical, estimations.Type);
+ }
+ finally
+ {
+ await coreNode.StopAsync();
+ }
+ }
+ }
+}

Bring AllFeeEstimateAsync from RegTests to BitcoinCore unit tests.