mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2024-11-22 08:54:59 +00:00
Rename transaction-related references of transfer amount to balance
This is done for more consistency between methods.
This commit is contained in:
parent
cad1ab8ec7
commit
cd5c42801d
@ -9,19 +9,19 @@ public class SimpleTransaction implements Transaction
|
||||
{
|
||||
private final EconomicEntity source;
|
||||
private final EconomicEntity destination;
|
||||
private final AtomicLong transferAmount;
|
||||
private final AtomicLong balance;
|
||||
|
||||
public SimpleTransaction(EconomicEntity source, EconomicEntity destination, long transferAmount)
|
||||
public SimpleTransaction(EconomicEntity source, EconomicEntity destination, long balance)
|
||||
{
|
||||
this.source = source;
|
||||
this.destination = destination;
|
||||
this.transferAmount = new AtomicLong(transferAmount);
|
||||
this.balance = new AtomicLong(balance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction copy()
|
||||
{
|
||||
return new SimpleTransaction(source, destination, transferAmount.get());
|
||||
return new SimpleTransaction(source, destination, balance.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -37,15 +37,15 @@ public class SimpleTransaction implements Transaction
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTransferAmount()
|
||||
public long getBalance()
|
||||
{
|
||||
return transferAmount.get();
|
||||
return balance.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long addBalance(long amount)
|
||||
{
|
||||
return transferAmount.addAndGet(amount);
|
||||
return balance.addAndGet(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,7 @@ public class SimpleTransactionLogger implements TransactionLogger
|
||||
Transaction transaction = completedTransaction.getTransaction();
|
||||
EconomicEntity source = transaction.getSource();
|
||||
EconomicEntity destination = transaction.getDestination();
|
||||
long transactionAmount = transaction.getTransferAmount();
|
||||
long transactionAmount = transaction.getBalance();
|
||||
|
||||
transactionLoggingStatementBuilder.append(resultSuccess ? "Successful" : "Unsuccessful")
|
||||
.append(" (")
|
||||
|
@ -16,7 +16,7 @@ public class SimpleTransactor implements Transactor
|
||||
return new SimpleCompletedTransaction(transaction, SimpleTransactionResult.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
long transactionAmount = transaction.getTransferAmount();
|
||||
long transactionAmount = transaction.getBalance();
|
||||
|
||||
if (transactionAmount >= 0)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ public interface Transaction
|
||||
|
||||
EconomicEntity getDestination();
|
||||
|
||||
long getTransferAmount();
|
||||
long getBalance();
|
||||
|
||||
long addBalance(final long amount);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user