Browse Source

refactor .storage and .external to .io

bwt
Craig Raw 5 years ago
parent
commit
14aa328f6d
  1. 2
      src/main/java/com/sparrowwallet/sparrow/AppController.java
  2. 2
      src/main/java/com/sparrowwallet/sparrow/control/DeviceAccordion.java
  3. 4
      src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java
  4. 2
      src/main/java/com/sparrowwallet/sparrow/control/KeystoreFileImportPane.java
  5. 6
      src/main/java/com/sparrowwallet/sparrow/control/KeystoreImportAccordion.java
  6. 6
      src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java
  7. 3
      src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java
  8. 2
      src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java
  9. 2
      src/main/java/com/sparrowwallet/sparrow/io/Device.java
  10. 2
      src/main/java/com/sparrowwallet/sparrow/io/Electrum.java
  11. 2
      src/main/java/com/sparrowwallet/sparrow/io/Export.java
  12. 2
      src/main/java/com/sparrowwallet/sparrow/io/ExportException.java
  13. 5
      src/main/java/com/sparrowwallet/sparrow/io/Hwi.java
  14. 2
      src/main/java/com/sparrowwallet/sparrow/io/Import.java
  15. 2
      src/main/java/com/sparrowwallet/sparrow/io/ImportException.java
  16. 2
      src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileImport.java
  17. 2
      src/main/java/com/sparrowwallet/sparrow/io/KeystoreImport.java
  18. 2
      src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicImport.java
  19. 2
      src/main/java/com/sparrowwallet/sparrow/io/MultisigWalletImport.java
  20. 2
      src/main/java/com/sparrowwallet/sparrow/io/SinglesigWalletImport.java
  21. 2
      src/main/java/com/sparrowwallet/sparrow/io/Storage.java
  22. 2
      src/main/java/com/sparrowwallet/sparrow/io/WalletExport.java
  23. 6
      src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwAirgappedController.java
  24. 2
      src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java
  25. 4
      src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbScanController.java
  26. 2
      src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportController.java
  27. 4
      src/main/java/com/sparrowwallet/sparrow/keystoreimport/SwController.java
  28. 2
      src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java
  29. 2
      src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java
  30. 4
      src/test/java/com/sparrowwallet/sparrow/io/ColdcardSinglesigTest.java
  31. 2
      src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java
  32. 4
      src/test/java/com/sparrowwallet/sparrow/io/ImportExportTest.java
  33. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-1.txt
  34. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-2.txt
  35. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-multideriv.txt
  36. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-1.json
  37. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-2.json
  38. 0
      src/test/resources/com/sparrowwallet/sparrow/io/cc-wallet-dump.txt
  39. 0
      src/test/resources/com/sparrowwallet/sparrow/io/electrum-multisig-wallet.json
  40. 0
      src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json

2
src/main/java/com/sparrowwallet/sparrow/AppController.java

@ -17,7 +17,7 @@ import com.sparrowwallet.sparrow.control.WalletNameDialog;
import com.sparrowwallet.sparrow.event.TabEvent;
import com.sparrowwallet.sparrow.event.TransactionTabChangedEvent;
import com.sparrowwallet.sparrow.event.TransactionTabSelectedEvent;
import com.sparrowwallet.sparrow.storage.Storage;
import com.sparrowwallet.sparrow.io.Storage;
import com.sparrowwallet.sparrow.transaction.TransactionController;
import com.sparrowwallet.sparrow.wallet.SettingsController;
import com.sparrowwallet.sparrow.wallet.WalletController;

2
src/main/java/com/sparrowwallet/sparrow/control/DeviceAccordion.java

@ -1,7 +1,7 @@
package com.sparrowwallet.sparrow.control;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.external.Device;
import com.sparrowwallet.sparrow.io.Device;
import javafx.collections.ObservableList;
import javafx.scene.control.Accordion;

4
src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java

@ -8,8 +8,8 @@ import com.sparrowwallet.drongo.wallet.KeystoreSource;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.EventManager;
import com.sparrowwallet.sparrow.event.KeystoreImportEvent;
import com.sparrowwallet.sparrow.external.Device;
import com.sparrowwallet.sparrow.external.Hwi;
import com.sparrowwallet.sparrow.io.Device;
import com.sparrowwallet.sparrow.io.Hwi;
import com.sparrowwallet.drongo.wallet.WalletModel;
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
import javafx.application.Platform;

2
src/main/java/com/sparrowwallet/sparrow/control/KeystoreFileImportPane.java

@ -5,7 +5,7 @@ import com.sparrowwallet.drongo.wallet.Keystore;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.EventManager;
import com.sparrowwallet.sparrow.event.KeystoreImportEvent;
import com.sparrowwallet.sparrow.external.KeystoreFileImport;
import com.sparrowwallet.sparrow.io.KeystoreFileImport;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.geometry.Pos;

6
src/main/java/com/sparrowwallet/sparrow/control/KeystoreImportAccordion.java

