< Summary - Combined Code Coverage

Line coverage
0%
Covered lines: 0
Uncovered lines: 344
Coverable lines: 344
Total lines: 399
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%210%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Persistence.Sqlite/Migrations/20250606153444_Initial.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace NLightning.Infrastructure.Persistence.Sqlite.Migrations
 6{
 7    /// <inheritdoc />
 8    public partial class Initial : Migration
 9    {
 10        /// <inheritdoc />
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 013            migrationBuilder.CreateTable(
 014                name: "Channels",
 015                columns: table => new
 016                {
 017                    ChannelId = table.Column<byte[]>(type: "BLOB", nullable: false),
 018                    FundingCreatedAtBlockHeight = table.Column<uint>(type: "INTEGER", nullable: false),
 019                    FundingTxId = table.Column<byte[]>(type: "BLOB", nullable: false),
 020                    FundingOutputIndex = table.Column<uint>(type: "INTEGER", nullable: false),
 021                    FundingAmountSatoshis = table.Column<long>(type: "INTEGER", nullable: false),
 022                    IsInitiator = table.Column<bool>(type: "INTEGER", nullable: false),
 023                    RemoteNodeId = table.Column<byte[]>(type: "BLOB", nullable: false),
 024                    LocalNextHtlcId = table.Column<ulong>(type: "INTEGER", nullable: false),
 025                    RemoteNextHtlcId = table.Column<ulong>(type: "INTEGER", nullable: false),
 026                    LocalRevocationNumber = table.Column<ulong>(type: "INTEGER", nullable: false),
 027                    RemoteRevocationNumber = table.Column<ulong>(type: "INTEGER", nullable: false),
 028                    LastSentSignature = table.Column<byte[]>(type: "BLOB", nullable: true),
 029                    LastReceivedSignature = table.Column<byte[]>(type: "BLOB", nullable: true),
 030                    State = table.Column<byte>(type: "INTEGER", nullable: false),
 031                    Version = table.Column<byte>(type: "INTEGER", nullable: false),
 032                    LocalBalanceSatoshis = table.Column<decimal>(type: "TEXT", nullable: false),
 033                    RemoteBalanceSatoshis = table.Column<decimal>(type: "TEXT", nullable: false)
 034                },
 035                constraints: table =>
 036                {
 037                    table.PrimaryKey("PK_Channels", x => x.ChannelId);
 038                });
 39
 040            migrationBuilder.CreateTable(
 041                name: "ChannelConfigs",
 042                columns: table => new
 043                {
 044                    ChannelId = table.Column<byte[]>(type: "BLOB", nullable: false),
 045                    MinimumDepth = table.Column<uint>(type: "INTEGER", nullable: false),
 046                    ToSelfDelay = table.Column<ushort>(type: "INTEGER", nullable: false),
 047                    MaxAcceptedHtlcs = table.Column<ushort>(type: "INTEGER", nullable: false),
 048                    LocalDustLimitAmountSats = table.Column<long>(type: "INTEGER", nullable: false),
 049                    RemoteDustLimitAmountSats = table.Column<long>(type: "INTEGER", nullable: false),
 050                    HtlcMinimumMsat = table.Column<ulong>(type: "INTEGER", nullable: false),
 051                    ChannelReserveAmountSats = table.Column<long>(type: "INTEGER", nullable: true),
 052                    MaxHtlcAmountInFlight = table.Column<ulong>(type: "INTEGER", nullable: false),
 053                    FeeRatePerKwSatoshis = table.Column<long>(type: "INTEGER", nullable: false),
 054                    OptionAnchorOutputs = table.Column<bool>(type: "INTEGER", nullable: false),
 055                    LocalUpfrontShutdownScript = table.Column<byte[]>(type: "BLOB", nullable: true),
 056                    RemoteUpfrontShutdownScript = table.Column<byte[]>(type: "BLOB", nullable: true),
 057                    UseScidAlias = table.Column<byte>(type: "INTEGER", nullable: false)
 058                },
 059                constraints: table =>
 060                {
 061                    table.PrimaryKey("PK_ChannelConfigs", x => x.ChannelId);
 062                    table.ForeignKey(
 063                        name: "FK_ChannelConfigs_Channels_ChannelId",
 064                        column: x => x.ChannelId,
 065                        principalTable: "Channels",
 066                        principalColumn: "ChannelId",
 067                        onDelete: ReferentialAction.Cascade);
 068                });
 69
 070            migrationBuilder.CreateTable(
 071                name: "ChannelKeySets",
 072                columns: table => new
 073                {
 074                    ChannelId = table.Column<byte[]>(type: "BLOB", nullable: false),
 075                    IsLocal = table.Column<bool>(type: "INTEGER", nullable: false),
 076                    FundingPubKey = table.Column<byte[]>(type: "BLOB", nullable: false),
 077                    RevocationBasepoint = table.Column<byte[]>(type: "BLOB", nullable: false),
 078                    PaymentBasepoint = table.Column<byte[]>(type: "BLOB", nullable: false),
 079                    DelayedPaymentBasepoint = table.Column<byte[]>(type: "BLOB", nullable: false),
 080                    HtlcBasepoint = table.Column<byte[]>(type: "BLOB", nullable: false),
 081                    CurrentPerCommitmentIndex = table.Column<ulong>(type: "INTEGER", nullable: false),
 082                    CurrentPerCommitmentPoint = table.Column<byte[]>(type: "BLOB", nullable: false),
 083                    LastRevealedPerCommitmentSecret = table.Column<byte[]>(type: "BLOB", nullable: true),
 084                    KeyIndex = table.Column<uint>(type: "INTEGER", nullable: false)
 085                },
 086                constraints: table =>
 087                {
 088                    table.PrimaryKey("PK_ChannelKeySets", x => new { x.ChannelId, x.IsLocal });
 089                    table.ForeignKey(
 090                        name: "FK_ChannelKeySets_Channels_ChannelId",
 091                        column: x => x.ChannelId,
 092                        principalTable: "Channels",
 093                        principalColumn: "ChannelId",
 094                        onDelete: ReferentialAction.Cascade);
 095                });
 96
 097            migrationBuilder.CreateTable(
 098                name: "Htlcs",
 099                columns: table => new
 0100                {
 0101                    ChannelId = table.Column<byte[]>(type: "BLOB", nullable: false),
 0102                    HtlcId = table.Column<ulong>(type: "INTEGER", nullable: false),
 0103                    Direction = table.Column<byte>(type: "INTEGER", nullable: false),
 0104                    AmountMsat = table.Column<ulong>(type: "INTEGER", nullable: false),
 0105                    PaymentHash = table.Column<byte[]>(type: "BLOB", nullable: false),
 0106                    PaymentPreimage = table.Column<byte[]>(type: "BLOB", nullable: true),
 0107                    CltvExpiry = table.Column<uint>(type: "INTEGER", nullable: false),
 0108                    State = table.Column<byte>(type: "INTEGER", nullable: false),
 0109                    ObscuredCommitmentNumber = table.Column<ulong>(type: "INTEGER", nullable: false),
 0110                    AddMessageBytes = table.Column<byte[]>(type: "BLOB", nullable: false),
 0111                    Signature = table.Column<byte[]>(type: "BLOB", nullable: true)
 0112                },
 0113                constraints: table =>
 0114                {
 0115                    table.PrimaryKey("PK_Htlcs", x => new { x.ChannelId, x.HtlcId, x.Direction });
 0116                    table.ForeignKey(
 0117                        name: "FK_Htlcs_Channels_ChannelId",
 0118                        column: x => x.ChannelId,
 0119                        principalTable: "Channels",
 0120                        principalColumn: "ChannelId",
 0121                        onDelete: ReferentialAction.Cascade);
 0122                });
 0123        }
 124
 125        /// <inheritdoc />
 126        protected override void Down(MigrationBuilder migrationBuilder)
 127        {
 0128            migrationBuilder.DropTable(
 0129                name: "ChannelConfigs");
 130
 0131            migrationBuilder.DropTable(
 0132                name: "ChannelKeySets");
 133
 0134            migrationBuilder.DropTable(
 0135                name: "Htlcs");
 136
 0137            migrationBuilder.DropTable(
 0138                name: "Channels");
 0139        }
 140    }
 141}

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Persistence.Sqlite/Migrations/20250606153444_Initial.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Microsoft.EntityFrameworkCore;
 4using Microsoft.EntityFrameworkCore.Infrastructure;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 7using NLightning.Infrastructure.Persistence.Contexts;
 8
 9#nullable disable
 10
 11namespace NLightning.Infrastructure.Persistence.Sqlite.Migrations
 12{
 13    [DbContext(typeof(NLightningDbContext))]
 14    [Migration("20250606153444_Initial")]
 15    partial class Initial
 16    {
 17        /// <inheritdoc />
 18        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 19        {
 20#pragma warning disable 612, 618
 021            modelBuilder.HasAnnotation("ProductVersion", "8.0.12");
 22
 023            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", b =>
 024                {
 025                    b.Property<byte[]>("ChannelId")
 026                        .HasColumnType("BLOB");
 027
 028                    b.Property<long?>("ChannelReserveAmountSats")
 029                        .HasColumnType("INTEGER");
 030
 031                    b.Property<long>("FeeRatePerKwSatoshis")
 032                        .HasColumnType("INTEGER");
 033
 034                    b.Property<ulong>("HtlcMinimumMsat")
 035                        .HasColumnType("INTEGER");
 036
 037                    b.Property<long>("LocalDustLimitAmountSats")
 038                        .HasColumnType("INTEGER");
 039
 040                    b.Property<byte[]>("LocalUpfrontShutdownScript")
 041                        .HasColumnType("BLOB");
 042
 043                    b.Property<ushort>("MaxAcceptedHtlcs")
 044                        .HasColumnType("INTEGER");
 045
 046                    b.Property<ulong>("MaxHtlcAmountInFlight")
 047                        .HasColumnType("INTEGER");
 048
 049                    b.Property<uint>("MinimumDepth")
 050                        .HasColumnType("INTEGER");
 051
 052                    b.Property<bool>("OptionAnchorOutputs")
 053                        .HasColumnType("INTEGER");
 054
 055                    b.Property<long>("RemoteDustLimitAmountSats")
 056                        .HasColumnType("INTEGER");
 057
 058                    b.Property<byte[]>("RemoteUpfrontShutdownScript")
 059                        .HasColumnType("BLOB");
 060
 061                    b.Property<ushort>("ToSelfDelay")
 062                        .HasColumnType("INTEGER");
 063
 064                    b.Property<byte>("UseScidAlias")
 065                        .HasColumnType("INTEGER");
 066
 067                    b.HasKey("ChannelId");
 068
 069                    b.ToTable("ChannelConfigs");
 070                });
 71
 072            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", b =>
 073                {
 074                    b.Property<byte[]>("ChannelId")
 075                        .HasColumnType("BLOB");
 076
 077                    b.Property<long>("FundingAmountSatoshis")
 078                        .HasColumnType("INTEGER");
 079
 080                    b.Property<uint>("FundingCreatedAtBlockHeight")
 081                        .HasColumnType("INTEGER");
 082
 083                    b.Property<uint>("FundingOutputIndex")
 084                        .HasColumnType("INTEGER");
 085
 086                    b.Property<byte[]>("FundingTxId")
 087                        .IsRequired()
 088                        .HasColumnType("BLOB");
 089
 090                    b.Property<bool>("IsInitiator")
 091                        .HasColumnType("INTEGER");
 092
 093                    b.Property<byte[]>("LastReceivedSignature")
 094                        .HasColumnType("BLOB");
 095
 096                    b.Property<byte[]>("LastSentSignature")
 097                        .HasColumnType("BLOB");
 098
 099                    b.Property<decimal>("LocalBalanceSatoshis")
 0100                        .HasColumnType("TEXT");
 0101
 0102                    b.Property<ulong>("LocalNextHtlcId")
 0103                        .HasColumnType("INTEGER");
 0104
 0105                    b.Property<ulong>("LocalRevocationNumber")
 0106                        .HasColumnType("INTEGER");
 0107
 0108                    b.Property<decimal>("RemoteBalanceSatoshis")
 0109                        .HasColumnType("TEXT");
 0110
 0111                    b.Property<ulong>("RemoteNextHtlcId")
 0112                        .HasColumnType("INTEGER");
 0113
 0114                    b.Property<byte[]>("RemoteNodeId")
 0115                        .IsRequired()
 0116                        .HasColumnType("BLOB");
 0117
 0118                    b.Property<ulong>("RemoteRevocationNumber")
 0119                        .HasColumnType("INTEGER");
 0120
 0121                    b.Property<byte>("State")
 0122                        .HasColumnType("INTEGER");
 0123
 0124                    b.Property<byte>("Version")
 0125                        .HasColumnType("INTEGER");
 0126
 0127                    b.HasKey("ChannelId");
 0128
 0129                    b.ToTable("Channels");
 0130                });
 131
 0132            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelKeySetEntity", b =>
 0133                {
 0134                    b.Property<byte[]>("ChannelId")
 0135                        .HasColumnType("BLOB");
 0136
 0137                    b.Property<bool>("IsLocal")
 0138                        .HasColumnType("INTEGER");
 0139
 0140                    b.Property<ulong>("CurrentPerCommitmentIndex")
 0141                        .HasColumnType("INTEGER");
 0142
 0143                    b.Property<byte[]>("CurrentPerCommitmentPoint")
 0144                        .IsRequired()
 0145                        .HasColumnType("BLOB");
 0146
 0147                    b.Property<byte[]>("DelayedPaymentBasepoint")
 0148                        .IsRequired()
 0149                        .HasColumnType("BLOB");
 0150
 0151                    b.Property<byte[]>("FundingPubKey")
 0152                        .IsRequired()
 0153                        .HasColumnType("BLOB");
 0154
 0155                    b.Property<byte[]>("HtlcBasepoint")
 0156                        .IsRequired()
 0157                        .HasColumnType("BLOB");
 0158
 0159                    b.Property<uint>("KeyIndex")
 0160                        .HasColumnType("INTEGER");
 0161
 0162                    b.Property<byte[]>("LastRevealedPerCommitmentSecret")
 0163                        .HasColumnType("BLOB");
 0164
 0165                    b.Property<byte[]>("PaymentBasepoint")
 0166                        .IsRequired()
 0167                        .HasColumnType("BLOB");
 0168
 0169                    b.Property<byte[]>("RevocationBasepoint")
 0170                        .IsRequired()
 0171                        .HasColumnType("BLOB");
 0172
 0173                    b.HasKey("ChannelId", "IsLocal");
 0174
 0175                    b.ToTable("ChannelKeySets");
 0176                });
 177
 0178            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.HtlcEntity", b =>
 0179                {
 0180                    b.Property<byte[]>("ChannelId")
 0181                        .HasColumnType("BLOB");
 0182
 0183                    b.Property<ulong>("HtlcId")
 0184                        .HasColumnType("INTEGER");
 0185
 0186                    b.Property<byte>("Direction")
 0187                        .HasColumnType("INTEGER");
 0188
 0189                    b.Property<byte[]>("AddMessageBytes")
 0190                        .IsRequired()
 0191                        .HasColumnType("BLOB");
 0192
 0193                    b.Property<ulong>("AmountMsat")
 0194                        .HasColumnType("INTEGER");
 0195
 0196                    b.Property<uint>("CltvExpiry")
 0197                        .HasColumnType("INTEGER");
 0198
 0199                    b.Property<ulong>("ObscuredCommitmentNumber")
 0200                        .HasColumnType("INTEGER");
 0201
 0202                    b.Property<byte[]>("PaymentHash")
 0203                        .IsRequired()
 0204                        .HasColumnType("BLOB");
 0205
 0206                    b.Property<byte[]>("PaymentPreimage")
 0207                        .HasColumnType("BLOB");
 0208
 0209                    b.Property<byte[]>("Signature")
 0210                        .HasColumnType("BLOB");
 0211
 0212                    b.Property<byte>("State")
 0213                        .HasColumnType("INTEGER");
 0214
 0215                    b.HasKey("ChannelId", "HtlcId", "Direction");
 0216
 0217                    b.ToTable("Htlcs");
 0218                });
 219
 0220            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", b =>
 0221                {
 0222                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null)
 0223                        .WithOne("Config")
 0224                        .HasForeignKey("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", "ChannelId"
 0225                        .OnDelete(DeleteBehavior.Cascade)
 0226                        .IsRequired();
 0227                });
 228
 0229            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelKeySetEntity", b =>
 0230                {
 0231                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null)
 0232                        .WithMany("KeySets")
 0233                        .HasForeignKey("ChannelId")
 0234                        .OnDelete(DeleteBehavior.Cascade)
 0235                        .IsRequired();
 0236                });
 237
 0238            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.HtlcEntity", b =>
 0239                {
 0240                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null)
 0241                        .WithMany("Htlcs")
 0242                        .HasForeignKey("ChannelId")
 0243                        .OnDelete(DeleteBehavior.Cascade)
 0244                        .IsRequired();
 0245                });
 246
 0247            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", b =>
 0248                {
 0249                    b.Navigation("Config");
 0250
 0251                    b.Navigation("Htlcs");
 0252
 0253                    b.Navigation("KeySets");
 0254                });
 255#pragma warning restore 612, 618
 0256        }
 257    }
 258}