[Webfunds-commits] java/webfunds/client/sox SOXWallet.java

Jeroen C. van Gelderen gelderen@cypherpunks.ai
Sun, 4 Jun 2000 15:57:33 -0400 (AST)


gelderen    00/06/04 15:57:33

  Modified:    webfunds/client/sox SOXWallet.java
  Log:
  - Reorder imports.
  - Implement getAccounts2() that returns an Account[].
  - Make use of AddressBook optional for makeDeposit().
  
  The last two are hacks and will be done properly when SOXWallet is split
  in a low and highlevel wallet.

Revision  Changes    Path
1.117     +39 -10    java/webfunds/client/sox/SOXWallet.java

Index: SOXWallet.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/sox/SOXWallet.java,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- SOXWallet.java	2000/05/28 02:59:56	1.116
+++ SOXWallet.java	2000/06/04 19:57:32	1.117
@@ -1,4 +1,4 @@
-/* $Id: SOXWallet.java,v 1.116 2000/05/28 02:59:56 iang Exp $
+/* $Id: SOXWallet.java,v 1.117 2000/06/04 19:57:32 gelderen Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -6,20 +6,22 @@
 package webfunds.client.sox;
 
 
-import java.util.*;
-import java.io.*;
+import java.awt.event.ActionEvent;
 import java.beans.*;
+import java.io.*;
 import java.net.*;
-import java.awt.event.ActionEvent;
+import java.util.*;
 
-import webfunds.sox.*;
-import webfunds.utils.Debug;
-import webfunds.utils.Hex;
-import webfunds.ricardian.ContractStore;
+import webfunds.client.*;
 import webfunds.ricardian.Contract;
+import webfunds.ricardian.ContractStore;
 import webfunds.ricardian.SOXServerException;
-import webfunds.client.*;
+import webfunds.sox.*;
 import webfunds.store.*;
+import webfunds.utils.Debug;
+import webfunds.utils.Hex;
+import webfunds.utils.Panic;
+
 
 /**
  *  The GUI Wallet.
@@ -335,6 +337,20 @@
         return retval;
     }
 
+
+    public Account[] getAccounts2()
+    {
+        try
+        {
+            return this.accountStore.getAllAccounts();
+        }
+        catch(Exception e)
+        {
+            throw new Panic("Cannot obtain accounts :-(");
+        }
+    }
+
+
     public ItemId[] getContracts(AccountInfo account)
     {
         Account acct;
@@ -518,10 +534,18 @@
         return null;
     }
 
+
+    public void makeDeposit(byte[] payment, AccountInfo callerAc, byte[] desc)
+    {
+        makeDeposit(payment, callerAc, desc, true);
+    }
+
+
     /**
      *  Client Wallet Interface
      */
-    public void makeDeposit(byte[] payment, AccountInfo callerAc, byte[] desc)
+    public void makeDeposit(byte[] payment, AccountInfo callerAc, byte[] desc,
+                            boolean useAddressBook)
     {
         byte[] buf = decodeSOXPayment(payment);
         if (buf == null)
@@ -739,6 +763,10 @@
             statString += "\n    (subAccount made in " + ac + ")";
         }
 
+
+        if( useAddressBook )
+        {
+
         byte[] srcId = pss.getId();     // already checked
         AccountInfo source;
         source = context.getAddressbook(this).getInfo(srcId);
@@ -762,6 +790,7 @@
 
         aviso("Deposit from " + name + " is Good:\n" + statString);
 
+        } // useAddressBook
         internalUpdate(sub, mails);
 
         return ;