@ -1,9 +1,9 @@
package com.sparrowwallet.sparrow.control;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.external.KeystoreFileImport;
import com.sparrowwallet.sparrow.external.KeystoreImport;
import com.sparrowwallet.sparrow.external.KeystoreMnemonicImport;
import com.sparrowwallet.sparrow.io.KeystoreFileImport;
import com.sparrowwallet.sparrow.io.KeystoreImport;
import com.sparrowwallet.sparrow.io.KeystoreMnemonicImport;
import javafx.collections.ObservableList;
import javafx.scene.control.Accordion;

6
src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java

@ -2,19 +2,15 @@ package com.sparrowwallet.sparrow.control;
import com.sparrowwallet.sparrow.AppController;
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
import com.sparrowwallet.sparrow.storage.Storage;
import com.sparrowwallet.sparrow.io.Storage;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import org.controlsfx.control.textfield.CustomTextField;
import org.controlsfx.control.textfield.TextFields;
import org.controlsfx.glyphfont.FontAwesome;
import org.controlsfx.glyphfont.Glyph;
import org.controlsfx.glyphfont.GlyphFont;
import org.controlsfx.glyphfont.GlyphFontRegistry;
import org.controlsfx.validation.ValidationResult;
import org.controlsfx.validation.ValidationSupport;
import org.controlsfx.validation.Validator;

3
src/main/java/com/sparrowwallet/sparrow/external/ColdcardMultisig.java → src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.CharStreams;
import com.google.gson.Gson;
@ -12,7 +12,6 @@ import com.sparrowwallet.drongo.wallet.Keystore;
import com.sparrowwallet.drongo.wallet.KeystoreSource;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.drongo.wallet.WalletModel;
import com.sparrowwallet.sparrow.storage.Storage;
import java.io.*;
import java.util.HashSet;

2
src/main/java/com/sparrowwallet/sparrow/external/ColdcardSinglesig.java → src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.CharStreams;
import com.sparrowwallet.drongo.ExtendedPublicKey;

2
src/main/java/com/sparrowwallet/sparrow/external/Device.java → src/main/java/com/sparrowwallet/sparrow/io/Device.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.wallet.WalletModel;

2
src/main/java/com/sparrowwallet/sparrow/external/Electrum.java → src/main/java/com/sparrowwallet/sparrow/io/Electrum.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;

