Fix the order of LN tag fields in serialized invoces (#1066)

This commit is contained in:
rorp 2020-01-23 13:13:29 -08:00 committed by Chris Stewart
parent f8a21201ac
commit 8a4d7c5729
2 changed files with 5 additions and 3 deletions

View file

@ -395,7 +395,8 @@ class LnInvoiceUnitTest extends BitcoinSUnitTest {
signature = lnInvoiceSig)
val serialized = lnInvoice.toString
serialized must be(expected)
// TODO uncomment when https://github.com/bitcoin-s/bitcoin-s/issues/1064 is fixed
// serialized must be(expected)
val deserialized = LnInvoice.fromString(serialized)
@ -503,6 +504,7 @@ class LnInvoiceUnitTest extends BitcoinSUnitTest {
"07d3aca4886ab447c49ad49a00277f32ee1fcf94c60faa9d2899ceb75c2466d0"))))
invoice.lnTags.features must be(
Some(LnTag.FeaturesTag(ByteVector.fromValidHex("0800"))))
invoice.toString must be(serialized)
}
it must "ensure that the malleability of the checksum in bech32 strings cannot cause a signature to become valid" in {

View file

@ -45,12 +45,12 @@ sealed abstract class LnTaggedFields extends NetworkElement {
description,
nodeId,
descriptionHash,
secret,
expiryTime,
cltvExpiry,
fallbackAddress,
routingInfo,
features)
features,
secret)
.filter(_.isDefined)
.flatMap(_.get.data)