mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-15 20:30:17 +01:00
Call trim on DLC message text boxes (#3348)
This commit is contained in:
parent
81fe7d76ee
commit
6414833111
4 changed files with 9 additions and 9 deletions
|
@ -202,7 +202,8 @@ class AcceptOfferDialog {
|
||||||
offerTLVTF.onKeyTyped = _ => {
|
offerTLVTF.onKeyTyped = _ => {
|
||||||
if (!dlcDetailsShown) {
|
if (!dlcDetailsShown) {
|
||||||
Try(
|
Try(
|
||||||
LnMessageFactory(DLCOfferTLV).fromHex(offerTLVTF.text.value)) match {
|
LnMessageFactory(DLCOfferTLV).fromHex(
|
||||||
|
offerTLVTF.text.value.trim)) match {
|
||||||
case Failure(_) => ()
|
case Failure(_) => ()
|
||||||
case Success(lnMessage) =>
|
case Success(lnMessage) =>
|
||||||
dlcDetailsShown = true
|
dlcDetailsShown = true
|
||||||
|
|
|
@ -206,7 +206,9 @@ object BroadcastDLCDialog extends Logging {
|
||||||
|
|
||||||
signTLVTF.onKeyTyped = _ => {
|
signTLVTF.onKeyTyped = _ => {
|
||||||
if (!dlcDetailsShown) {
|
if (!dlcDetailsShown) {
|
||||||
Try(LnMessageFactory(DLCSignTLV).fromHex(signTLVTF.text.value)) match {
|
Try(
|
||||||
|
LnMessageFactory(DLCSignTLV).fromHex(
|
||||||
|
signTLVTF.text.value.trim)) match {
|
||||||
case Failure(_) => ()
|
case Failure(_) => ()
|
||||||
case Success(lnMessage) =>
|
case Success(lnMessage) =>
|
||||||
showDetails(lnMessage, isFromFile = false)
|
showDetails(lnMessage, isFromFile = false)
|
||||||
|
|
|
@ -309,13 +309,10 @@ class CreateDLCOfferDialog extends Logging {
|
||||||
|
|
||||||
announcementOrContractInfoTF.onKeyTyped = _ => {
|
announcementOrContractInfoTF.onKeyTyped = _ => {
|
||||||
if (!announcementDetailsShown) {
|
if (!announcementDetailsShown) {
|
||||||
Try(
|
val text = announcementOrContractInfoTF.text.value.trim
|
||||||
OracleAnnouncementV0TLV.fromHex(
|
Try(OracleAnnouncementV0TLV.fromHex(text)) match {
|
||||||
announcementOrContractInfoTF.text.value)) match {
|
|
||||||
case Failure(_) =>
|
case Failure(_) =>
|
||||||
Try(
|
Try(ContractInfoV0TLV.fromHex(text)) match {
|
||||||
ContractInfoV0TLV.fromHex(
|
|
||||||
announcementOrContractInfoTF.text.value)) match {
|
|
||||||
case Failure(_) => ()
|
case Failure(_) => ()
|
||||||
case Success(contractInfo) =>
|
case Success(contractInfo) =>
|
||||||
contractInfo.oracleInfo match {
|
contractInfo.oracleInfo match {
|
||||||
|
|
|
@ -222,7 +222,7 @@ object SignDLCDialog extends Logging {
|
||||||
if (!dlcDetailsShown) {
|
if (!dlcDetailsShown) {
|
||||||
Try(
|
Try(
|
||||||
LnMessageFactory(DLCAcceptTLV).fromHex(
|
LnMessageFactory(DLCAcceptTLV).fromHex(
|
||||||
acceptTLVTF.text.value)) match {
|
acceptTLVTF.text.value.trim)) match {
|
||||||
case Failure(_) => ()
|
case Failure(_) => ()
|
||||||
case Success(lnMessage) =>
|
case Success(lnMessage) =>
|
||||||
showDetails(lnMessage, isFromFile = false)
|
showDetails(lnMessage, isFromFile = false)
|
||||||
|
|
Loading…
Add table
Reference in a new issue