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 21:10:37
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Tue, 6 Apr 2004 2:10 PM
Added and passes 100% for SimpleLedger. Am now using it for verifying implementations for Prevalent and Hibernate.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/GL-38
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GL-38
Summary: Create Unit Tests for new API Changes
Type: Test Case
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: Tue, 6 Apr 2004 1:24 PM
Updated: Tue, 6 Apr 2004 2:10 PM
Description:
We need Unit tests for the following in AbstractLedgerTests:
- CancelHold returns a Date
- Transactions without ReceiptID arent counted in Balances
- setReceiptId for both PostedTransaction and PostedHeldTransaction
- exists() for PostedTransaction and PostedHeldTransaction.
---------------------------------------------------------------------
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 20:26:33
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-38 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-38 Summary: Create Unit Tests for new API Changes Type: Test Case Status: Open Priority: Major 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: Tue, 6 Apr 2004 1:24 PM Updated: Tue, 6 Apr 2004 1:24 PM Description: We need Unit tests for the following in AbstractLedgerTests: - CancelHold returns a Date - Transactions without ReceiptID arent counted in Balances - setReceiptId for both PostedTransaction and PostedHeldTransaction - exists() for PostedTransaction and PostedHeldTransaction. --------------------------------------------------------------------- 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 18:53:47
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-44 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-44 Summary: Issuer should be disallowed all non Issue Transactions Type: Improvement 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 11:53 AM Updated: Tue, 6 Apr 2004 11:53 AM Description: For reasons of security and auditing, the Issuer should only be allowed to perform IssueOrder's. No TransferOrder's, ExchangeOrder's or any other Order should be allowed. --------------------------------------------------------------------- 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 16:42:34
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/NEU-30 Here is an overview of the issue: --------------------------------------------------------------------- Key: NEU-30 Summary: Allow Identity Objects to be described in XHTML Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Identity Fix Fors: 0.9 Versions: 0.9 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 6 Apr 2004 9:40 AM Updated: Tue, 6 Apr 2004 9:40 AM Description: People should be able to describe them selves in xhtml with foaf,rdf etc and sign it for use as an Identity descriptor. --------------------------------------------------------------------- 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 16:40:33
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-43 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-43 Summary: Create support for XHTML Asset Descriptors 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 9:39 AM Updated: Tue, 6 Apr 2004 9:39 AM Description: Asset Descriptors should be able to be written in human readable xhtml with the important elements highlighted using ID's. The xhtml should be digitally signed. --------------------------------------------------------------------- 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-06 16:37:38
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/test/org/neuclear/asset/controllers/currency Modified Files: CurrencyTests.java Added Files: IssuanceTests.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: CurrencyTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency/CurrencyTests.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CurrencyTests.java 5 Apr 2004 22:08:24 -0000 1.8 --- CurrencyTests.java 6 Apr 2004 16:24:35 -0000 1.9 *************** *** 18,21 **** --- 18,22 ---- import org.neuclear.exchange.orders.builders.ExchangeCompletionOrderBuilder; import org.neuclear.exchange.orders.builders.ExchangeOrderBuilder; + import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.SignedNamedObject; import org.neuclear.id.builders.Builder; *************** *** 94,98 **** } ! public void testExchangeOrderAndCancel() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { fundAccount(); double alicebalance = ledger.getBalance(getAlice().getName()); --- 95,99 ---- } ! public void testExchangeOrderAndCancelByOwner() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { fundAccount(); double alicebalance = ledger.getBalance(getAlice().getName()); *************** *** 115,118 **** --- 116,164 ---- } + public void testExchangeOrderAndCancelByAgent() 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 = processAgent(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 testFailOnExchangeOrderAndCancelByBaddie() 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() + 8000), 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 { + SignedNamedObject cr = processHacker(new CancelExchangeOrderBuilder((ExchangeOrderReceipt) receipt)); + assertTrue(false); + } catch (InvalidNamedObjectException e) { + assertTrue(true); + } + assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); + assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); + assertAudit(getAlice().getName()); + } + public void testExchangeOrderAndComplete() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { fundAccount(); *************** *** 129,133 **** assertAudit(getAlice().getName()); ! SignedNamedObject cr = process(new ExchangeCompletionOrderBuilder((ExchangeOrderReceipt) receipt, new Date(), getBob().getName(), new Amount(18), "done")); assertNotNull(cr); assertTrue(cr instanceof ExchangeCompletedReceipt); --- 175,179 ---- assertAudit(getAlice().getName()); ! SignedNamedObject cr = processAgent(new ExchangeCompletionOrderBuilder((ExchangeOrderReceipt) receipt, new Date(), getBob().getName(), new Amount(18), "done")); assertNotNull(cr); assertTrue(cr instanceof ExchangeCompletedReceipt); *************** *** 137,140 **** --- 183,242 ---- } + public void testFailOnExchangeOrderAndCompleteByOwner() 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()); + + try { + SignedNamedObject cr = process(new ExchangeCompletionOrderBuilder((ExchangeOrderReceipt) receipt, new Date(), getBob().getName(), new Amount(18), "done")); + assertTrue(false); + } catch (InvalidNamedObjectException e) { + assertTrue(true); + } catch (InvalidTransferException e) { + assertTrue(true); + } + + assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); + assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); + assertAudit(getAlice().getName()); + } + + public void testFailOnExchangeOrderAndCompleteByBaddie() 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()); + + try { + SignedNamedObject cr = processHacker(new ExchangeCompletionOrderBuilder((ExchangeOrderReceipt) receipt, new Date(), getBob().getName(), new Amount(18), "done")); + assertTrue(false); + } catch (InvalidNamedObjectException e) { + assertTrue(true); + } catch (InvalidTransferException e) { + assertTrue(true); + } + + assertEquals(alicebalance, ledger.getBalance(getAlice().getName()), 0); + assertEquals(alicebalance - 20, ledger.getAvailableBalance(getAlice().getName()), 0); + assertAudit(getAlice().getName()); + } + private SignedNamedObject process(Builder builder) throws NeuClearException { final SignedNamedObject obj = builder.convert("neu://alice@test", getSigner()); *************** *** 143,146 **** --- 245,261 ---- } + private SignedNamedObject processAgent(Builder builder) throws NeuClearException { + final SignedNamedObject obj = builder.convert("neu://bob@test", getSigner()); + + return auditor.receive(proc.receive(obj)); + } + + private SignedNamedObject processHacker(Builder builder) throws NeuClearException { + final SignedNamedObject obj = builder.convert("neu://test", getSigner()); + + return auditor.receive(proc.receive(obj)); + } + + public Asset createTestAsset() throws NeuClearException { AssetBuilder builder = new AssetBuilder("http://bux.neuclear.org", --- NEW FILE: IssuanceTests.java --- 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.IssueReceipt; import org.neuclear.asset.orders.builders.IssueOrderBuilder; import org.neuclear.commons.NeuClearException; import org.neuclear.id.InvalidNamedObjectException; 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; /** * In this unit test Alice is the Issuer. */ public final class IssuanceTests extends AbstractSigningTest { public IssuanceTests(final String s) throws LowlevelLedgerException, GeneralSecurityException, NeuClearException { super(s); asset = createTestAsset(); ledger = new SimpleLedger("test"); proc = new CurrencyController(ledger, asset, getSigner(), "neu://test/bux"); auditLedger = new SimpleLedger("auditor"); auditor = new Auditor(asset, auditLedger); } public void testSimpleIssuance() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { // Sanity Check assertAudit(getBob().getName()); assertAudit(getAlice().getName()); double issuerBalance = ledger.getBalance(getAlice().getName()); double bobBalance = ledger.getBalance(getBob().getName()); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); final int amount = 1000; Builder builder = new IssueOrderBuilder(asset, getBob(), new Amount(amount), "fund"); SignedNamedObject receipt = process(builder); assertNotNull(receipt); assertTrue(receipt instanceof IssueReceipt); assertEquals(issuerBalance - amount, ledger.getAvailableBalance(getAlice().getName()), 0); assertEquals(issuerBalance - amount, ledger.getBalance(getAlice().getName()), 0); assertEquals(bobBalance + amount, ledger.getAvailableBalance(getBob().getName()), 0); assertEquals(bobBalance + amount, ledger.getBalance(getBob().getName()), 0); assertAudit(getBob().getName()); assertAudit(getAlice().getName()); assertTrue(ledger.isBalanced()); assertTrue(auditLedger.isBalanced()); } /* public void testNegativeIssuance() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { // Sanity Check assertAudit(getBob().getName()); assertAudit(getAlice().getName()); double issuerBalance = ledger.getBalance(getAlice().getName()); double bobBalance = ledger.getBalance(getBob().getName()); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); final int amount = -1000; Builder builder = new IssueOrderBuilder(asset, getBob(), new Amount(amount), "fund"); SignedNamedObject receipt = process(builder); assertNotNull(receipt); assertTrue(receipt instanceof IssueReceipt); assertEquals(issuerBalance - amount, ledger.getAvailableBalance(getAlice().getName()), 0); assertEquals(issuerBalance - amount, ledger.getBalance(getAlice().getName()), 0); assertEquals(bobBalance + amount, ledger.getAvailableBalance(getBob().getName()), 0); assertEquals(bobBalance + amount, ledger.getBalance(getBob().getName()), 0); assertAudit(getBob().getName()); assertAudit(getAlice().getName()); assertTrue(ledger.isBalanced()); assertTrue(auditLedger.isBalanced()); } */ public void testFailOnIllegalIssuance() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { // Sanity Check assertAudit(getBob().getName()); assertAudit(getAlice().getName()); double issuerBalance = ledger.getBalance(getAlice().getName()); double bobBalance = ledger.getBalance(getBob().getName()); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); final int amount = 1000; try { Builder builder = new IssueOrderBuilder(asset, getAlice(), new Amount(amount), "fund"); SignedNamedObject receipt = processIlegal(builder); assertNull(receipt); assertFalse(receipt instanceof IssueReceipt); assertTrue(false); } catch (InvalidNamedObjectException e) { assertTrue(true); } catch (InvalidTransferException e) { assertTrue(true); } assertEquals(issuerBalance, ledger.getAvailableBalance(getAlice().getName()), 0); assertEquals(issuerBalance, ledger.getBalance(getAlice().getName()), 0); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); assertEquals(bobBalance, ledger.getBalance(getBob().getName()), 0); assertAudit(getBob().getName()); assertAudit(getAlice().getName()); assertTrue(ledger.isBalanced()); assertTrue(auditLedger.isBalanced()); } public void testFailOnIllegalNegativeIssuance() throws InvalidTransferException, NeuClearException, InvalidTransactionException, LowlevelLedgerException { // Sanity Check assertAudit(getBob().getName()); assertAudit(getAlice().getName()); double issuerBalance = ledger.getBalance(getAlice().getName()); double bobBalance = ledger.getBalance(getBob().getName()); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); final int amount = -1000; try { Builder builder = new IssueOrderBuilder(asset, getAlice(), new Amount(amount), "fund"); SignedNamedObject receipt = processIlegal(builder); assertNull(receipt); assertFalse(receipt instanceof IssueReceipt); assertTrue(false); } catch (InvalidNamedObjectException e) { assertTrue(true); } catch (InvalidTransferException e) { assertTrue(true); } assertEquals(issuerBalance, ledger.getAvailableBalance(getAlice().getName()), 0); assertEquals(issuerBalance, ledger.getBalance(getAlice().getName()), 0); assertEquals(bobBalance, ledger.getAvailableBalance(getBob().getName()), 0); assertEquals(bobBalance, ledger.getBalance(getBob().getName()), 0); assertAudit(getBob().getName()); assertAudit(getAlice().getName()); assertTrue(ledger.isBalanced()); assertTrue(auditLedger.isBalanced()); } public void assertAudit(String name) throws LowlevelLedgerException { assertEquals(auditLedger.getBalance(name), ledger.getBalance(name), 0); assertEquals(auditLedger.getAvailableBalance(name), ledger.getAvailableBalance(name), 0); } private SignedNamedObject process(Builder builder) throws NeuClearException { final SignedNamedObject obj = builder.convert("neu://alice@test", getSigner()); return auditor.receive(proc.receive(obj)); } private SignedNamedObject processIlegal(Builder builder) throws NeuClearException { final SignedNamedObject obj = builder.convert("neu://bob@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()); } private Receiver proc; private Ledger ledger; private Ledger auditLedger; private Auditor auditor; private Asset asset; } |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:38
|
Update of /cvsroot/neuclear/neuclear-pay/src/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/schemas Modified Files: xfer.xsd Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: xfer.xsd =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/schemas/xfer.xsd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xfer.xsd 11 Jan 2004 00:39:06 -0000 1.6 --- xfer.xsd 6 Apr 2004 16:24:34 -0000 1.7 *************** *** 3,6 **** --- 3,11 ---- $Id$ $Log$ + Revision 1.7 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.6 2004/01/11 00:39:06 pelle Cleaned up the schemas even more they now all verifiy. *************** *** 43,47 **** xmlns:id="http://neuclear.org/neu/neuid.xsd" elementFormDefault="qualified" version="0.3" id="xfer"> ! <xs:import namespace="http://neuclear.org/neu/neuid.xsd" schemaLocation="../../../neuclear-id/src/schemas/neuid.xsd" /> <xs:element name="Asset" type="id:NamedObjectReference" nillable="false"/> --- 48,52 ---- xmlns:id="http://neuclear.org/neu/neuid.xsd" elementFormDefault="qualified" version="0.3" id="xfer"> ! <xs:import namespace="http://neuclear.org/neu/neuid.xsd" schemaLocation="../../../neuclear-id/src/schemas/neuid.xsd"/> <xs:element name="Asset" type="id:NamedObjectReference" nillable="false"/> *************** *** 68,72 **** <xs:element ref="Asset" minOccurs="1" maxOccurs="1"/> <xs:element ref="Value" minOccurs="1" maxOccurs="1"/> ! <xs:element ref="Comment" minOccurs="0" maxOccurs="1"/> <xs:group ref="id:SignedObjectGroup" minOccurs="0" maxOccurs="1"/> </xs:sequence> --- 73,77 ---- <xs:element ref="Asset" minOccurs="1" maxOccurs="1"/> <xs:element ref="Value" minOccurs="1" maxOccurs="1"/> ! <xs:element ref="Comment" minOccurs="0" maxOccurs="1"/> <xs:group ref="id:SignedObjectGroup" minOccurs="0" maxOccurs="1"/> </xs:sequence> *************** *** 75,79 **** <xs:element name="TransferReceipt" nillable="false"> ! <xs:complexType > <xs:sequence> <xs:element ref="ValueTime" minOccurs="1" maxOccurs="1"/> --- 80,84 ---- <xs:element name="TransferReceipt" nillable="false"> ! <xs:complexType> <xs:sequence> <xs:element ref="ValueTime" minOccurs="1" maxOccurs="1"/> *************** *** 84,86 **** --- 89,114 ---- </xs:complexType> </xs:element> + + <xs:element name="IssueOrder" nillable="false"> + <xs:complexType> + <xs:sequence> + <xs:element ref="Recipient" minOccurs="1" maxOccurs="1"/> + <xs:element ref="Asset" minOccurs="1" maxOccurs="1"/> + <xs:element ref="Value" minOccurs="1" maxOccurs="1"/> + <xs:element ref="Comment" minOccurs="0" maxOccurs="1"/> + <xs:group ref="id:SignedObjectGroup" minOccurs="0" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="IssueReceipt" nillable="false"> + <xs:complexType> + <xs:sequence> + <xs:element ref="ValueTime" minOccurs="1" maxOccurs="1"/> + <xs:element ref="Value" minOccurs="0" maxOccurs="1"/> + <xs:element ref="IssueOrder" minOccurs="1" maxOccurs="1"/> + <xs:group ref="id:SignedObjectGroup" minOccurs="0" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> </xs:schema> |
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/exchange/orders Modified Files: CancelExchangeOrder.java ExchangeCompletionOrder.java ExchangeOrder.java ExchangeTransactionContract.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: CancelExchangeOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/CancelExchangeOrder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CancelExchangeOrder.java 5 Apr 2004 16:31:43 -0000 1.6 --- CancelExchangeOrder.java 6 Apr 2004 16:24:34 -0000 1.7 *************** *** 38,45 **** throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + ExchangeOrderGlobals.NS_EXCHANGE.getURI()); ! if (elem.getName().equals(ExchangeOrderGlobals.CANCEL_TAGNAME)) ! return new CancelExchangeOrder(core, ! (ExchangeOrderReceipt) TransferGlobals.parseEmbedded(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_RCPT_TAGNAME))); ! throw new InvalidNamedObjectException(core.getName(), "Not Matched"); } --- 38,48 ---- throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + ExchangeOrderGlobals.NS_EXCHANGE.getURI()); ! if (elem.getName().equals(ExchangeOrderGlobals.CANCEL_TAGNAME)) { ! final ExchangeOrderReceipt receipt = (ExchangeOrderReceipt) TransferGlobals.parseEmbedded(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_RCPT_TAGNAME)); ! if (core.getSignatory().getName().equals(receipt.getOrder().getSignatory().getName()) ! || core.getSignatory().getPublicKey().equals(receipt.getOrder().getAgent().getServiceKey())) ! return new CancelExchangeOrder(core, receipt); ! throw new InvalidNamedObjectException("Signer does not have permission to Cancel"); ! } throw new InvalidNamedObjectException(core.getName(), "Not Matched"); } Index: ExchangeCompletionOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeCompletionOrder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExchangeCompletionOrder.java 5 Apr 2004 16:31:43 -0000 1.8 --- ExchangeCompletionOrder.java 6 Apr 2004 16:24:34 -0000 1.9 *************** *** 65,74 **** if (elem.getName().equals(ExchangeOrderGlobals.COMPLETE_TAGNAME)) { ! return new ExchangeCompletionOrder(core, ! (ExchangeOrderReceipt) TransferGlobals.parseEmbedded(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_RCPT_TAGNAME)), ! TransferGlobals.parseRecipientTag(elem), ! TransferGlobals.parseValueTag(elem), ! TransferGlobals.parseTimeStampElement(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_TIME_TAGNAME)), ! TransferGlobals.parseCommentElement(elem)); } throw new InvalidNamedObjectException(core.getName(), "Not Matched"); --- 65,78 ---- if (elem.getName().equals(ExchangeOrderGlobals.COMPLETE_TAGNAME)) { ! final ExchangeOrderReceipt receipt = (ExchangeOrderReceipt) TransferGlobals.parseEmbedded(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_RCPT_TAGNAME)); ! if (core.getSignatory().getPublicKey().equals(receipt.getOrder().getAgent().getServiceKey())) ! return new ExchangeCompletionOrder(core, ! receipt, ! TransferGlobals.parseRecipientTag(elem), ! TransferGlobals.parseValueTag(elem), ! TransferGlobals.parseTimeStampElement(elem, ExchangeOrderGlobals.createQName(ExchangeOrderGlobals.EXCHANGE_TIME_TAGNAME)), ! TransferGlobals.parseCommentElement(elem)); ! throw new InvalidNamedObjectException("Signer does not have permission to Complete"); ! } throw new InvalidNamedObjectException(core.getName(), "Not Matched"); Index: ExchangeTransactionContract.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeTransactionContract.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExchangeTransactionContract.java 5 Apr 2004 16:31:43 -0000 1.3 --- ExchangeTransactionContract.java 6 Apr 2004 16:24:34 -0000 1.4 *************** *** 1,7 **** package org.neuclear.exchange.orders; import org.neuclear.asset.orders.AssetTransactionContract; import org.neuclear.exchange.contracts.ExchangeAgent; - import org.neuclear.id.Service; import org.neuclear.id.SignedNamedCore; --- 1,7 ---- package org.neuclear.exchange.orders; + import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.orders.AssetTransactionContract; import org.neuclear.exchange.contracts.ExchangeAgent; import org.neuclear.id.SignedNamedCore; *************** *** 26,29 **** --- 26,34 ---- $Id$ $Log$ + Revision 1.4 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.3 2004/04/05 16:31:43 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. *************** *** 48,52 **** */ public abstract class ExchangeTransactionContract extends AssetTransactionContract { ! ExchangeTransactionContract(SignedNamedCore core, Service asset, ExchangeAgent agent) { super(core, asset); this.agent = agent; --- 53,57 ---- */ public abstract class ExchangeTransactionContract extends AssetTransactionContract { ! ExchangeTransactionContract(SignedNamedCore core, Asset asset, ExchangeAgent agent) { super(core, asset); this.agent = agent; Index: ExchangeOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeOrder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExchangeOrder.java 5 Apr 2004 16:31:43 -0000 1.8 --- ExchangeOrder.java 6 Apr 2004 16:24:34 -0000 1.9 *************** *** 2,5 **** --- 2,6 ---- import org.dom4j.Element; + import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.orders.TransferGlobals; import org.neuclear.asset.orders.Value; *************** *** 19,23 **** public final class ExchangeOrder extends ExchangeTransactionContract { private ExchangeOrder(final SignedNamedCore core, ! final Service bidAsset, final ExchangeAgent agent, final Value amount, BidItem items[], final String comment, final Date expires) { super(core, bidAsset, agent); --- 20,24 ---- public final class ExchangeOrder extends ExchangeTransactionContract { private ExchangeOrder(final SignedNamedCore core, ! final Asset bidAsset, final ExchangeAgent agent, final Value amount, BidItem items[], final String comment, final Date expires) { super(core, bidAsset, agent); |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:38
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/asset Modified Files: AssetController.java Auditor.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: AssetController.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/AssetController.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AssetController.java 5 Apr 2004 16:31:42 -0000 1.15 --- AssetController.java 6 Apr 2004 16:24:34 -0000 1.16 *************** *** 1,4 **** --- 1,6 ---- package org.neuclear.asset; + import org.neuclear.asset.orders.IssueOrder; + import org.neuclear.asset.orders.IssueReceipt; import org.neuclear.asset.orders.TransferOrder; import org.neuclear.asset.orders.TransferReceipt; *************** *** 30,33 **** --- 32,40 ---- $Id$ $Log$ + Revision 1.16 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.15 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. *************** *** 130,133 **** --- 137,142 ---- if (contract instanceof TransferOrder) return process((TransferOrder) contract); + if (contract instanceof IssueOrder) + return process((IssueOrder) contract); if (contract instanceof ExchangeOrder) return process((ExchangeOrder) contract); *************** *** 168,171 **** --- 177,191 ---- /** + * Issues an asset. Thus moving assets into circulation + * + * @param req IssueOrder + * @return Unsigned Receipt + * @throws LowLevelPaymentException + * @throws TransferDeniedException + * @throws InvalidTransferException + */ + public abstract IssueReceipt process(IssueOrder req) throws LowLevelPaymentException, TransferDeniedException, InvalidTransferException, NeuClearException; + + /** * Creates a HeldTransfer. This gives the recipient right within a limited period to "complete" the Transfer. * Completion means performing the actual transfer with an amount up to but not greater than the amount set in the Index: Auditor.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/Auditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Auditor.java 5 Apr 2004 22:54:05 -0000 1.3 --- Auditor.java 6 Apr 2004 16:24:34 -0000 1.4 *************** *** 2,5 **** --- 2,7 ---- import org.neuclear.asset.contracts.Asset; + import org.neuclear.asset.orders.IssueOrder; + import org.neuclear.asset.orders.IssueReceipt; import org.neuclear.asset.orders.TransferOrder; import org.neuclear.asset.orders.TransferReceipt; *************** *** 32,35 **** --- 34,42 ---- $Id$ $Log$ + Revision 1.4 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.3 2004/04/05 22:54:05 pelle API changes in Ledger to support Auditor and CurrencyController in Pay *************** *** 144,153 **** if (contract instanceof TransferReceipt) process((TransferReceipt) contract); if (contract instanceof ExchangeOrderReceipt) process((ExchangeOrderReceipt) contract); if (contract instanceof ExchangeCompletedReceipt) process((ExchangeCompletedReceipt) contract); - if (contract instanceof TransferOrder) - process((TransferOrder) contract); if (contract instanceof ExchangeOrder) process((ExchangeOrder) contract); --- 151,160 ---- if (contract instanceof TransferReceipt) process((TransferReceipt) contract); + if (contract instanceof TransferOrder) + process((TransferOrder) contract); if (contract instanceof ExchangeOrderReceipt) process((ExchangeOrderReceipt) contract); if (contract instanceof ExchangeCompletedReceipt) process((ExchangeCompletedReceipt) contract); if (contract instanceof ExchangeOrder) process((ExchangeOrder) contract); *************** *** 156,159 **** --- 163,170 ---- if (contract instanceof CancelExchangeReceipt) process((CancelExchangeReceipt) contract); + if (contract instanceof IssueReceipt) + process((IssueReceipt) contract); + if (contract instanceof IssueOrder) + process((IssueOrder) contract); } catch (LowLevelPaymentException e) { throw new NeuClearException(e); *************** *** 194,197 **** --- 205,234 ---- } + public final void process(final IssueReceipt receipt) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { + try { + final IssueOrder req = receipt.getOrder(); + if (req.getSignatory().getPublicKey().equals(asset.getIssuerKey())) { + 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); + } + } + + public final void process(final IssueOrder req) throws InvalidTransferException, LowLevelPaymentException { + try { + if (req.getSignatory().getPublicKey().equals(asset.getIssuerKey())) + 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 { *************** *** 257,261 **** private final Ledger ledger; ! private final Service asset; } --- 294,298 ---- private final Ledger ledger; ! private final Asset asset; } |
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/asset/orders Modified Files: AssetTransactionContract.java TransferGlobals.java TransferOrder.java Added Files: IssueOrder.java IssueReceipt.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: TransferOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferOrder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TransferOrder.java 5 Apr 2004 16:31:41 -0000 1.8 --- TransferOrder.java 6 Apr 2004 16:24:34 -0000 1.9 *************** *** 2,7 **** import org.dom4j.Element; import org.neuclear.asset.contracts.AssetGlobals; ! import org.neuclear.id.*; /** --- 2,11 ---- import org.dom4j.Element; + import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.contracts.AssetGlobals; ! import org.neuclear.id.InvalidNamedObjectException; ! import org.neuclear.id.NamedObjectReader; ! import org.neuclear.id.SignedNamedCore; ! import org.neuclear.id.SignedNamedObject; /** *************** *** 12,16 **** public final class TransferOrder extends AssetTransactionContract { ! private TransferOrder(final SignedNamedCore core, final Service asset, final String recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; --- 16,20 ---- public final class TransferOrder extends AssetTransactionContract { ! private TransferOrder(final SignedNamedCore core, final Asset asset, final String recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; --- NEW FILE: IssueReceipt.java --- package org.neuclear.asset.orders; import org.dom4j.Element; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NamedObjectReader; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; import java.sql.Timestamp; import java.util.Date; /** * User: pelleb * Date: Jul 21, 2003 * Time: 5:37:10 PM */ public class IssueReceipt extends AssetTransactionContract { private IssueReceipt(final SignedNamedCore core, final IssueOrder order, final Date valuetime) { super(core, order.getAsset()); this.valuetime = valuetime.getTime(); this.order = order; } public final IssueOrder getOrder() { return order; } public final Date getValueTime() { return new Timestamp(valuetime); } private final long valuetime; private final IssueOrder order; public static final class Reader implements NamedObjectReader { /** * Read object from Element and fill in its details * * @param elem * @return */ public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().getURI().equals(TransferGlobals.XFER_NSURI)) throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + TransferGlobals.XFER_NSURI); if (!elem.getName().equals(TransferGlobals.ISSUE_RCPT_TAGNAME)) throw new InvalidNamedObjectException(core.getName(), "Incorrect XML Tagname for reader: " + TransferGlobals.ISSUE_RCPT_TAGNAME); return new IssueReceipt(core, (IssueOrder) TransferGlobals.parseEmbedded(elem, TransferGlobals.createQName(TransferGlobals.ISSUE_TAGNAME)), TransferGlobals.parseValueTimeElement(elem)); } } } Index: TransferGlobals.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferGlobals.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TransferGlobals.java 5 Apr 2004 16:31:41 -0000 1.10 --- TransferGlobals.java 6 Apr 2004 16:24:34 -0000 1.11 *************** *** 35,38 **** --- 35,43 ---- $Id$ $Log$ + Revision 1.11 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.10 2004/04/05 16:31:41 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. *************** *** 194,197 **** --- 199,204 ---- VerifyingReader.getInstance().registerReader(TransferGlobals.XFER_TAGNAME, new TransferOrder.Reader()); VerifyingReader.getInstance().registerReader(TransferGlobals.XFER_RCPT_TAGNAME, new TransferReceipt.Reader()); + VerifyingReader.getInstance().registerReader(TransferGlobals.ISSUE_TAGNAME, new IssueOrder.Reader()); + VerifyingReader.getInstance().registerReader(TransferGlobals.ISSUE_RCPT_TAGNAME, new IssueReceipt.Reader()); } *************** *** 290,293 **** --- 297,302 ---- public static final String XFER_TAGNAME = "TransferOrder"; public static final String XFER_RCPT_TAGNAME = "TransferReceipt"; + public static final String ISSUE_TAGNAME = "IssueOrder"; + public static final String ISSUE_RCPT_TAGNAME = "IssueReceipt"; public static final String XFER_NSPREFIX = "xfer"; public static final String XFER_NSURI = "http://neuclear.org/neu/xfer.xsd"; --- NEW FILE: IssueOrder.java --- package org.neuclear.asset.orders; import org.dom4j.Element; import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.contracts.AssetGlobals; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NamedObjectReader; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; /** * User: pelleb * Date: Jul 21, 2003 * Time: 5:35:26 PM */ public final class IssueOrder extends AssetTransactionContract { private IssueOrder(final SignedNamedCore core, final Asset asset, final String recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; this.comment = comment; this.recipient = recipient; } public final String getRecipient() { return recipient; } public final Value getAmount() { return amount; } public final String getComment() { return comment; } private final String recipient; private final Value amount; private final String comment; public static final class Reader implements NamedObjectReader { /** * Read object from Element and fill in its details * * @param elem * @return */ public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().getURI().equals(TransferGlobals.XFER_NSURI)) throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + AssetGlobals.NS_ASSET.getURI()); if (!elem.getName().equals(TransferGlobals.ISSUE_TAGNAME)) throw new InvalidNamedObjectException(core.getName(), "Incorrect XML Tagname for reader: " + TransferGlobals.XFER_TAGNAME); final Asset asset = TransferGlobals.parseAssetTag(elem); if (asset.getIssuerKey() != null && core.getSignatory().getPublicKey().equals(asset.getIssuerKey())) return new IssueOrder(core, asset, TransferGlobals.parseRecipientTag(elem), TransferGlobals.parseValueTag(elem), TransferGlobals.parseCommentElement(elem)); throw new InvalidNamedObjectException(core.getSignatory().getName() + " is not the issuer for asset: " + asset.getName()); } } } Index: AssetTransactionContract.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/AssetTransactionContract.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssetTransactionContract.java 5 Apr 2004 16:31:41 -0000 1.3 --- AssetTransactionContract.java 6 Apr 2004 16:24:34 -0000 1.4 *************** *** 1,5 **** package org.neuclear.asset.orders; ! import org.neuclear.id.Service; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; --- 1,5 ---- package org.neuclear.asset.orders; ! import org.neuclear.asset.contracts.Asset; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; *************** *** 12,18 **** * $Id$ * $Log$ * Revision 1.3 2004/04/05 16:31:41 pelle * Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. ! * * Revision 1.2 2004/01/10 00:00:45 pelle * Implemented new Schema for Transfer* --- 12,23 ---- * $Id$ * $Log$ + * Revision 1.4 2004/04/06 16:24:34 pelle + * Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + * Added Issuance support to the Asset and Audit Controllers. + * Implemented access control for complete and cancel exchange orders. + * * Revision 1.3 2004/04/05 16:31:41 pelle * Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. ! * <p/> * Revision 1.2 2004/01/10 00:00:45 pelle * Implemented new Schema for Transfer* *************** *** 90,96 **** */ public abstract class AssetTransactionContract extends SignedNamedObject { ! private final Service asset; ! protected AssetTransactionContract(final SignedNamedCore core, final Service asset) { super(core); this.asset = asset; --- 95,101 ---- */ public abstract class AssetTransactionContract extends SignedNamedObject { ! private final Asset asset; ! protected AssetTransactionContract(final SignedNamedCore core, final Asset asset) { super(core); this.asset = asset; *************** *** 98,102 **** ! public final Service getAsset() { return asset; } --- 103,107 ---- ! public final Asset getAsset() { return asset; } |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:37
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/asset/controllers/currency Modified Files: CurrencyController.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: CurrencyController.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/controllers/currency/CurrencyController.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CurrencyController.java 5 Apr 2004 22:54:04 -0000 1.23 --- CurrencyController.java 6 Apr 2004 16:24:33 -0000 1.24 *************** *** 3,8 **** --- 3,11 ---- import org.neuclear.asset.*; import org.neuclear.asset.contracts.Asset; + import org.neuclear.asset.orders.IssueOrder; + import org.neuclear.asset.orders.IssueReceipt; import org.neuclear.asset.orders.TransferOrder; import org.neuclear.asset.orders.TransferReceipt; + import org.neuclear.asset.orders.builders.IssueReceiptBuilder; import org.neuclear.asset.orders.builders.TransferReceiptBuilder; import org.neuclear.commons.NeuClearException; *************** *** 60,63 **** --- 63,97 ---- } + /** + * Issues an asset. Thus moving assets into circulation + * + * @param req IssueOrder + * @return Unsigned Receipt + * @throws org.neuclear.asset.LowLevelPaymentException + * + * @throws org.neuclear.asset.TransferDeniedException + * + * @throws org.neuclear.asset.InvalidTransferException + * + */ + public IssueReceipt process(IssueOrder req) throws LowLevelPaymentException, TransferDeniedException, InvalidTransferException, NeuClearException { + try { + if (!req.getSignatory().getName().equals(issuerBook)) + throw new InvalidTransferException("Only Issuer is allowed to issue"); + final PostedTransaction posted = ledger.transfer(req.getDigest(), req.getSignatory().getName(), req.getRecipient(), req.getAmount().getAmount(), req.getComment()); + final IssueReceipt receipt = (IssueReceipt) new IssueReceiptBuilder(req, posted.getTransactionTime()).convert(alias, signer); + ledger.setReceiptId(req.getDigest(), receipt.getDigest()); + return receipt; + } catch (LowlevelLedgerException e) { + throw new LowLevelPaymentException(e); + } catch (InvalidTransactionException e) { + throw new InvalidTransferException(e); + } catch (NegativeTransferException e) { + throw new InvalidTransferException("postive amount"); + } catch (UnknownTransactionException e) { + throw new LowLevelPaymentException(e); + } + } + public final ExchangeOrderReceipt process(final ExchangeOrder req) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { *************** *** 81,84 **** --- 115,120 ---- public final ExchangeCompletedReceipt process(final ExchangeCompletionOrder complete) throws LowLevelPaymentException, InvalidTransferException, TransferDeniedException, NeuClearException { try { + if (!complete.getSignatory().getPublicKey().equals(complete.getReceipt().getOrder().getAgent().getServiceKey())) + throw new InvalidTransferException("Only Agent is allowed to Sign Completion Order"); PostedTransaction tran = ledger.complete(complete.getReceipt().getOrder().getDigest(), complete.getAmount().getAmount(), complete.getComment()); ExchangeCompletedReceipt receipt = (ExchangeCompletedReceipt) new ExchangeCompletedReceiptBuilder(complete, tran.getTransactionTime()).convert(alias, signer); *************** *** 97,103 **** 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); --- 133,142 ---- public final CancelExchangeReceipt process(final CancelExchangeOrder cancel) throws InvalidTransferException, LowLevelPaymentException, TransferDeniedException, NeuClearException { + if (!(cancel.getSignatory().getName().equals(cancel.getReceipt().getOrder().getSignatory().getName()) + || cancel.getSignatory().getPublicKey().equals(cancel.getReceipt().getOrder().getAgent().getServiceKey()))) + throw new InvalidTransferException("Only Agent is allowed to Sign Completion Order"); try { ! final Date time = ledger.cancel(cancel.getReceipt().getOrder().getDigest()); ! return (CancelExchangeReceipt) new CancelExchangeReceiptBuilder(cancel, time).convert(alias, signer); } catch (LowlevelLedgerException e) { throw new LowLevelPaymentException(e); |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:26
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/orders/builders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/test/org/neuclear/asset/orders/builders Added Files: IssueOrderBuilderTest.java IssueReceiptBuilderTest.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. --- NEW FILE: IssueOrderBuilderTest.java --- package org.neuclear.asset.orders.builders; import org.neuclear.asset.InvalidTransferException; import org.neuclear.asset.contracts.builders.AssetBuilder; import org.neuclear.asset.orders.Amount; import org.neuclear.asset.orders.IssueOrder; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.crypto.signers.NonExistingSignerException; import org.neuclear.id.Service; import org.neuclear.id.SignedNamedObject; import org.neuclear.id.builders.Builder; import org.neuclear.tests.AbstractObjectCreationTest; import org.neuclear.xml.XMLException; import java.security.GeneralSecurityException; /* NeuClear Distributed Transaction Clearing Platform (C) 2003 Pelle Braendgaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: IssueOrderBuilderTest.java,v 1.1 2004/04/06 16:24:35 pelle Exp $ $Log: IssueOrderBuilderTest.java,v $ Revision 1.1 2004/04/06 16:24:35 pelle Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Revision 1.7 2004/04/05 16:31:43 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. Revision 1.6 2004/04/02 23:04:36 pelle Got TransferOrder and Builder working with their test cases. Working on TransferReceipt which is the first embedded receipt. This is causing some problems at the moment. Revision 1.5 2004/04/02 17:56:16 pelle Added new createTestAsset() method. Revision 1.4 2004/04/01 23:18:33 pelle Split Identity into Signatory and Identity class. Identity remains a signed named object and will in the future just be used for self declared information. Signatory now contains the PublicKey etc and is NOT a signed object. Revision 1.3 2004/03/03 23:28:14 pelle Updated tests to use AbstractObjectCreationTest Revision 1.2 2004/02/18 00:13:31 pelle Many, many clean ups. I've readded Targets in a new method. Gotten rid of NamedObjectBuilder and revamped Identity and Resolvers Revision 1.1 2004/01/21 23:41:02 pelle Started the unit tests for the new payment message format. */ /** * User: pelleb * Date: Jan 21, 2004 * Time: 9:11:44 PM */ public class IssueOrderBuilderTest extends AbstractObjectCreationTest { public IssueOrderBuilderTest(String string) throws NeuClearException, GeneralSecurityException { super(string); asset = createTestAsset(); } protected void verifyObject(SignedNamedObject obj) throws NonExistingSignerException { assertNotNull(obj); assertTrue(obj instanceof IssueOrder); IssueOrder order = (IssueOrder) obj; assertEquals(asset.getDigest(), order.getAsset().getDigest()); assertEquals(getSigner().getPublicKey("neu://test").getEncoded(), order.getSignatory().getPublicKey().getEncoded()); // assertEquals(getBob().getPublicKey().getEncoded(), order.getRecipient().getSignatory().getPublicKey().getEncoded()); assertEquals("Test", order.getComment()); assertEquals(20.0, order.getAmount().getAmount(), 0); } protected Class getRequiredClass() { return IssueOrder.class; } protected Builder createBuilder() throws NeuClearException, InvalidTransferException, XMLException { Builder builder = new IssueOrderBuilder(asset, getAlice(), new Amount(20), "Test"); // System.out.println(builder.asXML()); return builder; } public Service createTestAsset() throws NeuClearException { AssetBuilder builder = new AssetBuilder("http://bux.neuclear.org", getSigner().getPublicKey("neu://test/bux"), getSigner().getPublicKey(NAME), 2, 0); return (Service) builder.convert(NAME, getSigner()); } private Service asset; } --- NEW FILE: IssueReceiptBuilderTest.java --- package org.neuclear.asset.orders.builders; import org.neuclear.asset.InvalidTransferException; import org.neuclear.asset.contracts.builders.AssetBuilder; import org.neuclear.asset.orders.Amount; import org.neuclear.asset.orders.IssueOrder; import org.neuclear.asset.orders.IssueReceipt; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.crypto.signers.NonExistingSignerException; import org.neuclear.id.Service; import org.neuclear.id.SignedNamedObject; import org.neuclear.id.builders.Builder; import org.neuclear.tests.AbstractObjectCreationTest; import org.neuclear.xml.XMLException; import java.security.GeneralSecurityException; import java.util.Date; /* NeuClear Distributed Transaction Clearing Platform (C) 2003 Pelle Braendgaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: IssueReceiptBuilderTest.java,v 1.1 2004/04/06 16:24:35 pelle Exp $ $Log: IssueReceiptBuilderTest.java,v $ Revision 1.1 2004/04/06 16:24:35 pelle Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Revision 1.2 2004/04/05 16:31:43 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. Revision 1.1 2004/04/02 23:04:36 pelle Got TransferOrder and Builder working with their test cases. Working on TransferReceipt which is the first embedded receipt. This is causing some problems at the moment. Revision 1.5 2004/04/02 17:56:16 pelle Added new createTestAsset() method. Revision 1.4 2004/04/01 23:18:33 pelle Split Identity into Signatory and Identity class. Identity remains a signed named object and will in the future just be used for self declared information. Signatory now contains the PublicKey etc and is NOT a signed object. Revision 1.3 2004/03/03 23:28:14 pelle Updated tests to use AbstractObjectCreationTest Revision 1.2 2004/02/18 00:13:31 pelle Many, many clean ups. I've readded Targets in a new method. Gotten rid of NamedObjectBuilder and revamped Identity and Resolvers Revision 1.1 2004/01/21 23:41:02 pelle Started the unit tests for the new payment message format. */ /** * User: pelleb * Date: Jan 21, 2004 * Time: 9:11:44 PM */ public class IssueReceiptBuilderTest extends AbstractObjectCreationTest { public IssueReceiptBuilderTest(String string) throws NeuClearException, GeneralSecurityException { super(string); asset = createTestAsset(); } protected void verifyObject(SignedNamedObject obj) throws NonExistingSignerException { assertNotNull(obj); assertTrue(obj instanceof IssueReceipt); IssueReceipt receipt = (IssueReceipt) obj; assertNotNull(receipt.getValueTime()); assertEquals(asset.getDigest(), receipt.getAsset().getDigest()); assertEquals(getSigner().getPublicKey("neu://test").getEncoded(), receipt.getSignatory().getPublicKey().getEncoded()); IssueOrder order = receipt.getOrder(); assertNotNull(order); assertEquals(asset.getDigest(), order.getAsset().getDigest()); assertEquals(getSigner().getPublicKey("neu://test").getEncoded(), order.getSignatory().getPublicKey().getEncoded()); assertEquals("Test", order.getComment()); assertEquals(20.0, order.getAmount().getAmount(), 0); } protected Class getRequiredClass() { return IssueReceipt.class; } protected Builder createBuilder() throws NeuClearException, InvalidTransferException, XMLException { Builder builder = new IssueOrderBuilder(asset, getAlice(), new Amount(20), "Test"); // System.out.println(builder.asXML()); return new IssueReceiptBuilder((IssueOrder) builder.convert(NAME, getSigner()), new Date()); } public Service createTestAsset() throws NeuClearException { AssetBuilder builder = new AssetBuilder("http://bux.neuclear.org", getSigner().getPublicKey("neu://test/bux"), getSigner().getPublicKey("neu://test"), 2, 0); return (Service) builder.convert(NAME, getSigner()); } private Service asset; } |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:26
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/receiver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/test/org/neuclear/asset/receiver Removed Files: PaymentReceiverTest.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. --- PaymentReceiverTest.java DELETED --- |
|
From: Pelle B. <pe...@us...> - 2004-04-06 16:37:25
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/builders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/asset/orders/builders Added Files: IssueOrderBuilder.java IssueReceiptBuilder.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. --- NEW FILE: IssueOrderBuilder.java --- package org.neuclear.asset.orders.builders; import org.dom4j.Element; import org.neuclear.asset.InvalidTransferException; import org.neuclear.asset.NegativeTransferException; import org.neuclear.asset.orders.TransferGlobals; import org.neuclear.asset.orders.Value; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; import org.neuclear.id.Service; import org.neuclear.id.Signatory; import org.neuclear.id.builders.Builder; /* NeuClear Distributed Transaction Clearing Platform (C) 2003 Pelle Braendgaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: IssueOrderBuilder.java,v 1.1 2004/04/06 16:24:34 pelle Exp $ $Log: IssueOrderBuilder.java,v $ Revision 1.1 2004/04/06 16:24:34 pelle Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Revision 1.6 2004/04/05 16:31:41 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. Revision 1.5 2004/04/02 23:04:35 pelle Got TransferOrder and Builder working with their test cases. Working on TransferReceipt which is the first embedded receipt. This is causing some problems at the moment. Revision 1.4 2004/02/18 00:13:30 pelle Many, many clean ups. I've readded Targets in a new method. Gotten rid of NamedObjectBuilder and revamped Identity and Resolvers Revision 1.3 2004/01/13 15:11:17 pelle Now builds. Now need to do unit tests Revision 1.2 2004/01/12 22:39:14 pelle Completed all the builders and contracts. Added a new abstract Value class to contain either an amount or a list of serial numbers. Now ready to finish off the AssetControllers. Revision 1.1 2004/01/11 00:39:06 pelle Cleaned up the schemas even more they now all verifiy. The Order/Receipt pairs for neuclear pay, should now work. They all have Readers using the latest Schema. The TransferBuilders are done and the ExchangeBuilders are nearly there. The new EmbeddedSignedNamedObject builder is useful for creating new Receipts. The new ReceiptBuilder uses this to create the embedded transaction. ExchangeOrders now have the concept of BidItem's, you could create an ExchangeOrder bidding on various items at the same time, to be exchanged as one atomic multiparty exchange. Still doesnt build yet, but very close now ;-) Revision 1.2 2004/01/10 00:00:44 pelle Implemented new Schema for Transfer* Working on it for Exchange*, so far all Receipts are implemented. Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML. Changed SignedNamedObject.getDigest() from byte array to String. The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there. Revision 1.1 2004/01/05 23:47:09 pelle Create new Document classification "order", which is really just inherint in the new package layout. Got rid of much of the inheritance that was lying around and thought a bit further about the format of the exchange orders. Revision 1.9 2004/01/03 20:36:25 pelle Renamed HeldTransfer to Exchange Dropped valuetime from the request objects. Doesnt yet compile. New commit to follow soon. Revision 1.8 2003/12/06 00:16:10 pelle Updated various areas in NSTools. Updated URI Validation in particular to support new expanded format Updated createUniqueID and friends to be a lot more unique and more efficient. In CryptoTools updated getRandom() to finally use a SecureRandom. Changed CryptoTools.getFormatURLSafe to getBase36 because that is what it really is. Revision 1.7 2003/11/28 00:11:50 pelle Getting the NeuClear web transactions working. Revision 1.6 2003/11/21 04:43:03 pelle EncryptedFileStore now works. It uses the PBECipher with DES3 afair. Otherwise You will Finaliate. Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final. This should hopefully make everything more stable (and secure). Revision 1.5 2003/11/12 23:47:04 pelle Much work done in creating good test environment. PaymentReceiverTest works, but needs a abit more work in its environment to succeed testing. Revision 1.4 2003/11/11 21:17:19 pelle Further vital reshuffling. org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. Did a bit of work on the Canonicalizer and changed a few other minor bits. Revision 1.3 2003/11/10 17:42:07 pelle The AssetController interface has been more or less finalized. CurrencyController fully implemented AssetControlClient implementes a remote client for communicating with AssetControllers Revision 1.2 2003/11/09 03:26:47 pelle More house keeping and shuffling about mainly pay Revision 1.1 2003/11/09 03:10:13 pelle Major changes that apparently didnt get properly checked in earlier. Revision 1.2 2003/11/06 23:47:43 pelle Major Refactoring of CurrencyController. Factored out AssetController to be new abstract parent class together with most of its support classes. Created (Half way) AssetControlClient, which can perform transactions on external AssetControllers via NeuClear. Created the first attempt at the ExchangeAgent. This will need use of the AssetControlClient. SOAPTools was changed to return a stream. This is required by the VerifyingReader in NeuClear. Revision 1.1 2003/10/03 23:48:29 pelle Did various security related updates in the pay package with regards to immutability of fields etc. AssetControllerReceiver should now be operational. Real testing needs to be done including in particular setting the private key of the Receiver. A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes. TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating TransferRequests for signing. TransferReceiptBuilder has been created for use by Transfer processors. It is used in the AssetControllerReceiver. */ /** * User: pelleb * Date: Oct 3, 2003 * Time: 3:13:27 PM */ public class IssueOrderBuilder extends Builder { public IssueOrderBuilder(final Service asset, final Signatory recipient, final Value amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException { this(asset.getName(), recipient.getName(), amount, comment); } public IssueOrderBuilder(final String assetname, final String recipient, final Value amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException { super(TransferGlobals.createQName(TransferGlobals.ISSUE_TAGNAME)); if (amount.getAmount() < 0) throw new NegativeTransferException(amount); if (assetname == null) throw new InvalidTransferException("assetName"); if (recipient == null) throw new InvalidTransferException("to"); final Element element = getElement(); element.add(TransferGlobals.createElement(TransferGlobals.RECIPIENT_TAG, recipient)); element.add(TransferGlobals.createElement(TransferGlobals.ASSET_TAG, assetname)); element.add(TransferGlobals.createValueTag(amount)); if (!Utility.isEmpty(comment)) element.add(TransferGlobals.createElement(TransferGlobals.COMMENT_TAG, comment)); } } --- NEW FILE: IssueReceiptBuilder.java --- package org.neuclear.asset.orders.builders; import org.neuclear.asset.InvalidTransferException; import org.neuclear.asset.NegativeTransferException; import org.neuclear.asset.orders.IssueOrder; import org.neuclear.asset.orders.TransferGlobals; import org.neuclear.commons.NeuClearException; import java.util.Date; /* NeuClear Distributed Transaction Clearing Platform (C) 2003 Pelle Braendgaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: IssueReceiptBuilder.java,v 1.1 2004/04/06 16:24:34 pelle Exp $ $Log: IssueReceiptBuilder.java,v $ Revision 1.1 2004/04/06 16:24:34 pelle Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Revision 1.4 2004/01/12 22:39:14 pelle Completed all the builders and contracts. Added a new abstract Value class to contain either an amount or a list of serial numbers. Now ready to finish off the AssetControllers. Revision 1.3 2004/01/11 00:39:06 pelle Cleaned up the schemas even more they now all verifiy. The Order/Receipt pairs for neuclear pay, should now work. They all have Readers using the latest Schema. The TransferBuilders are done and the ExchangeBuilders are nearly there. The new EmbeddedSignedNamedObject builder is useful for creating new Receipts. The new ReceiptBuilder uses this to create the embedded transaction. ExchangeOrders now have the concept of BidItem's, you could create an ExchangeOrder bidding on various items at the same time, to be exchanged as one atomic multiparty exchange. Still doesnt build yet, but very close now ;-) Revision 1.2 2004/01/10 00:00:45 pelle Implemented new Schema for Transfer* Working on it for Exchange*, so far all Receipts are implemented. Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML. Changed SignedNamedObject.getDigest() from byte array to String. The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there. Revision 1.1 2004/01/05 23:47:09 pelle Create new Document classification "order", which is really just inherint in the new package layout. Got rid of much of the inheritance that was lying around and thought a bit further about the format of the exchange orders. Revision 1.5 2004/01/03 20:36:25 pelle Renamed HeldTransfer to Exchange Dropped valuetime from the request objects. Doesnt yet compile. New commit to follow soon. Revision 1.4 2003/11/21 04:43:03 pelle EncryptedFileStore now works. It uses the PBECipher with DES3 afair. Otherwise You will Finaliate. Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final. This should hopefully make everything more stable (and secure). Revision 1.3 2003/11/10 17:42:07 pelle The AssetController interface has been more or less finalized. CurrencyController fully implemented AssetControlClient implementes a remote client for communicating with AssetControllers Revision 1.2 2003/11/09 03:26:47 pelle More house keeping and shuffling about mainly pay Revision 1.1 2003/11/09 03:10:13 pelle Major changes that apparently didnt get properly checked in earlier. Revision 1.2 2003/11/06 23:47:43 pelle Major Refactoring of CurrencyController. Factored out AssetController to be new abstract parent class together with most of its support classes. Created (Half way) AssetControlClient, which can perform transactions on external AssetControllers via NeuClear. Created the first attempt at the ExchangeAgent. This will need use of the AssetControlClient. SOAPTools was changed to return a stream. This is required by the VerifyingReader in NeuClear. Revision 1.1 2003/10/03 23:48:29 pelle Did various security related updates in the pay package with regards to immutability of fields etc. AssetControllerReceiver should now be operational. Real testing needs to be done including in particular setting the private key of the Receiver. A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes. TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating TransferRequests for signing. TransferReceiptBuilder has been created for use by Transfer processors. It is used in the AssetControllerReceiver. */ /** * User: pelleb * Date: Oct 3, 2003 * Time: 6:28:26 PM */ public class IssueReceiptBuilder extends ReceiptBuilder { public IssueReceiptBuilder(final IssueOrder req, Date valuetime) throws InvalidTransferException, NegativeTransferException, NeuClearException { super(TransferGlobals.createQName(TransferGlobals.ISSUE_RCPT_TAGNAME), req, valuetime); } } |
|
From: <bug...@ve...> - 2004-04-06 16:35:35
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED 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 9:34 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-06 16:35:34
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-42 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-42 Summary: create unit tests for testing access control of CancelExchange and CompleteExchange Type: Test Case Status: Closed Priority: Major Resolution: FIXED 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 9:05 AM Updated: Tue, 6 Apr 2004 9:34 AM Description: We need to test that the following is possible: - Agent can Complete Exchange - Agent can Cancel Exchange - Owner can Cancel Exchange and that the following FAILS: - Owner can NOT Complete Exchange - That a person who is not the owner nor the Agent can NOT Complete Exchange - That a person who is not the owner nor the Agent can NOT Cancel Exchange --------------------------------------------------------------------- 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 16:07:37
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/PAY-42 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-42 Summary: create unit tests for testing access control of CancelExchange and CompleteExchange Type: Test Case 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 9:05 AM Updated: Tue, 6 Apr 2004 9:05 AM Description: We need to test that the following is possible: - Agent can Complete Exchange - Agent can Cancel Exchange - Owner can Cancel Exchange and that the following FAILS: - Owner can NOT Complete Exchange - That a person who is not the owner nor the Agent can NOT Complete Exchange - That a person who is not the owner nor the Agent can NOT Cancel Exchange --------------------------------------------------------------------- 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 16:03:33
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED 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 9: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 16:01:41
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED 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 9:01 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 16:01:40
|
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.3 Versions: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Mon, 5 Apr 2004 3:16 PM Updated: Tue, 6 Apr 2004 9:00 AM 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: <bug...@ve...> - 2004-04-06 16:01:40
|
The following issue has been updated:
Updater: Pelle Braendgaard (mailto:pe...@ve...)
Date: Tue, 6 Apr 2004 9:00 AM
Changes:
Version changed to 0.3
Version changed from 0.4
Fix Version changed to 0.3
Fix Version changed from 0.4
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.neuclear.org//browse/PAY-34?page=history
---------------------------------------------------------------------
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: Reopened
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: Mon, 5 Apr 2004 3:16 PM
Updated: Tue, 6 Apr 2004 9:00 AM
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: <bug...@ve...> - 2004-04-06 16:01:38
|
Message: The following issue has been reopened. --------------------------------------------------------------------- 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: Reopened 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: Mon, 5 Apr 2004 3:16 PM Updated: Tue, 6 Apr 2004 9:00 AM 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: <bug...@ve...> - 2004-04-06 15:46:33
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED 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:45 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:31:36
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: 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:57 AM Updated: Tue, 6 Apr 2004 8:29 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 15:29:36
|
Message: The following issue has been closed. --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED 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 8:29 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 |