mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
2022 04 02 fix walletdlcsetup test (#4237)
* WIP * Fix test case so it passes
This commit is contained in:
parent
b5bfcbc009
commit
ddabc91294
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user