Skip to content

Commit

Permalink
Nlitecoin: update NBitcoin to 7.0.13
Browse files Browse the repository at this point in the history
Update NBitcoin to version 7.0.13 because older NBitcoin
versions can't decode bech32 strings of length > 90, which is
needed for MimbleWimble address decoding.
  • Loading branch information
webwarrior-ws committed Oct 12, 2023
1 parent 9d2f40e commit 19aec38
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/NLitecoin/Litecoin.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type internal Witness(inputs: TxInList) =
| null -> WitScript.Empty
| witScript -> witScript
script.ToBytes()
stream.ReadWrite(ref bytes)
stream.ReadWrite bytes
else
input.WitScript <- WitScript.Load stream

Expand Down
12 changes: 6 additions & 6 deletions src/NLitecoin/MimbleWimble/Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module Helpers =
let writeByteArray (stream: BitcoinStream) (arr: array<byte>) =
let len = uint64 arr.Length
VarInt.StaticWrite(stream, len)
stream.ReadWrite(ref arr)
stream.ReadWrite arr

let readCAmount (stream: BitcoinStream) : CAmount =
let amountRef = ref 0UL
Expand Down Expand Up @@ -173,14 +173,14 @@ type BigInt(bytes: array<byte>) =

static member Read(stream: BitcoinStream) (numBytes: int) : BigInt =
assert(not stream.Serializing)
let result : ref<array<uint8>> = Array.zeroCreate numBytes |> ref
let result : array<uint8> = Array.zeroCreate numBytes
stream.ReadWrite result
BigInt result.Value
BigInt result

interface ISerializeable with
member self.Write(stream) =
assert(stream.Serializing)
stream.ReadWrite (self.Data |> ref)
stream.ReadWrite self.Data

type PedersenCommitment =
| PedersenCommitment of BigInt
Expand Down Expand Up @@ -386,7 +386,7 @@ type RangeProof =
static member Read(stream: BitcoinStream) : RangeProof =
assert(not stream.Serializing)
let bytes = Array.zeroCreate<byte> RangeProof.Size
stream.ReadWrite(ref bytes)
stream.ReadWrite bytes
RangeProof bytes

interface ISerializeable with
Expand All @@ -395,7 +395,7 @@ type RangeProof =
match self with
| RangeProof bytes ->
assert(bytes.Length = RangeProof.Size)
stream.ReadWrite(ref bytes)
stream.ReadWrite bytes

type StealthAddress =
{
Expand Down
2 changes: 1 addition & 1 deletion src/NLitecoin/NLitecoin.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />
<PackageReference Include="NBitcoin" Version="6.0.17" />
<PackageReference Include="NBitcoin" Version="7.0.31" />
<PackageReference Include="NBitcoin.Secp256k1" Version="3.1.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/NLitecoin.Tests/NLitecoin.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="NBitcoin" Version="6.0.17" />
<PackageReference Include="NBitcoin" Version="7.0.31" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
Expand Down

0 comments on commit 19aec38

Please sign in to comment.