Call trim on DLC message text boxes (#3348)

This commit is contained in:
benthecarman 2021-06-29 14:18:06 -05:00 committed by GitHub
parent 81fe7d76ee
commit 6414833111
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View file

@ -202,7 +202,8 @@ class AcceptOfferDialog {
offerTLVTF.onKeyTyped = _ => {
if (!dlcDetailsShown) {
Try(
LnMessageFactory(DLCOfferTLV).fromHex(offerTLVTF.text.value)) match {
LnMessageFactory(DLCOfferTLV).fromHex(
offerTLVTF.text.value.trim)) match {
case Failure(_) => ()
case Success(lnMessage) =>
dlcDetailsShown = true

View file

@ -206,7 +206,9 @@ object BroadcastDLCDialog extends Logging {
signTLVTF.onKeyTyped = _ => {
if (!dlcDetailsShown) {
Try(LnMessageFactory(DLCSignTLV).fromHex(signTLVTF.text.value)) match {
Try(
LnMessageFactory(DLCSignTLV).fromHex(
signTLVTF.text.value.trim)) match {
case Failure(_) => ()
case Success(lnMessage) =>
showDetails(lnMessage, isFromFile = false)

View file

@ -309,13 +309,10 @@ class CreateDLCOfferDialog extends Logging {
announcementOrContractInfoTF.onKeyTyped = _ => {
if (!announcementDetailsShown) {
Try(
OracleAnnouncementV0TLV.fromHex(
announcementOrContractInfoTF.text.value)) match {
val text = announcementOrContractInfoTF.text.value.trim
Try(OracleAnnouncementV0TLV.fromHex(text)) match {
case Failure(_) =>
Try(
ContractInfoV0TLV.fromHex(
announcementOrContractInfoTF.text.value)) match {
Try(ContractInfoV0TLV.fromHex(text)) match {
case Failure(_) => ()
case Success(contractInfo) =>
contractInfo.oracleInfo match {

View file

@ -222,7 +222,7 @@ object SignDLCDialog extends Logging {
if (!dlcDetailsShown) {
Try(
LnMessageFactory(DLCAcceptTLV).fromHex(
acceptTLVTF.text.value)) match {
acceptTLVTF.text.value.trim)) match {
case Failure(_) => ()
case Success(lnMessage) =>
showDetails(lnMessage, isFromFile = false)