[Webfunds-commits] java/webfunds/sox Payment.java

Ian Grigg iang@cypherpunks.ai
Fri, 13 Oct 2000 21:28:11 -0400 (AST)


iang        00/10/13 21:28:11

  Modified:    webfunds/sox Payment.java
  Log:
  dropping old comments on stuff moved over to AbstractPayment;
  more on the versions

Revision  Changes    Path
1.23      +3 -55     java/webfunds/sox/Payment.java

Index: Payment.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Payment.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Payment.java	2000/08/05 13:05:39	1.22
+++ Payment.java	2000/10/14 01:28:11	1.23
@@ -1,5 +1,5 @@
 /*
- * $Id: Payment.java,v 1.22 2000/08/05 13:05:39 iang Exp $
+ * $Id: Payment.java,v 1.23 2000/10/14 01:28:11 iang Exp $
  *
  * Copyright (c) Systemics Inc 1995-2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -25,13 +25,7 @@
  * array for sending to third parties, and similarly,
  * byte arrays are the form in which payments are
  * received.
- *
- * It should be possible for classes to derive from
- * this one, in order to have different functionality,
- * so developers of this class should be sure to cater
- * for derived classes.
  */
-    // this will become Abstract, later on when we add Payment
 public class Payment
     extends AbstractPayment
 {
@@ -75,30 +69,6 @@
      */
     protected AccountId target;
 
-//    /**
-//     *  The type of item (or "currency") of this payment.
-//     *  E.g. "airmiles", "chips", ...
-//     *
-//     *  In pure SOX protocol form, this can be any byte array
-//     *  as encoded in ItemId.  In extant implementations, this
-//     *  will be the message digest of the Ricardian Contract.
-//     */
-//    protected ItemId item;
-//
-//    /**
-//     * The quantity of the item to be transferred between accounts
-//     */
-//    protected long qty;
-//
-//    /**
-//     * A description (can be anything, although very long lengths
-//     * may be refused by some issuers and clients, but at least 2K
-//     * is guaranteed to be supported by all SOX compatible software)
-//     * Note that it can be non-ascii, and non readable.  That's up to
-//     * the client software to deal with.
-//     */
-//    protected byte[] desc;
-
     /**
      * The date from which the payment is valid
      */
@@ -148,17 +118,6 @@
      */
     public boolean isBearer() { return target.isBearer(); }
 
-//    /**
-//     * Get the type of item (or "currency") of the payment
-//     * (e.g. airmiles)
-//     */
-//    public ItemId getItem() { return item2; }
-//
-//    /**
-//     * Get the quantity of the item for the payment
-//     */
-//    public long getQty() { return qty; }
-
     /**
      * Get the date from which the payment is valid
      */
@@ -169,12 +128,6 @@
      */
     public long getValidTill() { return validTill; }
 
-//    /**
-//     * Get the description on the payment
-//     */
-//    public byte[] getDesc() { return desc; }
-
-
     /**
      * Get the signature of the payment
      */
@@ -209,10 +162,6 @@
         this.source = source;
         this.target = target;
 
-//        this.item = item;
-//        this.qty = qty;
-//        this.desc = desc;
-
         this.changekey = changekey;
 
         this.validFrom = validFrom;
@@ -320,10 +269,9 @@
         DataInputStream dis = new DataInputStream(is);
 
         int v = dis.readUnsignedByte();
-        if (v != SINGLETON_VERSION)
+        if (! ((SINGLETON_VERSION <= v) && (v <=PF_VERSION)) )
             throw new SOXPacketException("Invalid version in payment: "+
-                      v + " != " + SINGLETON_VERSION +
-                      "\n(V >= 1 can only be read by PacketFactory)");
+                      v + " != {"+SINGLETON_VERSION+","+PF_VERSION+"}");
         version = v;
 
         int type = dis.readUnsignedByte();