|
From: Pelle B. <pe...@us...> - 2004-03-22 22:09:59
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7293/src/java/org/neuclear/ledger Modified Files: Ledger.java Log Message: SimpleLedger now passes all unit tests Index: Ledger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/Ledger.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Ledger.java 22 Mar 2004 17:33:02 -0000 1.11 --- Ledger.java 22 Mar 2004 21:59:37 -0000 1.12 *************** *** 4,7 **** --- 4,10 ---- * $Id$ * $Log$ + * Revision 1.12 2004/03/22 21:59:37 pelle + * SimpleLedger now passes all unit tests + * * Revision 1.11 2004/03/22 17:33:02 pelle * Added a verified transfer to neuclear-ledger. *************** *** 183,187 **** * @throws TransactionExpiredException */ ! public abstract PostedTransaction performCompleteHold(PostedHeldTransaction hold, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, TransactionExpiredException; /** --- 186,190 ---- * @throws TransactionExpiredException */ ! public abstract PostedTransaction performCompleteHold(PostedHeldTransaction hold, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, TransactionExpiredException, UnknownTransactionException; /** *************** *** 287,290 **** --- 290,295 ---- public final PostedHeldTransaction hold(String from, String to, Date expiry, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, UnBalancedTransactionException, InsufficientFundsException { + if (getAvailableBalance(from) - amount < 0) + throw new InsufficientFundsException(this, from, amount); return hold(CryptoTools.createRandomID(), CryptoTools.createRandomID(), from, to, expiry, amount, comment); } |