Skip to content

Commit

Permalink
Add a test to ensure NodeParams.nodeId always equals `NodeParams.pr…
Browse files Browse the repository at this point in the history
…ivateKey.publicKey` (#1593)
  • Loading branch information
akumaigorodski authored Nov 13, 2020
1 parent e5db314 commit c0e3884
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class AnnouncementsSpec extends AnyFunSuite {
assert(checkSig(ann.copy(timestamp = 153)) === false)
}

test("nodeParams.nodeId equals nodeParams.privateKey.publicKey") {
assert(Alice.nodeParams.nodeId === Alice.nodeParams.privateKey.publicKey)
}

test("create valid signed channel update announcement") {
val ann = makeChannelUpdate(Block.RegtestGenesisBlock.hash, Alice.nodeParams.privateKey, randomKey.publicKey, ShortChannelId(45561L), Alice.nodeParams.expiryDelta, Alice.nodeParams.htlcMinimum, Alice.nodeParams.feeBase, Alice.nodeParams.feeProportionalMillionth, 500000000 msat)
assert(checkSig(ann, Alice.nodeParams.nodeId))
Expand Down

0 comments on commit c0e3884

Please sign in to comment.