Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
thomash-acinq committed Jan 22, 2025
1 parent ba13ced commit 98cc265
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 98cc265

Please sign in to comment.