Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BitcoinCoreWalletSpec #1401

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ class BitcoinCoreWalletSpec extends TestKit(ActorSystem("test")) with BitcoindSe

val fundingTxes = for (_ <- 0 to 3) yield {
val pubkeyScript = Script.write(Script.pay2wsh(Scripts.multiSig2of2(randomKey.publicKey, randomKey.publicKey)))
wallet.makeFundingTx(pubkeyScript, MilliBtc(50), 249).pipeTo(sender.ref) // create a tx with an invalid feerate (too little)
wallet.makeFundingTx(pubkeyScript, MilliBtc(50), 200).pipeTo(sender.ref) // create a tx with an invalid feerate (too little)
val belowFeeFundingTx = sender.expectMsgType[MakeFundingTxResponse].fundingTx
wallet.publishTransaction(belowFeeFundingTx).pipeTo(sender.ref) // try publishing the tx
assert(sender.expectMsgType[Failure].cause.asInstanceOf[JsonRPCError].error.message.contains("min relay fee not met, 152 < 153 (code 66)"))
wallet.rollback(belowFeeFundingTx) // rollback the locked outputs
assert(sender.expectMsgType[Failure].cause.asInstanceOf[JsonRPCError].error.message.contains("min relay fee not met, 122 < 153 (code 66)"))
wallet.rollback(belowFeeFundingTx).pipeTo(sender.ref) // rollback the locked outputs
assert(sender.expectMsgType[Boolean])

// now fund a tx with correct feerate
wallet.makeFundingTx(pubkeyScript, MilliBtc(50), 250).pipeTo(sender.ref)
Expand Down