TestFeeLevel, WalletTest: use Wallet.waitForConfirmations() instead of Transaction.getConfidence().getDepthFuture()

This commit is contained in:
Sean Gilligan 2023-08-21 15:54:14 -07:00 committed by Andreas Schildbach
parent c4714f64f8
commit 19fcdcdd5b
2 changed files with 2 additions and 2 deletions

View File

@ -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<TransactionConfidence> depthFuture = t1.getConfidence().getDepthFuture(1);
final CompletableFuture<TransactionConfidence> depthFuture = wallet.waitForConfirmations(t1, 1);
assertFalse(depthFuture.isDone());
assertEquals(ZERO, wallet.getBalance(Wallet.BalanceType.AVAILABLE));
assertEquals(amount, wallet.getBalance(Wallet.BalanceType.ESTIMATED));

View File

@ -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);