mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-22 14:33:06 +01:00
Fix unit test where coinbase input was sometimes selected (#4165)
This commit is contained in:
parent
8e3b8c1f4f
commit
c11d9ef1fe
2 changed files with 5 additions and 4 deletions
|
@ -190,7 +190,7 @@ object TransactionGenerators {
|
|||
realisiticWitnessTransactionWitnessOut)
|
||||
|
||||
/** Generates a transaction where at least one output pays to the given SPK */
|
||||
def transactionTo(spk: ScriptPubKey) =
|
||||
def transactionTo(spk: ScriptPubKey): Gen[Transaction] =
|
||||
Gen.oneOf(baseTransactionTo(spk), witnessTransactionTo(spk))
|
||||
|
||||
/** Generates a transaction with at least one output */
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.bitcoins.core.wallet.fee.SatoshisPerByte
|
|||
import org.bitcoins.testkit.wallet.{BitcoinSWalletTest, WalletTestUtil}
|
||||
import org.bitcoins.testkitcore.Implicits._
|
||||
import org.bitcoins.testkitcore.gen.TransactionGenerators
|
||||
import org.bitcoins.testkitcore.util.TransactionTestUtil
|
||||
import org.scalatest.FutureOutcome
|
||||
import org.scalatest.compatible.Assertion
|
||||
|
||||
|
@ -56,10 +57,10 @@ class ProcessTransactionTest extends BitcoinSWalletTest {
|
|||
wallet =>
|
||||
for {
|
||||
address <- wallet.getNewAddress()
|
||||
output = TransactionOutput(Bitcoins.one, address.scriptPubKey)
|
||||
outPoint = TransactionGenerators.outPoint.sampleSome
|
||||
tx =
|
||||
TransactionGenerators
|
||||
.transactionTo(address.scriptPubKey)
|
||||
.sampleSome
|
||||
TransactionTestUtil.buildTransactionTo(output, outPoint)
|
||||
|
||||
_ <- wallet.processTransaction(tx, None)
|
||||
oldConfirmed <- wallet.getConfirmedBalance()
|
||||
|
|
Loading…
Add table
Reference in a new issue