Add method for directly setting a transaction's balance

This commit is contained in:
Allink 2023-05-20 05:55:26 +01:00
parent cd5c42801d
commit 0429604737
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -53,4 +53,10 @@ public class SimpleTransaction implements Transaction
{ {
return this.addBalance(-amount); return this.addBalance(-amount);
} }
@Override
public void setBalance(long newBalance)
{
balance.set(newBalance);
}
} }

View File

@ -13,4 +13,6 @@ public interface Transaction
long addBalance(final long amount); long addBalance(final long amount);
long removeBalance(final long amount); long removeBalance(final long amount);
void setBalance(final long newBalance);
} }