File tree Expand file tree Collapse file tree 4 files changed +15
-24
lines changed
src/DotNetLightning.Core/Serialize/Msgs
DotNetLightning.Core.Tests
DotNetLightning.Infrastructure.Tests Expand file tree Collapse file tree 4 files changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,24 @@ jobs:
19
19
# we want to run only once.
20
20
if : startsWith(matrix.os, 'ubuntu-18')
21
21
run : |
22
- dotnet test tests/DotNetLightning.Core.Tests -p:BouncyCastle=True
22
+ dotnet build tests/DotNetLightning.Core.Tests -p:BouncyCastle=True
23
+ dotnet run --project tests/DotNetLightning.Core.Tests
23
24
- name : Run Infrastructure tests on BouncyCastle
24
25
# we want to run only once.
25
26
if : startsWith(matrix.os, 'ubuntu-18')
26
27
run : |
27
- dotnet test tests/DotNetLightning.Infrastructure.Tests -p:BouncyCastle=True
28
+ dotnet build tests/DotNetLightning.Infrastructure.Tests -p:BouncyCastle=True
29
+ dotnet run --project tests/DotNetLightning.Infrastructure.Tests
28
30
29
31
- name : Clean to prepare for NSec build
30
32
run : |
31
33
dotnet clean
32
- - name : Run tests
34
+ - name : Run core tests
35
+ run : |
36
+ dotnet run --project tests/DotNetLightning.Core.Tests
37
+ - name : Run Infrastructure tests
38
+ run : |
39
+ dotnet run --project tests/DotNetLightning.Infrastructure.Tests
40
+ - name : Run other tests
33
41
run : |
34
42
dotnet test
Original file line number Diff line number Diff line change @@ -390,25 +390,10 @@ type Init =
390
390
this.Features <- oredFeatures |> FeatureBit.CreateUnsafe
391
391
this.TLVStream <- ls.ReadTLVStream() |> Array.map( InitTLV.FromGenericTLV)
392
392
member this.Serialize ( ls ) =
393
- // Trim any leading zero bytes from the from of the local features
394
- let localFeatures =
395
- let features = this.Features.ToByteArray()
396
- let startIndex =
397
- match Array.tryFindIndex ( fun ( b : byte ) -> b <> 0 uy) features with
398
- | Some index -> index
399
- | None -> features.Length
400
- features.[ startIndex..]
401
- // For legacy compatibility, the last (lowest) 13 bits get
402
- // duplicated in the globalFeatures array.
403
- let globalFeatures =
404
- if localFeatures.Length < 2 then
405
- localFeatures
406
- else
407
- let features = localFeatures.[( localFeatures.Length - 2 )..]
408
- features.[ 0 ] <- features.[ 0 ] &&& 0b00111111 uy
409
- features
410
- ls.WriteWithLen( globalFeatures)
411
- ls.WriteWithLen( localFeatures)
393
+ // For backwards compatibility reason, we must consider legacy `global features` section. (see bolt 1)
394
+ let g : byte [] = [||]
395
+ ls.WriteWithLen( g)
396
+ ls.WriteWithLen( this.Features.ToByteArray())
412
397
ls.WriteTLVStream( this.TLVStream |> Array.map( fun tlv -> tlv.ToGenericTLV()))
413
398
414
399
[<CLIMutable>]
Original file line number Diff line number Diff line change 36
36
<PackageReference Include =" Expecto.FsCheck" Version =" 8.10.1" />
37
37
<PackageReference Update =" FSharp.Core" Version =" 4.7.0" />
38
38
<PackageReference Include =" Microsoft.Extensions.Configuration.UserSecrets" Version =" 2.2.0" />
39
- <PackageReference Include =" YoloDev.Expecto.TestSdk" Version =" 0.*" />
40
39
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.*" />
41
40
</ItemGroup >
42
41
<ItemGroup >
Original file line number Diff line number Diff line change 24
24
<PackageReference Update =" FSharp.Core" Version =" 4.7.0" />
25
25
<PackageReference Include =" Microsoft.Extensions.Logging" Version =" 3.0.0" />
26
26
<PackageReference Include =" Microsoft.Extensions.Options" Version =" 3.0.0" />
27
- <PackageReference Include =" YoloDev.Expecto.TestSdk" Version =" 0.*" />
28
27
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.*" />
29
28
</ItemGroup >
30
29
You can’t perform that action at this time.
0 commit comments