diff --git a/core/src/main/scala/org/bitcoins/core/currency/CurrencyUnits.scala b/core/src/main/scala/org/bitcoins/core/currency/CurrencyUnits.scala index 9b1ac99588..540296a568 100644 --- a/core/src/main/scala/org/bitcoins/core/currency/CurrencyUnits.scala +++ b/core/src/main/scala/org/bitcoins/core/currency/CurrencyUnits.scala @@ -167,6 +167,7 @@ object Bitcoins extends BaseNumbers[Bitcoins] with Bounded[Bitcoins] { val max = Bitcoins(Consensus.maxMoney.satoshis) val zero = Bitcoins(Satoshis.zero) val one = Bitcoins(1) + val two = Bitcoins(2) def apply(satoshis: Satoshis): Bitcoins = { val b: BigDecimal = satoshis.toLong * CurrencyUnits.satoshisToBTCScalar diff --git a/dlc-wallet-test/src/test/scala/org/bitcoins/dlc/wallet/WalletDLCSetupTest.scala b/dlc-wallet-test/src/test/scala/org/bitcoins/dlc/wallet/WalletDLCSetupTest.scala index 8c42029df1..62dd8d8b49 100644 --- a/dlc-wallet-test/src/test/scala/org/bitcoins/dlc/wallet/WalletDLCSetupTest.scala +++ b/dlc-wallet-test/src/test/scala/org/bitcoins/dlc/wallet/WalletDLCSetupTest.scala @@ -1085,7 +1085,12 @@ class WalletDLCSetupTest extends BitcoinSDualWalletTest { DLCWalletUtil.sampleDLCOffer.copy(contractInfo = DLCWalletUtil.sampleContractInfo2, collateral = DLCWalletUtil.amt2) + val amt2: Satoshis = Bitcoins(3).satoshis + val offerCollateral2 = amt2 + lazy val sampleContractInfo2: ContractInfo = + SingleContractInfo(amt2, sampleContractOraclePair) val offerData2 = DLCWalletUtil.sampleDLCOffer + .copy(contractInfo = sampleContractInfo2, collateral = offerCollateral2) for { offer1 <- walletA.createDLCOffer( @@ -1101,10 +1106,10 @@ class WalletDLCSetupTest extends BitcoinSDualWalletTest { _ <- walletB.acceptDLCOffer(offer1.toTLV, None, None) //cancel the offer _ <- walletA.cancelDLC(dlcId = offer1.dlcId) - amt = (DLCWalletUtil.half + Bitcoins.one).satoshis + offer2 <- walletA.createDLCOffer( offerData2.contractInfo, - amt, + offerCollateral2, Some(offerData2.feeRate), offerData2.timeouts.contractMaturity.toUInt32, offerData2.timeouts.contractTimeout.toUInt32,