Skip to content

Commit

Permalink
fix: When a transaction is boosted, the reference of this tx in rewar…
Browse files Browse the repository at this point in the history
…d dashboard is not updated - EXO-70361

Before this fix, when a tx replace another one, the broadcastTransactionReplacedEvent is correctly launch,
but the first test of this function verify if the newTx is pending. If the new tx is pending, it do nothing.

As the new tx is always pending, this function never do something
This commit change the test to do nothing when the new tx IS NOT pending.

Resolves Meeds-io/meeds#1516
  • Loading branch information
rdenarie committed Mar 15, 2024
1 parent b8441c2 commit a8559ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ public static void broadcastTransactionReplacedEvent(TransactionDetail oldTransa
String oldHash = "";
String newHash = "";
try {
if (oldTransaction == null || newTransaction == null || oldTransaction.isPending() || newTransaction.isPending()) {
if (oldTransaction == null || newTransaction == null || oldTransaction.isPending() || !(newTransaction.isPending())) {
return;
}
oldHash = oldTransaction.getHash();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void testCancelTransactionDetail() {
TransactionDetail transactionDetailReplacement = storedTransactionDetail.clone();
transactionDetailReplacement.setHash(generateTransactionHash());
transactionDetailReplacement.setId(0);
transactionDetailReplacement.setPending(false);
transactionDetailReplacement.setPending(true);
walletTransactionService.saveTransactionDetail(transactionDetailReplacement, true);
TransactionDetail storedTransactionDetailReplacement = walletTransactionService.getTransactionByHash(transactionDetailReplacement.getHash());

Expand Down

0 comments on commit a8559ff

Please sign in to comment.