This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from bokobza/master
Added Network extension method to check if the network is a test one
- Loading branch information
Showing
3 changed files
with
23 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using NBitcoin; | ||
|
||
namespace Stratis.Bitcoin.Utilities | ||
{ | ||
public static class NetworkExtensions | ||
{ | ||
/// <summary> | ||
/// Determines whether this network is a test network. | ||
/// </summary> | ||
/// <param name="network">The network.</param> | ||
/// <returns> | ||
/// <c>true</c> if the specified network is test; otherwise, <c>false</c>. | ||
/// </returns> | ||
public static bool IsTest(this Network network) | ||
{ | ||
return network.Name.ToLowerInvariant().Contains("test"); | ||
} | ||
} | ||
} |