Skip to content

Commit

Permalink
Bump NBitcoin for the library
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Aug 30, 2021
1 parent a4f195c commit cfb626d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion QBitNinja.Client/PushNuget.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rm "bin\release\" -Recurse -Force
dotnet build /p:Configuration=Release
dotnet build /p:Configuration=Release /p:LIB_ONLY=true
dotnet pack --no-build --no-restore --configuration Release
dotnet nuget push "bin\Release\*.nupkg" --source "https://api.nuget.org/v3/index.json"
$ver = ((ls .\bin\release\*.nupkg -File)[0].Name -replace '([^\.\d]*\.)+(\d+(\.\d+){1,3}).nupkg', '$2')
Expand Down
7 changes: 6 additions & 1 deletion QBitNinja.Client/QBitNinja.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == 'net472'"></Reference>
</ItemGroup>
<PropertyGroup>
<LIB_ONLY Condition="'$(LIB_ONLY)' == ''">false</LIB_ONLY>
<DefineConstants Condition="'$(LIB_ONLY)' == 'true'">$(DefineConstants);LIB_ONLY</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NBitcoin" Version="5.0.27" />
<PackageReference Include="NBitcoin" Version="5.0.27" Condition="'$(LIB_ONLY)' == 'false'" />
<PackageReference Include="NBitcoin" Version="6.0.8" Condition="'$(LIB_ONLY)' == 'true'" />
<PackageReference Include="System.Net.Http">
<Version>4.3.3</Version>
<ExcludeAssets Condition=" '$(TargetFramework)' == 'net472' ">All</ExcludeAssets>
Expand Down
14 changes: 10 additions & 4 deletions QBitNinja/Models/WhatIsItModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public WhatIsScript()
{

}
#if !LIB_ONLY
public WhatIsScript(Script script, Network network)
{
Raw = script;
Expand All @@ -26,6 +27,7 @@ public WhatIsScript(Script script, Network network)
if(address != null)
Address = address.ToString();
}
#endif

public uint160 Hash160
{
Expand Down Expand Up @@ -64,6 +66,7 @@ public WhatIsPublicKey()
{

}
#if !LIB_ONLY
public WhatIsPublicKey(PubKey pubkey, Network network)
{
Hex = pubkey.ToHex();
Expand All @@ -75,7 +78,7 @@ public WhatIsPublicKey(PubKey pubkey, Network network)
ScriptPubKey = new WhatIsScript(pubkey.ScriptPubKey, network);
IsCompressed = pubkey.IsCompressed;
}

#endif
public string Hex
{
get;
Expand Down Expand Up @@ -133,12 +136,13 @@ public WhatIsPrivateKey()
{

}
#if !LIB_ONLY
public WhatIsPrivateKey(BitcoinSecret secret)
: base(secret)
{
PublicKey = new WhatIsPublicKey(secret.PrivateKey.PubKey, secret.Network);
}

#endif
public WhatIsPublicKey PublicKey
{
get;
Expand Down Expand Up @@ -320,6 +324,7 @@ public WhatIsAddress()
{

}
#if !LIB_ONLY
public WhatIsAddress(BitcoinAddress address)
: base(address)
{
Expand All @@ -330,7 +335,7 @@ public WhatIsAddress(BitcoinAddress address)
if(address is IBase58Data)
ColoredAddress = address.ToColoredAddress().ToString();
}

#endif
private string GetHash(BitcoinAddress address)
{
BitcoinPubKeyAddress pubkey = address as BitcoinPubKeyAddress;
Expand Down Expand Up @@ -432,7 +437,7 @@ public Network Network
get;
set;
}

#if !LIB_ONLY
public static WhatIsBase58 GetFromBitcoinString(string data)
{
try
Expand Down Expand Up @@ -479,5 +484,6 @@ public static WhatIsBase58 GetFromBitcoinString(string data)
catch(FormatException) { }
throw new FormatException("Not a base58 or bech32");
}
#endif
}
}

0 comments on commit cfb626d

Please sign in to comment.