You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bug...@ve...> - 2004-04-06 15:27:35
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-37 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-37 Summary: Create java classes for IssueOrder and IssueReceipt Type: New Feature Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Data Objects Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 7:56 AM Updated: Tue, 6 Apr 2004 8:27 AM Description: We need to add the following java classes: IssueOrder and IssueReceipt They are basically identicaly to TransferOrder and TransferReceipt except for class names. If possible we should do basic checking in the IssueOrder reader that the signer uses the Issuing key from the Asset. The main purpose is to isolate the Issuing process from the regular Transfer process. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 15:17:39
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-41 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-41 Summary: Create Unit Tests of Issueing process Type: Test Case Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Audit Controller Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 8:15 AM Updated: Tue, 6 Apr 2004 8:15 AM Description: Create Unit tests for the following scenarios: - Straight forward issuance of 1000 units from a negative issuance account. - Negative Issuance - Attempt at Issuance from non issuer --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 15:01:43
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-40 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-40 Summary: Add Issueing process to Audit Controller Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Audit Controller Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 8:01 AM Updated: Tue, 6 Apr 2004 8:01 AM Description: The asset controller should listen to IssueOrders and IssueReceipts. The IssueOrder's can have negative numbers (to take assets out of circulation) and the Issuer is allowed a negative balance. The Audit Controller needs to record the underlying transactions in its ledger. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 15:01:42
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-39 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-39 Summary: Add Issueing process to AssetController Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Asset Controller Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 8:00 AM Updated: Tue, 6 Apr 2004 8:00 AM Description: The asset controller should listen to IssueOrders and respond with signed IssueReceipts. The IssueOrder's can have negative numbers (to take assets out of circulation) and the Issuer is allowed a negative balance. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 14:59:37
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-38 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-38 Summary: Write unit tests for IssueOrder and IssueReceipt classes Type: Test Case Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Data Objects Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 7:57 AM Updated: Tue, 6 Apr 2004 7:57 AM Description: Write unit tests to verify the creation and validation of these objects. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 14:57:33
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-37 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-37 Summary: Create java classes for IssueOrder and IssueReceipt Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Data Objects Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 7:56 AM Updated: Tue, 6 Apr 2004 7:56 AM Description: We need to add the following java classes: IssueOrder and IssueReceipt They are basically identicaly to TransferOrder and TransferReceipt except for class names. If possible we should do basic checking in the IssueOrder reader that the signer uses the Issuing key from the Asset. The main purpose is to isolate the Issuing process from the regular Transfer process. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 14:55:36
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-36 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-36 Summary: Create schema for IssueOrder and IssueReceipt Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: XML Schema Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 7:54 AM Updated: Tue, 6 Apr 2004 7:54 AM Description: We need to add the following to elements to the xfer schema. IssueOrder and IssueReceipt They are basically identicaly except for the tag names to TransferOrder and TransferReceipt. The main purpose is to isolate the Issuing process from the regular Transfer process. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-06 14:46:36
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-35 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-35 Summary: Implement access control on CancelExchangeOrder and CompleteExchangeOrder Type: Bug Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Asset Controller Fix Fors: 0.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 7:45 AM Updated: Tue, 6 Apr 2004 7:45 AM Description: It should verify the following rules: CancelExchangeOrder should be signed by either of the two: - the Exchange Agent - the Owner CompleteExchangeOrder should be signed by: - the Exchange Agent --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 23:09:33
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-34 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-34 Summary: Auditor should also listen and record Orders Type: Improvement Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Audit Controller Fix Fors: 0.4 Versions: 0.4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 3:16 PM Updated: Mon, 5 Apr 2004 4:08 PM Description: The Auditor now processes only receipts. It should process and record the orders and then enter the receipt id's when received. If a receipt is received and an order hasn't been received it should first record the embedded order. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: Pelle B. <pe...@us...> - 2004-04-05 23:06:57
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3691/src/java/org/neuclear/ledger Modified Files: Ledger.java Log Message: API changes in Ledger to support Auditor and CurrencyController in Pay Index: Ledger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/Ledger.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Ledger.java 5 Apr 2004 22:06:46 -0000 1.16 --- Ledger.java 5 Apr 2004 22:54:15 -0000 1.17 *************** *** 4,7 **** --- 4,10 ---- * $Id$ * $Log$ + * Revision 1.17 2004/04/05 22:54:15 pelle + * API changes in Ledger to support Auditor and CurrencyController in Pay + * * Revision 1.16 2004/04/05 22:06:46 pelle * added setHeldReceiptId() method to ledger *************** *** 191,195 **** * */ ! public abstract void performCancelHold(PostedHeldTransaction hold) throws LowlevelLedgerException, UnknownTransactionException; /** --- 194,198 ---- * */ ! public abstract Date performCancelHold(PostedHeldTransaction hold) throws LowlevelLedgerException, UnknownTransactionException; /** *************** *** 213,217 **** * @return The Transaction object */ ! public abstract Date getTransactionTime(String id) throws LowlevelLedgerException, UnknownTransactionException, InvalidTransactionException, UnknownBookException; /** --- 216,220 ---- * @return The Transaction object */ ! public abstract Date getTransactionTime(String id) throws LowlevelLedgerException, UnknownTransactionException; /** *************** *** 260,263 **** --- 263,271 ---- public abstract double getAvailableBalance(String book) throws LowlevelLedgerException; + + public abstract boolean transactionExists(String id) throws LowlevelLedgerException; + + public abstract boolean heldTransactionExists(String id) throws LowlevelLedgerException; + public String toString() { return id; *************** *** 296,300 **** public final PostedTransaction transfer(String from, String to, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, UnBalancedTransactionException { ! return transfer(CryptoTools.createRandomID(), from, to, amount, comment); } --- 304,314 ---- public final PostedTransaction transfer(String from, String to, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, UnBalancedTransactionException { ! final PostedTransaction tran = transfer(CryptoTools.createRandomID(), from, to, amount, comment); ! try { ! setReceiptId(tran.getRequestId(), CryptoTools.createRandomID()); ! } catch (UnknownTransactionException e) { ! e.printStackTrace(); ! } ! return tran; } *************** *** 307,311 **** public final PostedTransaction verifiedTransfer(String from, String to, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, UnBalancedTransactionException, InsufficientFundsException { ! return verifiedTransfer(CryptoTools.createRandomID(), from, to, amount, comment); } --- 321,331 ---- public final PostedTransaction verifiedTransfer(String from, String to, double amount, String comment) throws InvalidTransactionException, LowlevelLedgerException, UnBalancedTransactionException, InsufficientFundsException { ! final PostedTransaction tran = verifiedTransfer(CryptoTools.createRandomID(), from, to, amount, comment); ! try { ! setReceiptId(tran.getRequestId(), CryptoTools.createRandomID()); ! } catch (UnknownTransactionException e) { ! e.printStackTrace(); ! } ! return tran; } *************** *** 323,329 **** } ! public final void cancel(String id) throws LowlevelLedgerException, UnknownTransactionException { PostedHeldTransaction tran = findHeldTransaction(id); ! performCancelHold(tran); } --- 343,349 ---- } ! public final Date cancel(String id) throws LowlevelLedgerException, UnknownTransactionException { PostedHeldTransaction tran = findHeldTransaction(id); ! return performCancelHold(tran); } |
|
From: Pelle B. <pe...@us...> - 2004-04-05 23:06:57
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/simple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3691/src/java/org/neuclear/ledger/simple Modified Files: SimpleLedger.java Log Message: API changes in Ledger to support Auditor and CurrencyController in Pay Index: SimpleLedger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/simple/SimpleLedger.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SimpleLedger.java 5 Apr 2004 22:06:46 -0000 1.10 --- SimpleLedger.java 5 Apr 2004 22:54:14 -0000 1.11 *************** *** 4,7 **** --- 4,10 ---- * $Id$ * $Log$ + * Revision 1.11 2004/04/05 22:54:14 pelle + * API changes in Ledger to support Auditor and CurrencyController in Pay + * * Revision 1.10 2004/04/05 22:06:46 pelle * added setHeldReceiptId() method to ledger *************** *** 156,159 **** --- 159,164 ---- private void updateBalances(final PostedTransaction trans) { + if (trans.getReceiptId() == null) + return; synchronized (balances) { Iterator iter = trans.getItems(); *************** *** 212,218 **** * */ ! public void performCancelHold(PostedHeldTransaction hold) throws LowlevelLedgerException, UnknownTransactionException { if (held.containsKey(hold.getRequestId())) held.remove(hold.getRequestId()); } --- 217,224 ---- * */ ! public Date performCancelHold(PostedHeldTransaction hold) throws LowlevelLedgerException, UnknownTransactionException { if (held.containsKey(hold.getRequestId())) held.remove(hold.getRequestId()); + return new Date(); } *************** *** 248,252 **** * @return The Transaction object */ ! public Date getTransactionTime(String id) throws LowlevelLedgerException, UnknownTransactionException, InvalidTransactionException, UnknownBookException { return ((PostedTransaction) ledger.get(id)).getTransactionTime(); //To change body of implemented methods use File | Settings | File Templates. } --- 254,258 ---- * @return The Transaction object */ ! public Date getTransactionTime(String id) throws LowlevelLedgerException, UnknownTransactionException { return ((PostedTransaction) ledger.get(id)).getTransactionTime(); //To change body of implemented methods use File | Settings | File Templates. } *************** *** 289,297 **** iter.remove(); } else { ! final Iterator items = tran.getItems(); ! while (items.hasNext()) { ! final TransactionItem item = (TransactionItem) items.next(); ! if (item.getBook().equals(book) && item.getAmount() < 0) ! balance += item.getAmount(); } } --- 295,305 ---- iter.remove(); } else { ! if (tran.getReceiptId() != null) { ! final Iterator items = tran.getItems(); ! while (items.hasNext()) { ! final TransactionItem item = (TransactionItem) items.next(); ! if (item.getBook().equals(book) && item.getAmount() < 0) ! balance += item.getAmount(); ! } } } *************** *** 316,319 **** --- 324,335 ---- } + public boolean transactionExists(String id) throws LowlevelLedgerException { + return ledger.containsKey(id); + } + + public boolean heldTransactionExists(String id) throws LowlevelLedgerException { + return held.containsKey(id); + } + public String toString() { *************** *** 334,338 **** if (!ledger.containsKey(id)) throw new UnknownTransactionException(this, id); ! ((PostedTransaction) ledger.get(id)).setReceiptId(receipt); } --- 350,359 ---- if (!ledger.containsKey(id)) throw new UnknownTransactionException(this, id); ! ! final PostedTransaction tran = (PostedTransaction) ledger.get(id); ! if (tran.getReceiptId() == null) { ! tran.setReceiptId(receipt); ! updateBalances(tran); ! } } *************** *** 340,344 **** if (!held.containsKey(id)) throw new UnknownTransactionException(this, id); ! ((PostedTransaction) held.get(id)).setReceiptId(receipt); } --- 361,367 ---- if (!held.containsKey(id)) throw new UnknownTransactionException(this, id); ! final PostedTransaction tran = (PostedTransaction) held.get(id); ! if (tran.getReceiptId() == null) ! tran.setReceiptId(receipt); } |
|
From: Pelle B. <pe...@us...> - 2004-04-05 23:06:48
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3563/src/java/org/neuclear/asset Modified Files: Auditor.java Log Message: API changes in Ledger to support Auditor and CurrencyController in Pay Index: Auditor.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/Auditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Auditor.java 5 Apr 2004 22:08:23 -0000 1.2 --- Auditor.java 5 Apr 2004 22:54:05 -0000 1.3 *************** *** 32,35 **** --- 32,38 ---- $Id$ $Log$ + Revision 1.3 2004/04/05 22:54:05 pelle + API changes in Ledger to support Auditor and CurrencyController in Pay + Revision 1.2 2004/04/05 22:08:23 pelle CurrencyController and AuditController now now pass all unit tests in CurrencyTests. *************** *** 145,148 **** --- 148,157 ---- if (contract instanceof ExchangeCompletedReceipt) process((ExchangeCompletedReceipt) contract); + if (contract instanceof TransferOrder) + process((TransferOrder) contract); + if (contract instanceof ExchangeOrder) + process((ExchangeOrder) contract); + if (contract instanceof ExchangeCompletionOrder) + process((ExchangeCompletionOrder) contract); if (contract instanceof CancelExchangeReceipt) process((CancelExchangeReceipt) contract); *************** *** 163,175 **** public final void process(final TransferReceipt receipt) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { - try { final TransferOrder req = receipt.getOrder(); ! final PostedTransaction posted = ledger.verifiedTransfer(req.getDigest(), req.getSignatory().getName(), req.getRecipient(), req.getAmount().getAmount(), req.getComment()); ledger.setReceiptId(req.getDigest(), receipt.getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); - } catch (InvalidTransactionException e) { - throw new InvalidTransferException(e.getSubMessage()); } catch (UnknownTransactionException e) { throw new LowLevelPaymentException(e); --- 172,182 ---- public final void process(final TransferReceipt receipt) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { try { final TransferOrder req = receipt.getOrder(); ! if (!ledger.transactionExists(req.getDigest())) ! process(req); ledger.setReceiptId(req.getDigest(), receipt.getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { throw new LowLevelPaymentException(e); *************** *** 177,190 **** } ! public final void process(final ExchangeOrderReceipt receipt) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { try { final ExchangeOrder req = receipt.getOrder(); ! final PostedHeldTransaction posted = ledger.hold(req.getDigest(), req.getSignatory().getName(), req.getAgent().getSignatory().getName(), req.getExpiry(), req.getAmount().getAmount(), req.getComment()); ledger.setHeldReceiptId(req.getDigest(), receipt.getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); - } catch (InvalidTransactionException e) { - throw new InvalidTransferException(e.getSubMessage()); } catch (UnknownTransactionException e) { throw new LowLevelPaymentException(e); --- 184,205 ---- } + public final void process(final TransferOrder req) throws InvalidTransferException, LowLevelPaymentException { + try { + ledger.transfer(req.getDigest(), req.getSignatory().getName(), req.getRecipient(), req.getAmount().getAmount(), req.getComment()); + } catch (LowlevelLedgerException e) { + throw new LowLevelPaymentException(e); + } catch (InvalidTransactionException e) { + throw new InvalidTransferException(e.getSubMessage()); + } + } ! public final void process(final ExchangeOrderReceipt receipt) throws LowLevelPaymentException, InvalidTransferException { try { final ExchangeOrder req = receipt.getOrder(); ! if (!ledger.heldTransactionExists(req.getDigest())) ! process(req); ledger.setHeldReceiptId(req.getDigest(), receipt.getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { throw new LowLevelPaymentException(e); *************** *** 192,200 **** } ! public final void process(final ExchangeCompletedReceipt receipt) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { try { ! ExchangeCompletionOrder complete = receipt.getOrder(); ! PostedTransaction tran = ledger.complete(complete.getReceipt().getOrder().getDigest(), complete.getAmount().getAmount(), complete.getComment()); ! ledger.setReceiptId(complete.getReceipt().getOrder().getDigest(), receipt.getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); --- 207,223 ---- } ! public final void process(final ExchangeOrder req) throws InvalidTransferException, LowLevelPaymentException { try { ! ledger.hold(req.getDigest(), req.getSignatory().getName(), req.getAgent().getSignatory().getName(), req.getExpiry(), req.getAmount().getAmount(), req.getComment()); ! } catch (LowlevelLedgerException e) { ! throw new LowLevelPaymentException(e); ! } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e.getSubMessage()); ! } ! } ! ! public final void process(final ExchangeCompletionOrder complete) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { ! try { ! ledger.complete(complete.getReceipt().getOrder().getDigest(), complete.getAmount().getAmount(), complete.getComment()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); *************** *** 208,211 **** --- 231,247 ---- } + public final void process(final ExchangeCompletedReceipt receipt) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { + try { + ExchangeCompletionOrder order = receipt.getOrder(); + if (!ledger.transactionExists(order.getReceipt().getOrder().getDigest())) + process(order); + ledger.setReceiptId(order.getReceipt().getOrder().getDigest(), receipt.getDigest()); + } catch (LowlevelLedgerException e) { + throw new LowLevelPaymentException(e); + } catch (UnknownTransactionException e) { + throw new InvalidTransferException(e.getLocalizedMessage()); + } + } + public final void process(final CancelExchangeReceipt receipt) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { try { *************** *** 220,224 **** } - private final Ledger ledger; private final Service asset; --- 256,259 ---- |
|
From: Pelle B. <pe...@us...> - 2004-04-05 23:06:47
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3563/src/java/org/neuclear/asset/controllers/currency Modified Files: CurrencyController.java Log Message: API changes in Ledger to support Auditor and CurrencyController in Pay Index: CurrencyController.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency/CurrencyController.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CurrencyController.java 5 Apr 2004 22:08:22 -0000 1.22 --- CurrencyController.java 5 Apr 2004 22:54:04 -0000 1.23 *************** *** 52,56 **** throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e.getSubMessage()); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); --- 52,56 ---- throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); *************** *** 71,75 **** throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e.getSubMessage()); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); --- 71,75 ---- throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); *************** *** 88,96 **** throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } catch (TransactionExpiredException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } } --- 88,96 ---- throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { ! throw new InvalidTransferException(e); } catch (TransactionExpiredException e) { ! throw new InvalidTransferException(e); } catch (InvalidTransactionException e) { ! throw new InvalidTransferException(e); } } *************** *** 103,107 **** throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } } --- 103,107 ---- throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { ! throw new InvalidTransferException(e); } } |
|
From: <bug...@ve...> - 2004-04-05 23:05:33
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-37 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-37 Summary: Bump supported prevayler version to 2.0Rc1 Type: Improvement Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: Prevalent Ledger Fix Fors: r_0_4 Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 4:03 PM Updated: Mon, 5 Apr 2004 4:03 PM Description: Latest prevayler to ensure future compatibility. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 23:03:34
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-36 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-36 Summary: Update Hibernate Ledger with lastest API changes Type: Improvement Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: SQL Ledger Fix Fors: r_0_4 Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 4:02 PM Updated: Mon, 5 Apr 2004 4:02 PM Description: Update the Hibernate Ledger with the latest API changes: - Dont count transactions in balances without receipt id - Return Cancellation Date when Cancelling a Held transaction - transactionExists() - heldTransactionExists() --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 23:03:34
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-35 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-35 Summary: Update Prevalent Ledger with latest API changes Type: Improvement Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: Prevalent Ledger Fix Fors: r_0_4 Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 4:01 PM Updated: Mon, 5 Apr 2004 4:01 PM Description: Update the Prevalent Ledger with the latest API changes: - Dont count transactions in balances without receipt id - Return Cancellation Date when Cancelling a Held transaction - transactionExists() - heldTransactionExists() --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 22:59:34
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Mon, 5 Apr 2004 3:59 PM
Done and implemented in SimpleLedger. Still needs implementing in PrevalentLedger and HibernateLedger.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/GL-30
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GL-30
Summary: Dont count entries without receipt id's in balances
Type: Improvement
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Ledger
Fix Fors:
r_0_4
Versions:
r_0_4
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Mon, 5 Apr 2004 3:10 PM
Updated: Mon, 5 Apr 2004 3:59 PM
Description:
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2004-04-05 22:45:34
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Mon, 5 Apr 2004 3:44 PM
There isnt really a need to add this as the auditor is now 2 phase and processes the Orders first and Receipts second.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/GL-33
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GL-33
Summary: Create version of hold transfer with receipt id parameter
Type: Improvement
Status: Closed
Priority: Major
Resolution: WON'T FIX
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Ledger
Fix Fors:
r_0_4
Versions:
r_0_4
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Mon, 5 Apr 2004 3:14 PM
Updated: Mon, 5 Apr 2004 3:44 PM
Description:
This is for use by the auditor
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2004-04-05 22:45:34
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Mon, 5 Apr 2004 3:44 PM
There isnt really a need to add this as the auditor is now 2 phase and processes the Orders first and Receipts second.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/GL-31
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GL-31
Summary: Create version of transfer with receipt id parameter
Type: Improvement
Status: Closed
Priority: Major
Resolution: WON'T FIX
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Ledger
Fix Fors:
r_0_4
Versions:
r_0_4
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Mon, 5 Apr 2004 3:12 PM
Updated: Mon, 5 Apr 2004 3:44 PM
Description:
This is for use by the auditor
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2004-04-05 22:45:33
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-32 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-32 Summary: CancelHold should return effective cancellation time Type: Improvement Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Fix Fors: r_0_4 Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 3:13 PM Updated: Mon, 5 Apr 2004 3:43 PM Description: For the CancelExchangeReceipt we need the effective time of the cancellation. The ledger should return this. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 22:43:34
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-34 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-34 Summary: add exists(String id) for Transactions and heldExists(String heldid) for Held Transactions Type: Improvement Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: Browser Fix Fors: r_0_4 Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 3:33 PM Updated: Mon, 5 Apr 2004 3:43 PM Description: We need to be able to check if a transaction already has been posted. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-04-05 22:24:34
|
Message: Work on this issue has been started by Pelle Braendgaard (mailto:pe...@ve...) --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-34 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-34 Summary: Auditor should also listen and record Orders Type: Improvement Status: In Progress Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Components: Audit Controller Fix Fors: 0.4 Versions: 0.4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 3:16 PM Updated: Mon, 5 Apr 2004 3:22 PM Description: The Auditor now processes only receipts. It should process and record the orders and then enter the receipt id's when received. If a receipt is received and an order hasn't been received it should first record the embedded order. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: Pelle B. <pe...@us...> - 2004-04-05 22:21:39
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27426/src/java/org/neuclear/asset/controllers/currency Modified Files: CurrencyController.java Log Message: CurrencyController and AuditController now now pass all unit tests in CurrencyTests. Index: CurrencyController.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency/CurrencyController.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CurrencyController.java 5 Apr 2004 17:07:59 -0000 1.21 --- CurrencyController.java 5 Apr 2004 22:08:22 -0000 1.22 *************** *** 2,5 **** --- 2,6 ---- import org.neuclear.asset.*; + import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.orders.TransferOrder; import org.neuclear.asset.orders.TransferReceipt; *************** *** 8,17 **** import org.neuclear.commons.crypto.signers.Signer; import org.neuclear.exchange.orders.*; ! import org.neuclear.id.Identity; import org.neuclear.id.Service; ! import org.neuclear.id.resolver.Resolver; import org.neuclear.ledger.*; ! import java.util.Iterator; /** --- 9,20 ---- import org.neuclear.commons.crypto.signers.Signer; import org.neuclear.exchange.orders.*; ! import org.neuclear.exchange.orders.builders.CancelExchangeReceiptBuilder; ! import org.neuclear.exchange.orders.builders.ExchangeCompletedReceiptBuilder; ! import org.neuclear.exchange.orders.builders.ExchangeOrderReceiptBuilder; import org.neuclear.id.Service; ! import org.neuclear.id.Signatory; import org.neuclear.ledger.*; ! import java.util.Date; /** *************** *** 25,34 **** // this(LedgerFactory.getInstance().getLedger(ledgername),title,reserve); // } ! public CurrencyController(final Ledger ledger, final Signer signer, final String assetname) throws LowlevelLedgerException, NeuClearException { super(); this.ledger = ledger; this.signer = signer; ! asset = (Service) Resolver.resolveIdentity(assetname); ! issuerBook = asset.getName(); } --- 28,38 ---- // this(LedgerFactory.getInstance().getLedger(ledgername),title,reserve); // } ! public CurrencyController(final Ledger ledger, final Asset asset, final Signer signer, final String alias) throws LowlevelLedgerException, NeuClearException { super(); this.ledger = ledger; this.signer = signer; ! this.asset = asset; ! this.alias = alias; ! issuerBook = new Signatory(asset.getIssuerKey()).getName(); } *************** *** 42,46 **** final PostedTransaction posted = ledger.verifiedTransfer(req.getDigest(), req.getSignatory().getName(), req.getRecipient(), req.getAmount().getAmount(), req.getComment()); ! final TransferReceipt receipt = (TransferReceipt) new TransferReceiptBuilder(req, posted.getTransactionTime()).convert(asset.getName(), signer); ledger.setReceiptId(req.getDigest(), receipt.getDigest()); return receipt; --- 46,50 ---- final PostedTransaction posted = ledger.verifiedTransfer(req.getDigest(), req.getSignatory().getName(), req.getRecipient(), req.getAmount().getAmount(), req.getComment()); ! final TransferReceipt receipt = (TransferReceipt) new TransferReceiptBuilder(req, posted.getTransactionTime()).convert(alias, signer); ledger.setReceiptId(req.getDigest(), receipt.getDigest()); return receipt; *************** *** 57,178 **** - /** - * Returns balance for a given Identity. - * This is a temporary method and will be replaced by a full BalanceRequestContract etc. - * - * @param id - * @return - * @throws LowLevelPaymentException - */ - public double getBalance(final String id) throws LowLevelPaymentException { - try { - return ledger.getBalance(id); - } catch (LowlevelLedgerException e) { - throw new LowLevelPaymentException(e); - } - } - - public final ExchangeOrderReceipt process(final ExchangeOrder req) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { - /* try { - final PostedHeldTransaction posted = ledger.hold(to, req.getAmount().getAmount(), req.getComment(), valuetime,req.getExpiry()); ! return (ExchangeOrderReceipt) new ExchangeOrderReceiptBuilder(req, valuetime).convert(asset.getName(),signer); ! } catch (UnknownBookException e) { //TODO Implement something like this eg. AccountNotValidException ! throw new InvalidTransferException(e.getSubMessage()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { throw new InvalidTransferException(e.getSubMessage()); - } catch (UnBalancedTransactionException e) { - throw new InvalidTransferException("unbalanced"); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); } - */ - return null; } public final ExchangeCompletedReceipt process(final ExchangeCompletionOrder complete) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { - /* try { ! // ! final PostedHeldTransaction heldTran = ledger.findHeldTransaction(complete.getReceipt().getOrder().getDigest()); ! if (heldTran == null) ! throw new InvalidTransferException("holdid"); ! final double amount = getTransactionAmount(heldTran); ! if (amount > complete.getAmount().getAmount()) ! throw new TransferLargerThanHeldException(complete, amount); ! if (complete.getAmount().getAmount() < 0) ! throw new NegativeTransferException(complete.getAmount()); ! if (heldTran.getExpiryTime().before(complete.getExchangeTime()) || heldTran.getTransactionTime().after(complete.getExchangeTime())) ! throw new ExpiredHeldTransferException(complete); ! ! final PostedTransaction tran = heldTran.complete(complete.getAmount().getAmount(), complete.getExchangeTime(), complete.getComment()); ! return (ExchangeCompletedReceipt) new ExchangeCompletedReceiptBuilder(complete,TimeTools.now()).convert(asset.getName(),signer); } catch (UnknownTransactionException e) { ! throw new NonExistantHoldException(complete.getReceipt().getOrder().getDigest()); } catch (TransactionExpiredException e) { ! throw new ExpiredHeldTransferException(complete); } catch (InvalidTransactionException e) { throw new InvalidTransferException(e.getLocalizedMessage()); - } catch (LowlevelLedgerException e) { - throw new LowLevelPaymentException(e); } - */ return null; } public final CancelExchangeReceipt process(final CancelExchangeOrder cancel) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { - /* try { ! final PostedHeldTransaction heldTran = ledger.findHeldTransaction(cancel.getReceipt().getOrder().getDigest()); ! if (!isRecipient(cancel.getSignatory(), heldTran)) ! throw new TransferDeniedException(cancel); ! heldTran.cancel(); ! return (CancelExchangeReceipt) new CancelExchangeReceiptBuilder(cancel,TimeTools.now()).convert(asset.getName(),signer); ! } catch (UnknownTransactionException e) { ! throw new NonExistantHoldException(cancel.getReceipt().getOrder().getDigest()); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); } - */ return null; - } - - - /** - * Little tool to return the amount of a ledger transaction. - * It returns the sum of all the positive values. - * - * @param tran - * @return - */ - private static double getTransactionAmount(final PostedTransaction tran) { - final Iterator iter = tran.getItems(); - double amount = 0; - while (iter.hasNext()) { - final TransactionItem item = (TransactionItem) iter.next(); - if (item.getAmount() > 0) - amount += item.getAmount(); - } - return amount; } - /** - * Utility to verify if the identity is a recepient of funds in a given transaction - * - * @param id - * @param tran - * @return - */ - private static boolean isRecipient(final Identity id, final PostedTransaction tran) { - final Iterator iter = tran.getItems(); - while (iter.hasNext()) { - final TransactionItem item = (TransactionItem) iter.next(); - if (item.getAmount() >= 0 && item.getBook().equals(id.getName())) - return true; - } - return false; - } private final Ledger ledger; --- 61,110 ---- public final ExchangeOrderReceipt process(final ExchangeOrder req) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { try { ! final PostedHeldTransaction posted = ledger.hold(req.getDigest(), req.getSignatory().getName(), req.getAgent().getSignatory().getName(), req.getExpiry(), req.getAmount().getAmount(), req.getComment()); ! final ExchangeOrderReceipt receipt = (ExchangeOrderReceipt) new ExchangeOrderReceiptBuilder(req, posted.getTransactionTime()).convert(alias, signer); ! ledger.setHeldReceiptId(req.getDigest(), receipt.getDigest()); ! return receipt; } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); } catch (InvalidTransactionException e) { throw new InvalidTransferException(e.getSubMessage()); } catch (NegativeTransferException e) { throw new InvalidTransferException("postive amount"); + } catch (UnknownTransactionException e) { + throw new LowLevelPaymentException(e); } } public final ExchangeCompletedReceipt process(final ExchangeCompletionOrder complete) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { try { ! PostedTransaction tran = ledger.complete(complete.getReceipt().getOrder().getDigest(), complete.getAmount().getAmount(), complete.getComment()); ! ExchangeCompletedReceipt receipt = (ExchangeCompletedReceipt) new ExchangeCompletedReceiptBuilder(complete, tran.getTransactionTime()).convert(alias, signer); ! ledger.setReceiptId(complete.getReceipt().getOrder().getDigest(), receipt.getDigest()); ! return receipt; ! } catch (LowlevelLedgerException e) { ! throw new LowLevelPaymentException(e); } catch (UnknownTransactionException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } catch (TransactionExpiredException e) { ! throw new InvalidTransferException(e.getLocalizedMessage()); } catch (InvalidTransactionException e) { throw new InvalidTransferException(e.getLocalizedMessage()); } } public final CancelExchangeReceipt process(final CancelExchangeOrder cancel) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { try { ! ledger.cancel(cancel.getReceipt().getOrder().getDigest()); ! return (CancelExchangeReceipt) new CancelExchangeReceiptBuilder(cancel, new Date()).convert(alias, signer); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); + } catch (UnknownTransactionException e) { + throw new InvalidTransferException(e.getLocalizedMessage()); } } private final Ledger ledger; *************** *** 180,182 **** --- 112,115 ---- private final String issuerBook; private final Signer signer; + private final String alias; } |
|
From: Pelle B. <pe...@us...> - 2004-04-05 22:21:39
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27426/src/test/org/neuclear/asset/controllers/currency Modified Files: CurrencyTests.java Log Message: CurrencyController and AuditController now now pass all unit tests in CurrencyTests. Index: CurrencyTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency/CurrencyTests.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CurrencyTests.java 31 Mar 2004 23:10:49 -0000 1.7 --- CurrencyTests.java 5 Apr 2004 22:08:24 -0000 1.8 *************** *** 1,11 **** package org.neuclear.asset.controllers.currency; ! import junit.framework.TestCase; ! import org.neuclear.commons.configuration.ConfigurationException; ! import org.neuclear.ledger.LedgerCreationException; import org.neuclear.ledger.LowlevelLedgerException; ! import java.io.IOException; ! import java.sql.SQLException; /** --- 1,32 ---- package org.neuclear.asset.controllers.currency; ! import org.neuclear.asset.Auditor; ! import org.neuclear.asset.InvalidTransferException; ! import org.neuclear.asset.contracts.Asset; ! import org.neuclear.asset.contracts.builders.AssetBuilder; ! import org.neuclear.asset.orders.Amount; ! import org.neuclear.asset.orders.TransferReceipt; ! import org.neuclear.asset.orders.builders.TransferOrderBuilder; ! import org.neuclear.commons.NeuClearException; ! import org.neuclear.exchange.contracts.ExchangeAgent; ! import org.neuclear.exchange.contracts.builders.ExchangeAgentBuilder; ! import org.neuclear.exchange.orders.BidItem; ! import org.neuclear.exchange.orders.CancelExchangeReceipt; ! import org.neuclear.exchange.orders.ExchangeCompletedReceipt; ! import org.neuclear.exchange.orders.ExchangeOrderReceipt; ! import org.neuclear.exchange.orders.builders.CancelExchangeOrderBuilder; ! import org.neuclear.exchange.orders.builders.ExchangeCompletionOrderBuilder; ! import org.neuclear.exchange.orders.builders.ExchangeOrderBuilder; ! import org.neuclear.id.SignedNamedObject; ! import org.neuclear.id.builders.Builder; ! import org.neuclear.id.receiver.Receiver; ! import org.neuclear.ledger.InvalidTransactionException; ! import org.neuclear.ledger.Ledger; import org.neuclear.ledger.LowlevelLedgerException; + import org.neuclear.ledger.simple.SimpleLedger; + import org.neuclear.tests.AbstractSigningTest; ! import java.security.GeneralSecurityException; ! import java.util.Date; /** *************** *** 14,170 **** * Time: 6:05:04 PM */ ! public final class CurrencyTests extends TestCase { ! public CurrencyTests(final String s) throws SQLException, IOException, LowlevelLedgerException, LedgerCreationException, ConfigurationException { super(s); ! // proc = CurrencyController.getInstance(); } ! /* ! public void testFundAccount() throws LowlevelLedgerException, BookExistsException, UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, NegativeTransferException, AssetMismatchException { ! Account bob = createBobAccount(); ! assertNotNull(bob); ! assertEquals(bob.getBalance(), 0.0, 0); ! proc.getIssuer().issue(bob, 100, new Date()); ! assertEquals(bob.getBalance(), 100.0, 0); } ! public void testValidPayment() throws LowlevelLedgerException, BookExistsException, UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, InsufficientFundsException, NegativeTransferException, AssetMismatchException { ! double initial = 100; ! double payment = 75; ! Account bob = createBobAccount(); ! Account alice = createAliceAccount(); ! assertNotNull(bob); ! assertNotNull(alice); ! assertEquals(bob.getBalance(), 0.0, 0); ! assertEquals(alice.getBalance(), 0.0, 0); ! proc.getIssuer().issue(bob, initial, new Date()); ! assertEquals(bob.getBalance(), initial, 0); ! bob.pay(alice, payment, new Date(), "Test Valid Transfer"); ! assertEquals(bob.getBalance(), initial - payment, 0); ! assertEquals(alice.getBalance(), payment, 0); } ! public void testInValidPayment() throws LowlevelLedgerException, BookExistsException, UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, InsufficientFundsException, NegativeTransferException, AssetMismatchException { ! double initial = 75; ! double payment = 100; ! Account bob = createBobAccount(); ! Account alice = createAliceAccount(); ! assertNotNull(bob); ! assertNotNull(alice); ! assertEquals(bob.getBalance(), 0.0, 0); ! assertEquals(alice.getBalance(), 0.0, 0); ! proc.getIssuer().issue(bob, initial, new Date()); ! assertEquals(bob.getBalance(), initial, 0); ! // check for insufficient funds ! try { ! bob.pay(alice, payment, new Date(), "Test for Insufficient Funds"); ! assertTrue("Didnt get Insufficient Funds Exception", false); ! } catch (InsufficientFundsException e) { ! assertTrue("Got Insufficient Funds Exception", true); ! } ! assertEquals(bob.getBalance(), initial, 0); ! assertEquals(alice.getBalance(), 0, 0); ! // Check for negative payments try { ! bob.pay(alice, -payment, new Date(), "Attempted negative payment"); ! assertTrue("Performed Negative Transfer", false); ! } catch (NegativeTransferException e) { ! assertTrue("Couldnt perform Negative Transfer", true); } ! assertEquals(bob.getBalance(), initial, 0); ! assertEquals(alice.getBalance(), 0, 0); ! } ! public void testHeldPayment() throws LowlevelLedgerException, BookExistsException, UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, InsufficientFundsException, NegativeTransferException, TransferNotStartedException, TransferLargerThanHeldException, ExpiredHeldTransferException, AssetMismatchException { ! double initial = 100; ! double payment = 75; ! Account bob = createBobAccount(); ! Account alice = createAliceAccount(); ! assertNotNull(bob); ! assertNotNull(alice); ! Calendar cal = Calendar.getInstance(); ! Date t1 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! Date t2 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! Date t3 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! Date t4 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! Date t5 = cal.getTime(); ! ! assertEquals(bob.getBalance(), 0.0, 0); ! assertEquals(alice.getBalance(), 0.0, 0); ! proc.getIssuer().issue(bob, initial, t1); ! assertEquals(bob.getBalance(t1), initial, 0); ! ExchangeOrderReceipt hold = bob.hold(alice, payment, t2, t4, "Test Hold"); ! assertEquals(bob.getBalance(t2), initial, 0); ! assertEquals(bob.getBalance(t3), initial, 0); ! assertEquals(bob.getBalance(t4), initial, 0); ! assertEquals(bob.getAvailableBalance(t1), initial, 0); ! assertEquals(bob.getAvailableBalance(t2), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t3), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t4), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t5), initial, 0); ! // check for insufficient funds ! try { ! bob.pay(alice, payment, t3, "Test for Insufficient Funds"); ! assertTrue("Didnt get Insufficient Funds Exception", false); ! } catch (InsufficientFundsException e) { ! assertTrue("Got Insufficient Funds Exception", true); ! } ! try { ! hold.complete(t3, payment + 20, "attempt at completing with higher amount"); ! assertTrue("Should throw TransferLargerThanHeldException", false); ! } catch (TransferLargerThanHeldException e) { ! assertTrue("Got Transfer Larger Than Exchange Exception", true); ! } catch (TransferNotStartedException e) { ! e.printStackTrace(); //To change body of catch statement use Options | File Templates. ! } ! try { ! hold.complete(t3, -payment, "attempt at completing with negative amount"); ! assertTrue("Should throw NegativeTransferException", false); ! } catch (NegativeTransferException e) { ! assertTrue("Got Negative Transfer Exception", true); ! } ! try { ! hold.complete(t5, payment, "attempt at completing payment at past date"); ! assertTrue("Should throw ExpiredHeldTransferException", false); ! } catch (ExpiredHeldTransferException e) { ! assertTrue("Threw ExpiredHeldTransferException", true); ! } ! try { ! hold.complete(t1, payment, "attempt at completing payment early"); ! assertTrue("Should throw ExpiredHeldTransferException", false); ! } catch (ExpiredHeldTransferException e) { ! assertTrue("Threw ExpiredHeldTransferException", true); ! } ! TransferReceipt receipt = hold.complete(t3, payment, "valid completion of held payment"); ! System.out.println("Completed held: " + hold.getRequestId() + " complete= " + receipt.getRequestId()); ! assertEquals(bob.getBalance(t2), initial, 0); ! assertEquals(bob.getBalance(t3), initial - payment, 0); ! assertEquals(bob.getBalance(t4), initial - payment, 0); ! assertEquals(bob.getBalance(t5), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t1), initial, 0); ! assertEquals(bob.getAvailableBalance(t2), initial, 0); ! assertEquals(bob.getAvailableBalance(t3), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t4), initial - payment, 0); ! assertEquals(bob.getAvailableBalance(t5), initial - payment, 0); } ! */ ! private CurrencyController proc; } --- 35,179 ---- * Time: 6:05:04 PM */ ! public final class CurrencyTests extends AbstractSigningTest { ! public CurrencyTests(final String s) throws LowlevelLedgerException, GeneralSecurityException, NeuClearException { super(s); ! asset = createTestAsset(); ! shoes = createShoeAsset(); ! agent = createTestExchangeAgent(); ! ledger = new SimpleLedger("test"); ! proc = new CurrencyController(ledger, asset, getSigner(), "neu://test/bux"); ! auditLedger = new SimpleLedger("auditor"); ! auditor = new Auditor(asset, auditLedger); } ! ! public void testTransfer() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { ! fundAccount(); ! double alicebalance = ledger.getBalance(getAlice().getName()); ! assertAudit(getAlice().getName()); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! Builder builder = new TransferOrderBuilder(asset, getBob(), new Amount(25), "test"); ! SignedNamedObject receipt = process(builder); ! assertNotNull(receipt); ! assertTrue(receipt instanceof TransferReceipt); ! assertEquals(alicebalance - 25, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertEquals(alicebalance - 25, ledger.getBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); } ! private void fundAccount() throws InvalidTransactionException, LowlevelLedgerException { ! ledger.transfer("test", getAlice().getName(), 50, "fund"); ! auditLedger.transfer("test", getAlice().getName(), 50, "fund"); } ! public void assertAudit(String name) throws LowlevelLedgerException { ! assertEquals(auditLedger.getBalance(name), ledger.getBalance(name), 0); ! assertEquals(auditLedger.getAvailableBalance(name), ledger.getAvailableBalance(name), 0); ! } ! public void testExchangeOrderAndExpire() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { ! fundAccount(); ! double alicebalance = ledger.getBalance(getAlice().getName()); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! ! Builder builder = new ExchangeOrderBuilder(asset, agent, new Amount(20), new Date(System.currentTimeMillis() + 5000), new BidItem[]{new BidItem(shoes, new Amount(10))}, "give me shoes"); ! SignedNamedObject receipt = process(builder); ! assertNotNull(receipt); ! assertTrue(receipt instanceof ExchangeOrderReceipt); ! assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); try { ! Thread.currentThread().sleep(5000); ! } catch (InterruptedException e) { ! ; } ! assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); } ! public void testExchangeOrderAndCancel() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { ! fundAccount(); ! double alicebalance = ledger.getBalance(getAlice().getName()); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! Builder builder = new ExchangeOrderBuilder(asset, agent, new Amount(20), new Date(System.currentTimeMillis() + 5000), new BidItem[]{new BidItem(shoes, new Amount(10))}, "give me shoes"); ! SignedNamedObject receipt = process(builder); ! assertNotNull(receipt); ! assertTrue(receipt instanceof ExchangeOrderReceipt); ! assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! SignedNamedObject cr = process(new CancelExchangeOrderBuilder((ExchangeOrderReceipt) receipt)); ! assertNotNull(cr); ! assertTrue(cr instanceof CancelExchangeReceipt); ! assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! } ! public void testExchangeOrderAndComplete() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { ! fundAccount(); ! double alicebalance = ledger.getBalance(getAlice().getName()); ! assertEquals(alicebalance, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! Builder builder = new ExchangeOrderBuilder(asset, agent, new Amount(20), new Date(System.currentTimeMillis() + 20000), new BidItem[]{new BidItem(shoes, new Amount(10))}, "give me shoes"); ! SignedNamedObject receipt = process(builder); ! assertNotNull(receipt); ! assertTrue(receipt instanceof ExchangeOrderReceipt); ! assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! SignedNamedObject cr = process(new ExchangeCompletionOrderBuilder((ExchangeOrderReceipt) receipt, new Date(), getBob().getName(), new Amount(18), "done")); ! assertNotNull(cr); ! assertTrue(cr instanceof ExchangeCompletedReceipt); ! assertEquals(alicebalance - 18, ledger.getBalance(getAlice().getName()), 0); ! assertEquals(alicebalance - 18, ledger.getAvailableBalance(getAlice().getName()), 0); ! assertAudit(getAlice().getName()); ! } ! private SignedNamedObject process(Builder builder) throws NeuClearException { ! final SignedNamedObject obj = builder.convert("neu://alice@test", getSigner()); ! return auditor.receive(proc.receive(obj)); ! } ! public Asset createTestAsset() throws NeuClearException { ! AssetBuilder builder = new AssetBuilder("http://bux.neuclear.org", ! getSigner().getPublicKey("neu://test/bux"), ! getAlice().getPublicKey(), ! 2, 0); ! return (Asset) builder.convert("neu://test/bux", getSigner()); ! } ! public Asset createShoeAsset() throws NeuClearException { ! AssetBuilder builder = new AssetBuilder("http://shoes.neuclear.org", ! getSigner().getPublicKey("neu://test/bux"), ! getAlice().getPublicKey(), ! 2, 0); ! return (Asset) builder.convert("neu://test", getSigner()); ! } + public ExchangeAgent createTestExchangeAgent() throws NeuClearException { + ExchangeAgentBuilder builder = new ExchangeAgentBuilder("http://tradex.neuclear.org", + getSigner().getPublicKey("neu://bob@test")); + return (ExchangeAgent) builder.convert("neu://test", getSigner()); } ! private Receiver proc; ! private Ledger ledger; ! private Ledger auditLedger; ! private Auditor auditor; ! private ExchangeAgent agent; ! private Asset asset; ! private Asset shoes; ! ! } |
|
From: Pelle B. <pe...@us...> - 2004-04-05 22:21:39
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/servlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27426/src/java/org/neuclear/asset/servlet Modified Files: AssetControllerServlet.java Log Message: CurrencyController and AuditController now now pass all unit tests in CurrencyTests. Index: AssetControllerServlet.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/servlet/AssetControllerServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AssetControllerServlet.java 5 Apr 2004 16:31:42 -0000 1.5 --- AssetControllerServlet.java 5 Apr 2004 22:08:23 -0000 1.6 *************** *** 33,36 **** --- 33,39 ---- $Id$ $Log$ + Revision 1.6 2004/04/05 22:08:23 pelle + CurrencyController and AuditController now now pass all unit tests in CurrencyTests. + Revision 1.5 2004/04/05 16:31:42 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. *************** *** 120,124 **** try { asset = (Service) Resolver.resolveIdentity(getServiceid()); ! final AssetController receiver = new CurrencyController(null, getSigner(), getServiceid()); --- 123,127 ---- try { asset = (Service) Resolver.resolveIdentity(getServiceid()); ! final AssetController receiver = new CurrencyController(null, null, getSigner(), getServiceid()); |