diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/OfferTypes.scala b/eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/OfferTypes.scala index 859a2b6dc0..5ad99acf88 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/OfferTypes.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/OfferTypes.scala @@ -314,6 +314,10 @@ object OfferTypes { Right(Offer(records)) } + /** + * An offer string can be split with '+' to fit in places with a low character limit. This validates that the string adheres to the spec format to guard against copy-pasting errors. + * @return a lowercase string with '+' and whitespaces removed + */ def validateFormat(s: String): String = { val lowercase = s.toLowerCase require(s == lowercase || s == s.toUpperCase)