Comment out jvm test walletTxBuilderDrainWallet

This commit is contained in:
Steve Myers 2022-04-05 12:34:44 -07:00
parent 1905d8804d
commit 25863c527f
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051

View File

@ -149,27 +149,29 @@ class JvmLibTest {
txBuilder.build(wallet) txBuilder.build(wallet)
} }
@Test // Comment this test in for local testing, you will need let it fail ones to get an address
fun walletTxBuilderDrainWallet() { // to pre-fund the test wallet before the test will pass.
val descriptor = // @Test
"wpkh([8da6afbe/84'/1'/0'/0]tprv8hY7jbMbe17EH1cLw2feTyNDYvjcFYauLmbneBqVnDERBrV51LrxWjCYRZwWS5keYn3ijb7iHJuEzXQk7EzgPeKRBVNBgC4oFPDxGND5S3V/*)" // fun walletTxBuilderDrainWallet() {
val wallet = Wallet(descriptor, null, Network.TESTNET, databaseConfig, blockchainConfig) // val descriptor =
wallet.sync(LogProgress(), null) // "wpkh([8da6afbe/84'/1'/0'/0]tprv8hY7jbMbe17EH1cLw2feTyNDYvjcFYauLmbneBqVnDERBrV51LrxWjCYRZwWS5keYn3ijb7iHJuEzXQk7EzgPeKRBVNBgC4oFPDxGND5S3V/*)"
val balance = wallet.getBalance() // val wallet = Wallet(descriptor, null, Network.TESTNET, databaseConfig, blockchainConfig)
if (balance > 2000u) { // wallet.sync(LogProgress(), null)
println("balance $balance") // val balance = wallet.getBalance()
// send all coins back to https://bitcoinfaucet.uo1.net // if (balance > 2000u) {
val faucetAddress = "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt" // println("balance $balance")
val txBuilder = TxBuilder().drainWallet().drainTo(faucetAddress).feeRate(1.1f) // // send all coins back to https://bitcoinfaucet.uo1.net
val psbt = txBuilder.build(wallet) // val faucetAddress = "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt"
wallet.sign(psbt) // val txBuilder = TxBuilder().drainWallet().drainTo(faucetAddress).feeRate(1.1f)
val txid = wallet.broadcast(psbt) // val psbt = txBuilder.build(wallet)
println("https://mempool.space/testnet/tx/$txid") // wallet.sign(psbt)
assertNotNull(txid) // val txid = wallet.broadcast(psbt)
} else { // println("https://mempool.space/testnet/tx/$txid")
val depositAddress = wallet.getLastUnusedAddress() // assertNotNull(txid)
fail("Send more testnet coins to: $depositAddress") // } else {
} // val depositAddress = wallet.getLastUnusedAddress()
} // fail("Send more testnet coins to: $depositAddress")
// }
// }
} }