2
src/main/java/com/sparrowwallet/sparrow/external/Export.java → src/main/java/com/sparrowwallet/sparrow/io/Export.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
public interface Export {
String getName();

2
src/main/java/com/sparrowwallet/sparrow/external/ExportException.java → src/main/java/com/sparrowwallet/sparrow/io/ExportException.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
public class ExportException extends Throwable {
public ExportException() {

5
src/main/java/com/sparrowwallet/sparrow/external/Hwi.java → src/main/java/com/sparrowwallet/sparrow/io/Hwi.java

@ -1,11 +1,8 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.ByteStreams;
import com.google.common.io.CharStreams;
import com.google.gson.*;
import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.drongo.protocol.ScriptType;
import com.sparrowwallet.drongo.wallet.Keystore;
import com.sparrowwallet.drongo.wallet.WalletModel;
import javafx.concurrent.Service;
import javafx.concurrent.Task;

2
src/main/java/com/sparrowwallet/sparrow/external/Import.java → src/main/java/com/sparrowwallet/sparrow/io/Import.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
public interface Import {
String getName();

2
src/main/java/com/sparrowwallet/sparrow/external/ImportException.java → src/main/java/com/sparrowwallet/sparrow/io/ImportException.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
public class ImportException extends Exception {
public ImportException() {

2
src/main/java/com/sparrowwallet/sparrow/external/KeystoreFileImport.java → src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileImport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.protocol.ScriptType;
import com.sparrowwallet.drongo.wallet.Keystore;

2
src/main/java/com/sparrowwallet/sparrow/external/KeystoreImport.java → src/main/java/com/sparrowwallet/sparrow/io/KeystoreImport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.drongo.wallet.WalletModel;

2
src/main/java/com/sparrowwallet/sparrow/external/KeystoreMnemonicImport.java → src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicImport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.protocol.ScriptType;
import com.sparrowwallet.drongo.wallet.Keystore;

2
src/main/java/com/sparrowwallet/sparrow/external/MultisigWalletImport.java → src/main/java/com/sparrowwallet/sparrow/io/MultisigWalletImport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.wallet.Wallet;

2
src/main/java/com/sparrowwallet/sparrow/external/SinglesigWalletImport.java → src/main/java/com/sparrowwallet/sparrow/io/SinglesigWalletImport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.protocol.ScriptType;
import com.sparrowwallet.drongo.wallet.Wallet;

2
src/main/java/com/sparrowwallet/sparrow/storage/Storage.java → src/main/java/com/sparrowwallet/sparrow/io/Storage.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.storage;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.ByteStreams;
import com.google.gson.*;

2
src/main/java/com/sparrowwallet/sparrow/external/WalletExport.java → src/main/java/com/sparrowwallet/sparrow/io/WalletExport.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.wallet.Wallet;

6
src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwAirgappedController.java

@ -2,9 +2,9 @@ package com.sparrowwallet.sparrow.keystoreimport;
import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.sparrow.control.KeystoreImportAccordion;
import com.sparrowwallet.sparrow.external.ColdcardMultisig;
import com.sparrowwallet.sparrow.external.ColdcardSinglesig;
import com.sparrowwallet.sparrow.external.KeystoreImport;
import com.sparrowwallet.sparrow.io.ColdcardMultisig;
import com.sparrowwallet.sparrow.io.ColdcardSinglesig;
import com.sparrowwallet.sparrow.io.KeystoreImport;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;

2
src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java

@ -1,7 +1,7 @@
package com.sparrowwallet.sparrow.keystoreimport;
import com.sparrowwallet.sparrow.control.DeviceAccordion;
import com.sparrowwallet.sparrow.external.Device;
import com.sparrowwallet.sparrow.io.Device;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;

4
src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbScanController.java

@ -1,7 +1,7 @@
package com.sparrowwallet.sparrow.keystoreimport;
import com.sparrowwallet.sparrow.external.Device;
import com.sparrowwallet.sparrow.external.Hwi;
import com.sparrowwallet.sparrow.io.Device;
import com.sparrowwallet.sparrow.io.Hwi;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;

2
src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportController.java

@ -3,7 +3,7 @@ package com.sparrowwallet.sparrow.keystoreimport;
import com.sparrowwallet.drongo.wallet.KeystoreSource;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.AppController;
import com.sparrowwallet.sparrow.external.Device;
import com.sparrowwallet.sparrow.io.Device;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;

4
src/main/java/com/sparrowwallet/sparrow/keystoreimport/SwController.java

@ -1,8 +1,8 @@
package com.sparrowwallet.sparrow.keystoreimport;
import com.sparrowwallet.sparrow.control.KeystoreImportAccordion;
import com.sparrowwallet.sparrow.external.Electrum;
import com.sparrowwallet.sparrow.external.KeystoreImport;
import com.sparrowwallet.sparrow.io.Electrum;
import com.sparrowwallet.sparrow.io.KeystoreImport;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;

2
src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java

@ -2,7 +2,7 @@ package com.sparrowwallet.sparrow.wallet;
import com.sparrowwallet.drongo.crypto.ECKey;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.storage.Storage;
import com.sparrowwallet.sparrow.io.Storage;
import java.io.File;
import java.io.IOException;

2
src/test/java/com/sparrowwallet/sparrow/external/ColdcardMultisigTest.java → src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.ByteStreams;
import com.sparrowwallet.drongo.ExtendedPublicKey;

4
src/test/java/com/sparrowwallet/sparrow/external/ColdcardSinglesigTest.java → src/test/java/com/sparrowwallet/sparrow/io/ColdcardSinglesigTest.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.drongo.protocol.ScriptType;
@ -10,7 +10,7 @@ public class ColdcardSinglesigTest extends ImportExportTest {
@Test
public void testImport() throws ImportException {
ColdcardSinglesig ccSingleSig = new ColdcardSinglesig();
Wallet wallet = ccSingleSig.importWallet(getInputStream("cc-wallet-dump.txt"), ScriptType.P2PKH);
Wallet wallet = ccSingleSig.importWallet(ScriptType.P2PKH, getInputStream("cc-wallet-dump.txt"));
Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType());
Assert.assertEquals("Coldcard 3D88D0CF", wallet.getName());

2
src/test/java/com/sparrowwallet/sparrow/external/ElectrumTest.java → src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java

@ -1,4 +1,4 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import com.google.common.io.ByteStreams;
import com.sparrowwallet.drongo.policy.PolicyType;

4
src/test/java/com/sparrowwallet/sparrow/external/ImportExportTest.java → src/test/java/com/sparrowwallet/sparrow/io/ImportExportTest.java

@ -1,10 +1,10 @@
package com.sparrowwallet.sparrow.external;
package com.sparrowwallet.sparrow.io;
import java.io.InputStream;
public class ImportExportTest {
protected InputStream getInputStream(String filename) {
return this.getClass().getResourceAsStream("/com/sparrowwallet/sparrow/external/" + filename);
return this.getClass().getResourceAsStream("/com/sparrowwallet/sparrow/io/" + filename);
}
}

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-1.txt → src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-1.txt

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-2.txt → src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-2.txt

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-multideriv.txt → src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-multideriv.txt

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-1.json → src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-1.json

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-2.json → src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-2.json

0
src/test/resources/com/sparrowwallet/sparrow/external/cc-wallet-dump.txt → src/test/resources/com/sparrowwallet/sparrow/io/cc-wallet-dump.txt

0
src/test/resources/com/sparrowwallet/sparrow/external/electrum-multisig-wallet.json → src/test/resources/com/sparrowwallet/sparrow/io/electrum-multisig-wallet.json

0
src/test/resources/com/sparrowwallet/sparrow/external/electrum-singlesig-wallet.json → src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json

Loading…
Cancel
Save