mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 01:40:26 +01:00
TestFeeLevel, WalletTest: use Wallet.waitForConfirmations()
instead of Transaction.getConfidence().getDepthFuture()
This commit is contained in:
parent
c4714f64f8
commit
19fcdcdd5b
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user