Clean mistaken code
MODIFY
WalletWasabi.Tests/NodeBuilding/CoreNode.cs
WalletWasabi.Tests/NodeBuilding/CoreNode.cs
@@ -146,13 +146,13 @@ namespace WalletWasabi.Tests.NodeBuilding
private readonly object _l = new object();
- public async Task KillAsync(bool cleanFolder = true)
+ public void Kill(bool cleanFolder = true)
{
lock (_l)
{
try
{
- CreateRpcClient().SendCommand("stop");
+ CreateRpcClient().Stop();
}
catch(Exception)
{}

MODIFY
WalletWasabi.Tests/NodeBuilding/NodeBuilder.cs
WalletWasabi.Tests/NodeBuilding/NodeBuilder.cs
@@ -145,7 +145,7 @@ namespace WalletWasabi.Tests.NodeBuilding
try
{
var rpc = new RPCClient(credentials, new Uri("http://127.0.0.1:" + rpcPort + "/"), Network.RegTest);
- rpc.SendCommand("stop");
+ rpc.Stop();
var pidFile = Path.Combine(child, "data", "regtest", pidFileName);
if(File.Exists(pidFile))
@@ -199,7 +199,7 @@ namespace WalletWasabi.Tests.NodeBuilding
{
foreach (CoreNode node in Nodes)
{
- node.KillAsync().GetAwaiter().GetResult();
+ node.Kill();
}
foreach (IDisposable disposable in _disposables)

MODIFY
WalletWasabi.Tests/XunitConfiguration/RegTestFixture.cs
WalletWasabi.Tests/XunitConfiguration/RegTestFixture.cs
@@ -54,7 +54,7 @@ namespace WalletWasabi.Tests.XunitConfiguration
BackendHost?.StopAsync();
BackendHost?.Dispose();
- BackendRegTestNode?.KillAsync(cleanFolder: true).GetAwaiter().GetResult();
+ BackendRegTestNode?.Kill(cleanFolder: true);
BackendNodeBuilder?.Dispose();
}
}

MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
using NBitcoin.Crypto;
using NBitcoin.DataEncoders;
+using NBitcoin.RPC;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -203,5 +204,10 @@ namespace NBitcoin
return Encoders.Base58Check.EncodeData(version.Concat(data).ToArray());
}
+
+ public static void Stop(this RPCClient rpc)
+ {
+ rpc.SendCommand("stop");
+ }
}
}

Clean mistaken code