From 19fcdcdd5ba3d215b1a9999881ebe046a98c218c Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Mon, 21 Aug 2023 15:54:14 -0700 Subject: [PATCH] TestFeeLevel, WalletTest: use `Wallet.waitForConfirmations()` instead of `Transaction.getConfidence().getDepthFuture()` --- core/src/test/java/org/bitcoinj/wallet/WalletTest.java | 2 +- tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java index ca9314eae..2801f98e3 100644 --- a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java +++ b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java @@ -419,7 +419,7 @@ public class WalletTest extends TestWithWallet { // Send some pending coins to the wallet. Transaction t1 = sendMoneyToWallet(wallet, null, amount, toAddress); Threading.waitForUserCode(); - final CompletableFuture depthFuture = t1.getConfidence().getDepthFuture(1); + final CompletableFuture depthFuture = wallet.waitForConfirmations(t1, 1); assertFalse(depthFuture.isDone()); assertEquals(ZERO, wallet.getBalance(Wallet.BalanceType.AVAILABLE)); assertEquals(amount, wallet.getBalance(Wallet.BalanceType.ESTIMATED)); diff --git a/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java b/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java index bb309591c..4a831fe09 100644 --- a/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java +++ b/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java @@ -95,7 +95,7 @@ public class TestFeeLevel { " peers connected")); kit.peerGroup().broadcastTransaction(request.tx).awaitRelayed().get(); System.out.println("Send complete, waiting for confirmation"); - request.tx.getConfidence().getDepthFuture(1).get(); + kit.wallet().waitForConfirmations(request.tx, 1).get(); int heightNow = kit.chain().getBestChainHeight(); System.out.println("Height after confirmation is " + heightNow);