Skip to content

Commit

Permalink
Add send more BSQ than in wallet test
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Dec 9, 2024
1 parent 848694a commit b78f3ab
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions core/src/integrationTest/java/bisq/core/BitcoinjBsqTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,24 @@ void sendBsqButNotEnoughBsqTest() {
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)));
}
}

0 comments on commit b78f3ab

Please sign in to comment.