Add send more BSQ than in wallet test

This commit is contained in:
Alva Swanson 2024-12-09 10:26:59 +00:00
parent 848694ad86
commit b78f3abb29
No known key found for this signature in database
GPG key ID: 004760E77F753090

View file

@ -155,4 +155,24 @@ public class BitcoinjBsqTests {
assertThrows(InsufficientMoneyException.class, () ->
bsqWalletV2.sendBsq(receiverAddress, receiverAmount, Coin.ofSat(10)));
}
@Test
void sendMoreBsqThanInWalletTest() {
var bsqWalletV2 = new BsqWalletV2(networkParams,
peerGroup,
btcWalletV2,
bsqWallet,
bsqCoinSelector);
var secondBsqWalletReceivedLatch = new CountDownLatch(1);
secondBsqWallet.addCoinsReceivedEventListener((wallet, tx, prevBalance, newBalance) ->
secondBsqWalletReceivedLatch.countDown());
Address receiverAddress = secondBsqWallet.currentReceiveAddress();
Coin receiverAmount = bsqWallet.getBalance()
.add(Coin.valueOf(100));
assertThrows(InsufficientMoneyException.class, () ->
bsqWalletV2.sendBsq(receiverAddress, receiverAmount, Coin.ofSat(10)));
}
}