Skip to content

Commit

Permalink
Merge pull request #7321 from alvasw/Add_send_more_BSQ_than_in_wallet…
Browse files Browse the repository at this point in the history
…_test

Add send more BSQ than in wallet test
  • Loading branch information
alejandrogarcia83 authored Dec 10, 2024
2 parents 3ba9188 + b78f3ab commit 6e7f80b
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 6e7f80b

Please sign in to comment.