Skip to content

Commit

Permalink
Create separate fields for oracle pubkey and nonce (#1992)
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Sep 9, 2020
1 parent cff41ae commit d33d874
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Expand Up @@ -116,14 +116,17 @@ object DLCDialog {
}

val oracleInfoStr = "Oracle Info"
val oraclePubKeyStr = "Oracle Pub Key"
val oracleNonceStr = "Oracle Nonce"
val contractInfoStr = "Contract Info"
val collateralStr = "Collateral"
val feeRateStr = "Fee Rate"
val locktimeStr = "Locktime"
val refundLocktimeStr = "Refund Locktime"

val allOfferFields: Map[String, String] = Map[String, String](
oracleInfoStr -> "",
oraclePubKeyStr -> "",
oracleNonceStr -> "",
contractInfoStr -> "",
collateralStr -> "Satoshis",
feeRateStr -> "sats/vbyte (optional)",
Expand Down
Expand Up @@ -7,10 +7,11 @@ import org.bitcoins.core.number.UInt32
import org.bitcoins.core.wallet.fee.SatoshisPerVirtualByte

object OfferDLCDialog
extends DLCDialog[CreateDLCOffer]("Create DLC Offer",
"Enter DLC details",
DLCDialog.constructOfferFields(),
Vector(DLCDialog.feeRateStr)) {
extends DLCDialog[CreateDLCOffer](dialogTitle = "Create DLC Offer",
header = "Enter DLC details",
fields = DLCDialog.constructOfferFields(),
optionalFields = Vector(
DLCDialog.feeRateStr)) {
import DLCDialog._

override def constructFromInput(
Expand All @@ -25,8 +26,10 @@ object OfferDLCDialog
)
}

val oracleInfoHex = inputs(oraclePubKeyStr) ++ inputs(oracleNonceStr)

CreateDLCOffer(
oracleInfo = DLCMessage.OracleInfo.fromHex(inputs(oracleInfoStr)),
oracleInfo = DLCMessage.OracleInfo.fromHex(oracleInfoHex),
contractInfo = DLCMessage.ContractInfo.fromHex(inputs(contractInfoStr)),
collateral = Satoshis(BigInt(inputs(collateralStr))),
feeRateOpt = feeRate,
Expand Down

0 comments on commit d33d874

Please sign in to comment.