< Summary - Combined Code Coverage

Information
Class: NLightning.Tests.Utils.Vectors.Bolt3AppendixCVectors
Assembly: NLightning.Tests.Utils
File(s): /home/runner/work/nlightning/nlightning/test/NLightning.Tests.Utils/Vectors/Bolt3AppendixCVectors.cs
Tag: 36_15743069263
Line coverage
100%
Covered lines: 208
Uncovered lines: 0
Coverable lines: 208
Total lines: 303
Line coverage: 100%
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
.cctor()100%11100%

File(s)

/home/runner/work/nlightning/nlightning/test/NLightning.Tests.Utils/Vectors/Bolt3AppendixCVectors.cs

#LineLine coverage
 1using NBitcoin;
 2using NBitcoin.Crypto;
 3
 4namespace NLightning.Tests.Utils.Vectors;
 5
 6using Domain.Crypto.Constants;
 7using Domain.Enums;
 8using Domain.Money;
 9using Infrastructure.Crypto.Hashes;
 10
 11public static class Bolt3AppendixCVectors
 12{
 1213    public static readonly Key NodeAFundingPrivkey =
 1214        new(Convert.FromHexString("30ff4956bbdd3222d44cc5e8a1261dab1e07957bdac5ae88fe3261ef321f3749"));
 15
 1216    public static readonly PubKey NodeAFundingPubkey =
 1217        new("023da092f6980e58d2c037173180e9a465476026ee50f96695963e8efe436f54eb");
 18
 1219    public static readonly PubKey NodeAPaymentBasepoint =
 1220        new("034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa");
 21
 1222    public static readonly PubKey NodeAHtlcBasepoint = NodeAPaymentBasepoint;
 23
 1224    public static readonly Key NodeAPrivkey =
 1225        new(Convert.FromHexString("bb13b121cdc357cd2e608b0aea294afca36e2b34cf958e2e6451a2f274694491"));
 26
 1227    public static readonly PubKey NodeAHtlcPubkey =
 1228        new("030d417a46946384f88d5f3337267c5e579765875dc4daca813e21734b140639e7");
 29
 1230    public static readonly PubKey NodeADelayedPubkey =
 1231        new("03fd5960528dc152014952efdb702a88f71e3c1653b2314431701ec77e57fde83c");
 32
 1233    public static readonly PubKey NodeARevocationPubkey =
 1234        new("0212a140cd0c6539d07cd08dfe09984dec3251ea808b892efeac3ede9402bf2b19");
 35
 1236    public static readonly PubKey NodeBPaymentBasepoint =
 1237        new("032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991");
 38
 1239    public static readonly PubKey NodeBHtlcBasepoint = NodeBPaymentBasepoint;
 40
 1241    public static readonly PubKey NodeBFundingPubkey =
 1242        new("030e9f7b623d2ccc7c9bd44d66d5ce21ce504c0acf6385a132cec6d3c39fa711c1");
 43
 1244    public static readonly PubKey NodeBHtlcPubkey =
 1245        new("0394854aa6eab5b2a8122cc726e9dded053a2184d88256816826d6231c068d4a5b");
 46
 1247    public static readonly ECDSASignature NodeBSignature0 =
 1248        new(Convert.FromHexString(
 1249                "3045022100c3127b33dcc741dd6b05b1e63cbd1a9a7d816f37af9b6756fa2376b056f032370220408b96279808fe57eb7e46371
 50
 1251    public static readonly ECDSASignature NodeASignature0 =
 1252        new(Convert.FromHexString(
 1253                "30440220616210b2cc4d3afb601013c373bbd8aac54febd9f15400379a8cb65ce7deca60022034236c010991beb7ff770510561
 54
 1255    public static readonly ECDSASignature NodeBSignature1 =
 1256        new(Convert.FromHexString(
 1257                "3044022009b048187705a8cbc9ad73adbe5af148c3d012e1f067961486c822c7af08158c022006d66f3704cfab3eb2dc49dae24
 58
 1259    public static readonly ECDSASignature NodeASignature1 =
 1260        new(Convert.FromHexString(
 1261                "304402206fc2d1f10ea59951eefac0b4b7c396a3c3d87b71ff0b019796ef4535beaf36f902201765b0181e514d04f4c8ad75659
 62
 1263    public static readonly ECDSASignature NodeBSignature2 =
 1264        new(Convert.FromHexString(
 1265                "3045022100a135f9e8a5ed25f7277446c67956b00ce6f610ead2bdec2c2f686155b7814772022059f1f6e1a8b336a68efcc1af3
 66
 1267    public static readonly ECDSASignature NodeASignature2 =
 1268        new(Convert.FromHexString(
 1269                "30450221009ec15c687898bb4da8b3a833e5ab8bfc51ec6e9202aaa8e66611edfd4a85ed1102203d7183e45078b9735c93450bc
 70
 1271    public static readonly ECDSASignature NodeBSignature3 =
 1272        new(Convert.FromHexString(
 1273                "304402203948f900a5506b8de36a4d8502f94f21dd84fd9c2314ab427d52feaa7a0a19f2022059b6a37a4adaa2c5419dc8aea63
 74
 1275    public static readonly ECDSASignature NodeASignature3 =
 1276        new(Convert.FromHexString(
 1277                "3045022100b15f72908ba3382a34ca5b32519240a22300cc6015b6f9418635fb41f3d01d8802207adb331b9ed1575383dca0f23
 78
 1279    public static readonly ECDSASignature NodeBSignature4 =
 1280        new(Convert.FromHexString(
 1281                "304502210090b96a2498ce0c0f2fadbec2aab278fed54c1a7838df793ec4d2c78d96ec096202204fdd439c50f90d483baa7b68f
 82
 1283    public static readonly ECDSASignature NodeASignature4 =
 1284        new(Convert.FromHexString(
 1285                "3045022100ad9a9bbbb75d506ca3b716b336ee3cf975dd7834fcf129d7dd188146eb58a8b4022061a759ee417339f7fe2ea1e8d
 86
 1287    public static readonly ECDSASignature NodeBSignature5 =
 1288        new(Convert.FromHexString(
 1289                "304402204ca1ba260dee913d318271d86e10ca0f5883026fb5653155cff600fb40895223022037b145204b7054a40e08bb1fefb
 90
 1291    public static readonly ECDSASignature NodeASignature5 =
 1292        new(Convert.FromHexString(
 1293                "3044022001014419b5ba00e083ac4e0a85f19afc848aacac2d483b4b525d15e2ae5adbfe022015ebddad6ee1e72b47cb09f3e78
 94
 1295    public static readonly ECDSASignature NodeBSignature6 =
 1296        new(Convert.FromHexString(
 1297                "304402204bb3d6e279d71d9da414c82de42f1f954267c762b2e2eb8b76bc3be4ea07d4b0022014febc009c5edc8c3fc5d94015d
 98
 1299    public static readonly ECDSASignature NodeASignature6 =
 12100        new(Convert.FromHexString(
 12101                "3044022072c2e2b1c899b2242656a537dde2892fa3801be0d6df0a87836c550137acde8302201654aa1974d37a829083c3ba150
 102
 12103    public static readonly ECDSASignature NodeBSignature7 =
 12104        new(Convert.FromHexString(
 12105                "304402201a8c1b1f9671cd9e46c7323a104d7047cc48d3ee80d40d4512e0c72b8dc65666022066d7f9a2ce18c9eb22d2739ffcc
 106
 12107    public static readonly ECDSASignature NodeASignature7 =
 12108        new(Convert.FromHexString(
 12109                "3044022044d592025b610c0d678f65032e87035cdfe89d1598c522cc32524ae8172417c30220749fef9d5b2ae8cdd91ece442ba
 110
 12111    public static readonly ECDSASignature NodeBSignature8 =
 12112        new(Convert.FromHexString(
 12113                "304502210092a587aeb777f869e7ff0d7898ea619ee26a3dacd1f3672b945eea600be431100220077ee9eae3528d15251f2a52b
 114
 12115    public static readonly ECDSASignature NodeASignature8 =
 12116        new(Convert.FromHexString(
 12117                "3045022100e5efb73c32d32da2d79702299b6317de6fb24a60476e3855926d78484dd1b3c802203557cb66a42c944ef06e00bcc
 118
 12119    public static readonly ECDSASignature NodeBSignature9 =
 12120        new(Convert.FromHexString(
 12121                "3045022100b495d239772a237ff2cf354b1b11be152fd852704cb184e7356d13f2fb1e5e430220723db5cdb9cbd6ead7bfd3deb
 122
 12123    public static readonly ECDSASignature NodeASignature9 =
 12124        new(Convert.FromHexString(
 12125                "304402201b736d1773a124c745586217a75bed5f66c05716fbe8c7db4fdb3c3069741cdd02205083f39c321c1bcadfc8d97e3c7
 126
 12127    public static readonly ECDSASignature NodeBSignature10 =
 12128        new(Convert.FromHexString(
 12129                "3045022100b4b16d5f8cc9fc4c1aff48831e832a0d8990e133978a66e302c133550954a44d022073573ce127e2200d316f6b612
 130
 12131    public static readonly ECDSASignature NodeASignature10 =
 12132        new(Convert.FromHexString(
 12133                "3045022100d72638bc6308b88bb6d45861aae83e5b9ff6e10986546e13bce769c70036e2620220320be7c6d66d22f30b9fcd52a
 134
 12135    public static readonly ECDSASignature NodeBSignature11 =
 12136        new(Convert.FromHexString(
 12137                "304402203a286936e74870ca1459c700c71202af0381910a6bfab687ef494ef1bc3e02c902202506c362d0e3bee15e802aa729b
 138
 12139    public static readonly ECDSASignature NodeASignature11 =
 12140        new(Convert.FromHexString(
 12141                "30450221008a953551f4d67cb4df3037207fc082ddaf6be84d417b0bd14c80aab66f1b01a402207508796dc75034b2dee876fe0
 142
 12143    public static readonly ECDSASignature NodeBSignature12 =
 12144        new(Convert.FromHexString(
 12145                "304402200a8544eba1d216f5c5e530597665fa9bec56943c0f66d98fc3d028df52d84f7002201e45fa5c6bc3a506cc2553e7d1c
 146
 12147    public static readonly ECDSASignature NodeASignature12 =
 12148        new(Convert.FromHexString(
 12149                "3045022100e11b638c05c650c2f63a421d36ef8756c5ce82f2184278643520311cdf50aa200220259565fb9c8e4a87ccaf17f27
 150
 12151    public static readonly ECDSASignature NodeBSignature13 =
 12152        new(Convert.FromHexString(
 12153                "304402202ade0142008309eb376736575ad58d03e5b115499709c6db0b46e36ff394b492022037b63d78d66404d6504d4c4ac13
 154
 12155    public static readonly ECDSASignature NodeASignature13 =
 12156        new(Convert.FromHexString(
 12157                "304402207e8d51e0c570a5868a78414f4e0cbfaed1106b171b9581542c30718ee4eb95ba02203af84194c97adf98898c9afe2f2
 158
 12159    public static readonly ECDSASignature NodeBSignature14 =
 12160        new(Convert.FromHexString(
 12161                "304402202ade0142008309eb376736575ad58d03e5b115499709c6db0b46e36ff394b492022037b63d78d66404d6504d4c4ac13
 162
 12163    public static readonly ECDSASignature NodeASignature14 =
 12164        new(Convert.FromHexString(
 12165                "304402207e8d51e0c570a5868a78414f4e0cbfaed1106b171b9581542c30718ee4eb95ba02203af84194c97adf98898c9afe2f2
 166
 12167    public static readonly ECDSASignature NodeBSignature15 =
 12168        new(Convert.FromHexString(
 12169                "304402207d0870964530f97b62497b11153c551dca0a1e226815ef0a336651158da0f82402200f5378beee0e77759147b8a0a28
 170
 12171    public static readonly ECDSASignature NodeASignature15 =
 12172        new(Convert.FromHexString(
 12173                "304402200d10bf5bc5397fc59d7188ae438d80c77575595a2d488e41bd6363a810cc8d72022012b57e714fbbfdf7a28c47d5b37
 174
 12175    public static readonly LightningMoney Tx0ToLocalMsat = new(7_000_000, LightningMoneyUnit.Satoshi);
 12176    public static readonly LightningMoney Tx15ToLocalMsat = new(6_999_999_999, LightningMoneyUnit.MilliSatoshi);
 12177    public static readonly LightningMoney ToRemoteMsat = new(3_000_000, LightningMoneyUnit.Satoshi);
 178
 179    public const ulong CommitmentNumber = 42;
 180    public const ushort LocalDelay = 144;
 181
 12182    public static readonly byte[] Htlc0Preimage =
 12183        Convert.FromHexString("0000000000000000000000000000000000000000000000000000000000000000");
 184
 12185    public static readonly byte[] Htlc1Preimage =
 12186        Convert.FromHexString("0101010101010101010101010101010101010101010101010101010101010101");
 187
 12188    public static readonly byte[] Htlc2Preimage =
 12189        Convert.FromHexString("0202020202020202020202020202020202020202020202020202020202020202");
 190
 12191    public static readonly byte[] Htlc3Preimage =
 12192        Convert.FromHexString("0303030303030303030303030303030303030303030303030303030303030303");
 193
 12194    public static readonly byte[] Htlc4Preimage =
 12195        Convert.FromHexString("0404040404040404040404040404040404040404040404040404040404040404");
 196
 12197    public static readonly byte[] Htlc5Preimage =
 12198        Convert.FromHexString("0505050505050505050505050505050505050505050505050505050505050505");
 199
 12200    public static readonly byte[] Htlc6Preimage =
 12201        Convert.FromHexString("0505050505050505050505050505050505050505050505050505050505050505");
 202
 12203    public static readonly byte[] Htlc0PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12204    public static readonly byte[] Htlc1PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12205    public static readonly byte[] Htlc2PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12206    public static readonly byte[] Htlc3PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12207    public static readonly byte[] Htlc4PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12208    public static readonly byte[] Htlc5PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 12209    public static readonly byte[] Htlc6PaymentHash = new byte[CryptoConstants.Sha256HashLen];
 210
 12211    public static readonly Transaction ExpectedCommitTx0 = Transaction.Parse(
 12212        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8002c0c62d0000000
 12213        Network.Main);
 214
 12215    public static readonly LightningMoney ExpectedCommitTx0ToLocalAmount = LightningMoney.Satoshis(6_989_140);
 12216    public static readonly LightningMoney ExpectedCommitTx0ToRemoteAmount = LightningMoney.Satoshis(3_000_000);
 217
 12218    public static readonly Transaction ExpectedCommitTx1 = Transaction.Parse(
 12219        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8007e803000000000
 12220        Network.Main);
 221
 12222    public static readonly Transaction ExpectedCommitTx2 = Transaction.Parse(
 12223        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8007e803000000000
 12224        Network.Main);
 225
 12226    public static readonly Transaction ExpectedCommitTx3 = Transaction.Parse(
 12227        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8006d007000000000
 12228        Network.Main);
 229
 12230    public static readonly Transaction ExpectedCommitTx4 = Transaction.Parse(
 12231        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8006d007000000000
 12232        Network.Main);
 233
 12234    public static readonly Transaction ExpectedCommitTx5 = Transaction.Parse(
 12235        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8005d007000000000
 12236        Network.Main);
 237
 12238    public static readonly Transaction ExpectedCommitTx6 = Transaction.Parse(
 12239        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8005d007000000000
 12240        Network.Main);
 241
 12242    public static readonly Transaction ExpectedCommitTx7 = Transaction.Parse(
 12243        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8004b80b000000000
 12244        Network.Main);
 245
 12246    public static readonly Transaction ExpectedCommitTx8 = Transaction.Parse(
 12247        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8004b80b000000000
 12248        Network.Main);
 249
 12250    public static readonly Transaction ExpectedCommitTx9 = Transaction.Parse(
 12251        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8003a00f000000000
 12252        Network.Main);
 253
 12254    public static readonly Transaction ExpectedCommitTx10 = Transaction.Parse(
 12255        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8003a00f000000000
 12256        Network.Main);
 257
 12258    public static readonly Transaction ExpectedCommitTx11 = Transaction.Parse(
 12259        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8002c0c62d0000000
 12260        Network.Main);
 261
 12262    public static readonly Transaction ExpectedCommitTx12 = Transaction.Parse(
 12263        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b80022202000000000
 12264        Network.Main);
 265
 12266    public static readonly Transaction ExpectedCommitTx13 = Transaction.Parse(
 12267        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8001c0c62d0000000
 12268        Network.Main);
 269
 12270    public static readonly Transaction ExpectedCommitTx14 = Transaction.Parse(
 12271        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8001c0c62d0000000
 12272        Network.Main);
 273
 12274    public static readonly Transaction ExpectedCommitTx15 = Transaction.Parse(
 12275        "02000000000101bef67e4e2fb9ddeeb3461973cd4c62abb35050b1add772995b820b584a488489000000000038b02b8005d007000000000
 12276        Network.Main);
 277
 278    static Bolt3AppendixCVectors()
 279    {
 12280        using var sha256 = new Sha256();
 281
 12282        sha256.AppendData(Htlc0Preimage);
 12283        sha256.GetHashAndReset(Htlc0PaymentHash);
 284
 12285        sha256.AppendData(Htlc1Preimage);
 12286        sha256.GetHashAndReset(Htlc1PaymentHash);
 287
 12288        sha256.AppendData(Htlc2Preimage);
 12289        sha256.GetHashAndReset(Htlc2PaymentHash);
 290
 12291        sha256.AppendData(Htlc3Preimage);
 12292        sha256.GetHashAndReset(Htlc3PaymentHash);
 293
 12294        sha256.AppendData(Htlc4Preimage);
 12295        sha256.GetHashAndReset(Htlc4PaymentHash);
 296
 12297        sha256.AppendData(Htlc5Preimage);
 12298        sha256.GetHashAndReset(Htlc5PaymentHash);
 299
 12300        sha256.AppendData(Htlc6Preimage);
 12301        sha256.GetHashAndReset(Htlc6PaymentHash);
 24302    }
 303}

Methods/Properties

.cctor()