mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2024-11-22 16:55:01 +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 source;
|
||||||
private final EconomicEntity destination;
|
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.source = source;
|
||||||
this.destination = destination;
|
this.destination = destination;
|
||||||
this.transferAmount = new AtomicLong(transferAmount);
|
this.balance = new AtomicLong(balance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Transaction copy()
|
public Transaction copy()
|
||||||
{
|
{
|
||||||
return new SimpleTransaction(source, destination, transferAmount.get());
|
return new SimpleTransaction(source, destination, balance.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -37,15 +37,15 @@ public class SimpleTransaction implements Transaction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getTransferAmount()
|
public long getBalance()
|
||||||
{
|
{
|
||||||
return transferAmount.get();
|
return balance.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long addBalance(long amount)
|
public long addBalance(long amount)
|
||||||
{
|
{
|
||||||
return transferAmount.addAndGet(amount);
|
return balance.addAndGet(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,7 +21,7 @@ public class SimpleTransactionLogger implements TransactionLogger
|
|||||||
Transaction transaction = completedTransaction.getTransaction();
|
Transaction transaction = completedTransaction.getTransaction();
|
||||||
EconomicEntity source = transaction.getSource();
|
EconomicEntity source = transaction.getSource();
|
||||||
EconomicEntity destination = transaction.getDestination();
|
EconomicEntity destination = transaction.getDestination();
|
||||||
long transactionAmount = transaction.getTransferAmount();
|
long transactionAmount = transaction.getBalance();
|
||||||
|
|
||||||
transactionLoggingStatementBuilder.append(resultSuccess ? "Successful" : "Unsuccessful")
|
transactionLoggingStatementBuilder.append(resultSuccess ? "Successful" : "Unsuccessful")
|
||||||
.append(" (")
|
.append(" (")
|
||||||
|
@ -16,7 +16,7 @@ public class SimpleTransactor implements Transactor
|
|||||||
return new SimpleCompletedTransaction(transaction, SimpleTransactionResult.UNAUTHORIZED);
|
return new SimpleCompletedTransaction(transaction, SimpleTransactionResult.UNAUTHORIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
long transactionAmount = transaction.getTransferAmount();
|
long transactionAmount = transaction.getBalance();
|
||||||
|
|
||||||
if (transactionAmount >= 0)
|
if (transactionAmount >= 0)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ public interface Transaction
|
|||||||
|
|
||||||
EconomicEntity getDestination();
|
EconomicEntity getDestination();
|
||||||
|
|
||||||
long getTransferAmount();
|
long getBalance();
|
||||||
|
|
||||||
long addBalance(final long amount);
|
long addBalance(final long amount);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user