diff --git a/Stratis.Bitcoin.Tests/RPC/Controller/GetInfoActionTests.cs b/Stratis.Bitcoin.Tests/RPC/Controller/GetInfoActionTests.cs index 82827772b63..17d5b552c49 100644 --- a/Stratis.Bitcoin.Tests/RPC/Controller/GetInfoActionTests.cs +++ b/Stratis.Bitcoin.Tests/RPC/Controller/GetInfoActionTests.cs @@ -13,33 +13,6 @@ namespace Stratis.Bitcoin.Tests.RPC.Controller { public class GetInfoActionTests : BaseRPCControllerTest { - [Fact] - public void CallWithoutDependencies() - { - var controller = new FullNodeController(); - - GetInfoModel info = controller.GetInfo(); - - Assert.NotNull(info); - Assert.NotNull(info.version); - Assert.NotNull(info.protocolversion); - Assert.NotNull(info.blocks); - Assert.NotNull(info.timeoffset); - Assert.Null(info.connections); - Assert.NotNull(info.proxy); - Assert.NotNull(info.difficulty); - Assert.NotNull(info.testnet); - Assert.NotNull(info.relayfee); - Assert.NotNull(info.errors); - Assert.Null(info.walletversion); - Assert.Null(info.balance); - Assert.Null(info.keypoololdest); - Assert.Null(info.keypoolsize); - Assert.Null(info.unlocked_until); - Assert.Null(info.paytxfee); - - } - [Fact] public void CallWithDependencies() { diff --git a/Stratis.Bitcoin/RPC/Controllers/FullNodeController.cs b/Stratis.Bitcoin/RPC/Controllers/FullNodeController.cs index bc5a468af7a..79309771317 100644 --- a/Stratis.Bitcoin/RPC/Controllers/FullNodeController.cs +++ b/Stratis.Bitcoin/RPC/Controllers/FullNodeController.cs @@ -85,7 +85,7 @@ public GetInfoModel GetInfo() connections = this._ConnectionManager?.ConnectedNodes?.Count(), proxy = string.Empty, difficulty = GetNetworkDifficulty()?.Difficulty ?? 0, - testnet = this._Network == NBitcoin.Network.TestNet, + testnet = this._Network.IsTest(), relayfee = MempoolValidator.MinRelayTxFee.FeePerK.ToUnit(MoneyUnit.BTC), errors = string.Empty, diff --git a/Stratis.Bitcoin/Utilities/NetworkExtensions.cs b/Stratis.Bitcoin/Utilities/NetworkExtensions.cs new file mode 100644 index 00000000000..38302f63aab --- /dev/null +++ b/Stratis.Bitcoin/Utilities/NetworkExtensions.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NBitcoin; + +namespace Stratis.Bitcoin.Utilities +{ + public static class NetworkExtensions + { + /// + /// Determines whether this network is a test network. + /// + /// The network. + /// + /// true if the specified network is test; otherwise, false. + /// + public static bool IsTest(this Network network) + { + return network.Name.ToLowerInvariant().Contains("test"); + } + } +}