mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-22 22:36:34 +01:00
Update DLC Table with scheduler (#3204)
This commit is contained in:
parent
bf02e89faa
commit
d3f827a127
3 changed files with 7 additions and 5 deletions
|
@ -54,8 +54,8 @@ abstract class WalletGUI {
|
|||
" sats")
|
||||
}
|
||||
|
||||
private lazy val model = new WalletGUIModel()
|
||||
private lazy val dlcPane = new DLCPane(glassPane)
|
||||
private lazy val model = new WalletGUIModel(dlcPane.model)
|
||||
|
||||
private lazy val balanceBox = new VBox {
|
||||
spacing = 10
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.bitcoins.core.currency.{Bitcoins, Satoshis}
|
|||
import org.bitcoins.core.protocol.BitcoinAddress
|
||||
import org.bitcoins.core.wallet.fee.FeeUnit
|
||||
import org.bitcoins.gui.dialog._
|
||||
import org.bitcoins.gui.dlc.DLCPaneModel
|
||||
import org.bitcoins.gui.util.GUIUtil
|
||||
import scalafx.application.Platform
|
||||
import scalafx.beans.property._
|
||||
|
@ -18,7 +19,7 @@ import scala.concurrent.duration.DurationInt
|
|||
import scala.concurrent.{Await, Promise}
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
||||
class WalletGUIModel()(implicit system: ActorSystem) {
|
||||
class WalletGUIModel(dlcModel: DLCPaneModel)(implicit system: ActorSystem) {
|
||||
var taskRunner: TaskRunner = _
|
||||
import system.dispatcher
|
||||
|
||||
|
@ -33,6 +34,7 @@ class WalletGUIModel()(implicit system: ActorSystem) {
|
|||
Platform.runLater {
|
||||
updateBalance()
|
||||
updateWalletInfo()
|
||||
dlcModel.updateDLCs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.bitcoins.gui.dlc
|
|||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.cli.CliCommand._
|
||||
import org.bitcoins.cli.{CliCommand, Config, ConsoleCli}
|
||||
import org.bitcoins.cli.{CliCommand, ConsoleCli}
|
||||
import org.bitcoins.commons.serializers.Picklers._
|
||||
import org.bitcoins.core.protocol.dlc.models._
|
||||
import org.bitcoins.crypto._
|
||||
|
@ -29,7 +29,7 @@ class DLCPaneModel(resultArea: TextArea) extends Logging {
|
|||
ObjectProperty[Window](null.asInstanceOf[Window])
|
||||
|
||||
def getDLCs: Vector[DLCStatus] = {
|
||||
ConsoleCli.exec(GetDLCs, Config.empty) match {
|
||||
ConsoleCli.exec(GetDLCs, GlobalData.consoleCliConfig) match {
|
||||
case Failure(exception) => throw exception
|
||||
case Success(dlcsStr) =>
|
||||
ujson.read(dlcsStr).arr.map(read[DLCStatus](_)).toVector
|
||||
|
@ -42,7 +42,7 @@ class DLCPaneModel(resultArea: TextArea) extends Logging {
|
|||
}
|
||||
|
||||
def updateDLC(dlcId: Sha256Digest): Unit = {
|
||||
ConsoleCli.exec(GetDLC(dlcId), Config.empty) match {
|
||||
ConsoleCli.exec(GetDLC(dlcId), GlobalData.consoleCliConfig) match {
|
||||
case Failure(exception) => throw exception
|
||||
case Success(dlcStatus) =>
|
||||
dlcs += read[DLCStatus](ujson.read(dlcStatus))
|
||||
|
|
Loading…
Add table
Reference in a new issue