trait DLCTest extends AnyRef
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- DLCTest
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- sealed trait ContractParams extends AnyRef
- case class DisjointUnionContractParams(singleParams: Vector[SingleContractParams]) extends ContractParams with Product with Serializable
- case class EnumContractParams(numOutcomes: Int, oracleThreshold: Int, numOracles: Int) extends SingleContractParams with Product with Serializable
- case class NumericContractParams(numDigits: Int, oracleThreshold: Int, numOracles: Int, paramsOpt: Option[OracleParamsV0TLV] = None) extends SingleContractParams with Product with Serializable
- sealed trait SingleContractParams extends ContractParams
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val acceptAddress: BitcoinAddress
- val acceptAddress2: BitcoinAddress
- val acceptChangeSPK: P2WPKHWitnessSPKV0
- val acceptChangeSerialId: UInt64
- val acceptFundingInputs: Vector[DLCFundingInput]
- val acceptFundingPrivKey: ECPrivateKey
- val acceptFundingTx: Transaction
- val acceptFundingTx2: Transaction
- val acceptFundingUtxos: Vector[SpendingInfoWithSerialId]
- val acceptInput: CurrencyUnit
- val acceptNestedSPK: MultiSignatureScriptPubKey
- val acceptPayoutPrivKey: ECPrivateKey
- val acceptPayoutSerialId: UInt64
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assertCorrectSigDerivation(offerSetup: SetupDLC, dlcOffer: TestDLCClient, acceptSetup: SetupDLC, dlcAccept: TestDLCClient, oracleSigs: Vector[OracleSignatures], outcome: OracleOutcome)(implicit ec: ExecutionContext): Future[Assertion]
- val blockTimeToday: BlockTime
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def computeNumericOracleSignatures(digits: Vector[Int], privKey: ECPrivateKey = oraclePrivKey, kVals: Vector[ECPrivateKey] = preCommittedKs): OrderedSchnorrSignatures
Computes an oracle signatures for the given outcome and oracle
- def computeNumericOutcome(numDigits: Int, desc: NumericContractDescriptor, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long): Vector[Int]
Deterministically chooses an outcome from the middle third of the interesting possible outcomes.
- def constructAndSetupDLC(contractParams: ContractParams)(implicit ec: ExecutionContext): Future[(TestDLCClient, SetupDLC, TestDLCClient, SetupDLC, Vector[DLCOutcomeType])]
- def constructDLCClients(contractParams: ContractParams, offerFundingPrivKey: ECPrivateKey = this.offerFundingPrivKey, offerPayoutPrivKey: ECPrivateKey = this.offerPayoutPrivKey, acceptFundingPrivKey: ECPrivateKey = this.acceptFundingPrivKey, acceptPayoutPrivKey: ECPrivateKey = this.acceptPayoutPrivKey, offerFundingUtxos: Vector[SpendingInfoWithSerialId] = this.offerFundingUtxos, offerFundingInputs: Vector[DLCFundingInput] = this.offerFundingInputs, acceptFundingUtxos: Vector[SpendingInfoWithSerialId] = this.acceptFundingUtxos, acceptFundingInputs: Vector[DLCFundingInput] = this.acceptFundingInputs, feeRate: SatoshisPerVirtualByte = this.feeRate, timeouts: DLCTimeouts = this.timeouts)(implicit ec: ExecutionContext): (TestDLCClient, TestDLCClient, Vector[DLCOutcomeType])
- def constructDLCClientsFromInfos(offerInfo: ContractInfo, acceptInfo: ContractInfo, offerFundingPrivKey: ECPrivateKey = this.offerFundingPrivKey, offerPayoutPrivKey: ECPrivateKey = this.offerPayoutPrivKey, acceptFundingPrivKey: ECPrivateKey = this.acceptFundingPrivKey, acceptPayoutPrivKey: ECPrivateKey = this.acceptPayoutPrivKey, offerFundingUtxos: Vector[SpendingInfoWithSerialId] = this.offerFundingUtxos, offerFundingInputs: Vector[DLCFundingInput] = this.offerFundingInputs, acceptFundingUtxos: Vector[SpendingInfoWithSerialId] = this.acceptFundingUtxos, acceptFundingInputs: Vector[DLCFundingInput] = this.acceptFundingInputs, feeRate: SatoshisPerVirtualByte = this.feeRate, timeouts: DLCTimeouts = this.timeouts)(implicit ec: ExecutionContext): (TestDLCClient, TestDLCClient)
- def constructDisjointUnionDLCClients(contractParams: DisjointUnionContractParams, offerFundingPrivKey: ECPrivateKey = this.offerFundingPrivKey, offerPayoutPrivKey: ECPrivateKey = this.offerPayoutPrivKey, acceptFundingPrivKey: ECPrivateKey = this.acceptFundingPrivKey, acceptPayoutPrivKey: ECPrivateKey = this.acceptPayoutPrivKey, offerFundingUtxos: Vector[SpendingInfoWithSerialId] = this.offerFundingUtxos, offerFundingInputs: Vector[DLCFundingInput] = this.offerFundingInputs, acceptFundingUtxos: Vector[SpendingInfoWithSerialId] = this.acceptFundingUtxos, acceptFundingInputs: Vector[DLCFundingInput] = this.acceptFundingInputs, feeRate: SatoshisPerVirtualByte = this.feeRate, timeouts: DLCTimeouts = this.timeouts)(implicit ec: ExecutionContext): (TestDLCClient, TestDLCClient, Vector[DLCOutcomeType])
- def constructEnumContractInfos(params: EnumContractParams, oracleShift: Int = 0): (SingleContractInfo, SingleContractInfo)
- def constructEnumDLCClients(contractParams: EnumContractParams, offerFundingPrivKey: ECPrivateKey = this.offerFundingPrivKey, offerPayoutPrivKey: ECPrivateKey = this.offerPayoutPrivKey, acceptFundingPrivKey: ECPrivateKey = this.acceptFundingPrivKey, acceptPayoutPrivKey: ECPrivateKey = this.acceptPayoutPrivKey, offerFundingUtxos: Vector[SpendingInfoWithSerialId] = this.offerFundingUtxos, offerFundingInputs: Vector[DLCFundingInput] = this.offerFundingInputs, acceptFundingUtxos: Vector[SpendingInfoWithSerialId] = this.acceptFundingUtxos, acceptFundingInputs: Vector[DLCFundingInput] = this.acceptFundingInputs, feeRate: SatoshisPerVirtualByte = this.feeRate, timeouts: DLCTimeouts = this.timeouts)(implicit ec: ExecutionContext): (TestDLCClient, TestDLCClient, Vector[EnumOutcome])
- def constructNumericContractInfos(params: NumericContractParams, oracleShift: Int = 0): (SingleContractInfo, SingleContractInfo)
- def constructNumericDLCClients(contractParams: NumericContractParams, offerFundingPrivKey: ECPrivateKey = this.offerFundingPrivKey, offerPayoutPrivKey: ECPrivateKey = this.offerPayoutPrivKey, acceptFundingPrivKey: ECPrivateKey = this.acceptFundingPrivKey, acceptPayoutPrivKey: ECPrivateKey = this.acceptPayoutPrivKey, offerFundingUtxos: Vector[SpendingInfoWithSerialId] = this.offerFundingUtxos, offerFundingInputs: Vector[DLCFundingInput] = this.offerFundingInputs, acceptFundingUtxos: Vector[SpendingInfoWithSerialId] = this.acceptFundingUtxos, acceptFundingInputs: Vector[DLCFundingInput] = this.acceptFundingInputs, feeRate: SatoshisPerVirtualByte = this.feeRate, timeouts: DLCTimeouts = this.timeouts)(implicit ec: ExecutionContext): (TestDLCClient, TestDLCClient, Vector[UnsignedNumericOutcome])
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def executeForCase(contractIndex: Int, outcomeIndex: Long, contractParams: ContractParams)(implicit ec: ExecutionContext): Future[Assertion]
- def executeForCase(outcomeIndex: Long, contractParams: ContractParams)(implicit ec: ExecutionContext): Future[Assertion]
- def executeForCases(outcomeIndices: Vector[Long], contractParams: ContractParams)(implicit ec: ExecutionContext): Future[Assertion]
- def executeForCasesInUnion(outcomeIndices: Vector[(Int, Long)], contractParams: ContractParams)(implicit ec: ExecutionContext): Future[Assertion]
- def executeForOutcome(outcomeIndex: Long, dlcOffer: TestDLCClient, offerSetup: SetupDLC, dlcAccept: TestDLCClient, acceptSetup: SetupDLC, outcomes: Vector[DLCOutcomeType], contractIndex: Int = 0)(implicit ec: ExecutionContext): Future[Assertion]
- def executeRefundCase(contractParams: ContractParams)(implicit ec: ExecutionContext): Future[Assertion]
- val feeRate: SatoshisPerVirtualByte
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val fundOutputSerialId: UInt64
- def genEnumOracleOutcome(chosenOracles: Vector[Int], contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long): EnumOracleOutcome
- def genEnumOracleSignature(oracleInfo: EnumSingleOracleInfo, outcome: String, privKey: ECPrivateKey = oraclePrivKey, kVal: ECPrivateKey = preCommittedK): EnumOracleSignature
Computes an EnumOracleSignature for the given outcome and oracle
- def genEnumOracleSignatures(chosenOracles: Vector[Int], contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long): Vector[EnumOracleSignature]
- def genEnumOracleSignatures(outcome: EnumOracleOutcome): Vector[EnumOracleSignature]
- def genNumericOracleOutcome(numDigits: Int, chosenOracles: Vector[Int], contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long, paramsOpt: Option[OracleParamsV0TLV]): NumericOracleOutcome
- def genNumericOracleOutcome(chosenOracles: Vector[Int], contractInfo: ContractInfo, digits: Vector[Int], paramsOpt: Option[OracleParamsV0TLV]): NumericOracleOutcome
- def genNumericOracleSignatures(numDigits: Int, chosenOracles: Vector[Int], contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long, paramsOpt: Option[OracleParamsV0TLV]): Vector[NumericOracleSignatures]
- def genNumericOracleSignatures(outcome: NumericOracleOutcome): Vector[NumericOracleSignatures]
- def genOracleOutcome(numOutcomesOrDigits: Int, isNumeric: Boolean, contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long, paramsOpt: Option[OracleParamsV0TLV]): OracleOutcome
- def genOracleOutcomeAndSignatures(numOutcomesOrDigits: Int, isNumeric: Boolean, contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long, paramsOpt: Option[OracleParamsV0TLV]): (OracleOutcome, Vector[OracleSignatures])
- def genOracleSignatures(numOutcomesOrDigits: Int, isNumeric: Boolean, contractInfo: SingleContractInfo, outcomes: Vector[DLCOutcomeType], outcomeIndex: Long, paramsOpt: Option[OracleParamsV0TLV]): Vector[OracleSignatures]
- def genOracleSignatures(outcome: OracleOutcome): Vector[OracleSignatures]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val inputPrivKeyAccept: ECPrivateKey
- val inputPrivKeyAccept2A: ECPrivateKey
- val inputPrivKeyAccept2B: ECPrivateKey
- val inputPrivKeyOffer: ECPrivateKey
- val inputPrivKeyOffer2A: ECPrivateKey
- val inputPrivKeyOffer2B: ECPrivateKey
- val inputPubKeyAccept: ECPublicKey
- val inputPubKeyAccept2A: ECPublicKey
- val inputPubKeyAccept2B: ECPublicKey
- val inputPubKeyOffer: ECPublicKey
- val inputPubKeyOffer2A: ECPublicKey
- val inputPubKeyOffer2B: ECPublicKey
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noEmptySPKOutputs(tx: Transaction): Boolean
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val offerAddress: BitcoinAddress
- val offerAddress2: BitcoinAddress
- val offerChangeSPK: P2WPKHWitnessSPKV0
- val offerChangeSerialId: UInt64
- val offerFundingInputs: Vector[DLCFundingInput]
- val offerFundingPrivKey: ECPrivateKey
- val offerFundingTx: Transaction
- val offerFundingTx2: Transaction
- val offerFundingUtxos: Vector[SpendingInfoWithSerialId]
- val offerInput: CurrencyUnit
- val offerNestedSPK: IfConditionalScriptPubKey
- val offerPayoutPrivKey: ECPrivateKey
- val offerPayoutSerialId: UInt64
- val oraclePrivKey: ECPrivateKey
- val oraclePrivKeys: Vector[ECPrivateKey]
- val oraclePubKey: SchnorrPublicKey
- val oraclePubKeys: Vector[SchnorrPublicKey]
- val preCommittedK: ECPrivateKey
- val preCommittedKs: Vector[ECPrivateKey]
- val preCommittedKsPerOracle: Vector[Vector[ECPrivateKey]]
- val preCommittedR: SchnorrNonce
- val preCommittedRs: OrderedNonces
- val preCommittedRsPerOracle: Vector[OrderedNonces]
- def runTestsForParam[T](paramsToTest: Vector[T])(test: (T) => Future[Assertion])(implicit ec: ExecutionContext): Future[Assertion]
Synchronously runs the test function on each paramsToTest in turn.
- def setupDLC(dlcOffer: TestDLCClient, dlcAccept: TestDLCClient)(implicit ec: ExecutionContext): Future[(SetupDLC, SetupDLC)]
- def setupDLC(dlcOffer: TestDLCClient, dlcAccept: TestDLCClient, fundingTxF: (Future[SetupDLC]) => Future[Transaction], publishTransaction: (Transaction) => Future[_])(implicit ec: ExecutionContext): Future[(SetupDLC, SetupDLC)]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tenRandomNums(numDigits: Int): Vector[Long]
- val timeouts: DLCTimeouts
- def toString(): String
- Definition Classes
- AnyRef → Any
- val totalInput: CurrencyUnit
- def validateOutcome(outcome: DLCOutcome, dlcOffer: TestDLCClient, dlcAccept: TestDLCClient): Assertion
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object SingleContractParams