From 14aa328f6d6b1983ef295736839a291d58574427 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 30 Apr 2020 09:27:14 +0200 Subject: [PATCH] refactor .storage and .external to .io --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 2 +- .../com/sparrowwallet/sparrow/control/DeviceAccordion.java | 2 +- .../java/com/sparrowwallet/sparrow/control/DevicePane.java | 4 ++-- .../sparrow/control/KeystoreFileImportPane.java | 2 +- .../sparrow/control/KeystoreImportAccordion.java | 6 +++--- .../com/sparrowwallet/sparrow/control/WalletNameDialog.java | 6 +----- .../sparrow/{external => io}/ColdcardMultisig.java | 3 +-- .../sparrow/{external => io}/ColdcardSinglesig.java | 2 +- .../com/sparrowwallet/sparrow/{external => io}/Device.java | 2 +- .../sparrowwallet/sparrow/{external => io}/Electrum.java | 2 +- .../com/sparrowwallet/sparrow/{external => io}/Export.java | 2 +- .../sparrow/{external => io}/ExportException.java | 2 +- .../com/sparrowwallet/sparrow/{external => io}/Hwi.java | 5 +---- .../com/sparrowwallet/sparrow/{external => io}/Import.java | 2 +- .../sparrow/{external => io}/ImportException.java | 2 +- .../sparrow/{external => io}/KeystoreFileImport.java | 2 +- .../sparrow/{external => io}/KeystoreImport.java | 2 +- .../sparrow/{external => io}/KeystoreMnemonicImport.java | 2 +- .../sparrow/{external => io}/MultisigWalletImport.java | 2 +- .../sparrow/{external => io}/SinglesigWalletImport.java | 2 +- .../com/sparrowwallet/sparrow/{storage => io}/Storage.java | 2 +- .../sparrow/{external => io}/WalletExport.java | 2 +- .../sparrow/keystoreimport/HwAirgappedController.java | 6 +++--- .../sparrow/keystoreimport/HwUsbDevicesController.java | 2 +- .../sparrow/keystoreimport/HwUsbScanController.java | 4 ++-- .../sparrow/keystoreimport/KeystoreImportController.java | 2 +- .../sparrowwallet/sparrow/keystoreimport/SwController.java | 4 ++-- .../java/com/sparrowwallet/sparrow/wallet/WalletForm.java | 2 +- .../sparrow/{external => io}/ColdcardMultisigTest.java | 2 +- .../sparrow/{external => io}/ColdcardSinglesigTest.java | 4 ++-- .../sparrow/{external => io}/ElectrumTest.java | 2 +- .../sparrow/{external => io}/ImportExportTest.java | 4 ++-- .../sparrow/{external => io}/cc-multisig-export-1.txt | 0 .../sparrow/{external => io}/cc-multisig-export-2.txt | 0 .../{external => io}/cc-multisig-export-multideriv.txt | 0 .../sparrow/{external => io}/cc-multisig-keystore-1.json | 0 .../sparrow/{external => io}/cc-multisig-keystore-2.json | 0 .../sparrow/{external => io}/cc-wallet-dump.txt | 0 .../sparrow/{external => io}/electrum-multisig-wallet.json | 0 .../sparrow/{external => io}/electrum-singlesig-wallet.json | 0 40 files changed, 41 insertions(+), 49 deletions(-) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/ColdcardMultisig.java (98%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/ColdcardSinglesig.java (98%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/Device.java (96%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/Electrum.java (99%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/Export.java (53%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/ExportException.java (89%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/Hwi.java (97%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/Import.java (53%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/ImportException.java (89%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/KeystoreFileImport.java (86%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/KeystoreImport.java (86%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/KeystoreMnemonicImport.java (86%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/MultisigWalletImport.java (84%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/SinglesigWalletImport.java (88%) rename src/main/java/com/sparrowwallet/sparrow/{storage => io}/Storage.java (99%) rename src/main/java/com/sparrowwallet/sparrow/{external => io}/WalletExport.java (85%) rename src/test/java/com/sparrowwallet/sparrow/{external => io}/ColdcardMultisigTest.java (99%) rename src/test/java/com/sparrowwallet/sparrow/{external => io}/ColdcardSinglesigTest.java (89%) rename src/test/java/com/sparrowwallet/sparrow/{external => io}/ElectrumTest.java (99%) rename src/test/java/com/sparrowwallet/sparrow/{external => io}/ImportExportTest.java (70%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-multisig-export-1.txt (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-multisig-export-2.txt (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-multisig-export-multideriv.txt (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-multisig-keystore-1.json (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-multisig-keystore-2.json (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/cc-wallet-dump.txt (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/electrum-multisig-wallet.json (100%) rename src/test/resources/com/sparrowwallet/sparrow/{external => io}/electrum-singlesig-wallet.json (100%) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index c79ab6d8..e8880e2e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DeviceAccordion.java b/src/main/java/com/sparrowwallet/sparrow/control/DeviceAccordion.java index 464fb82c..e73c24db 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DeviceAccordion.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java index e6b6c63e..90b6f3ad 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/KeystoreFileImportPane.java b/src/main/java/com/sparrowwallet/sparrow/control/KeystoreFileImportPane.java index 72ba2a76..59123418 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/KeystoreFileImportPane.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/KeystoreImportAccordion.java b/src/main/java/com/sparrowwallet/sparrow/control/KeystoreImportAccordion.java index 3ab6686f..7a249c71 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/KeystoreImportAccordion.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java index 0ad30324..f795b97c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/ColdcardMultisig.java b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java similarity index 98% rename from src/main/java/com/sparrowwallet/sparrow/external/ColdcardMultisig.java rename to src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java index bcf0860a..1c0cc745 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/ColdcardMultisig.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/ColdcardSinglesig.java b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java similarity index 98% rename from src/main/java/com/sparrowwallet/sparrow/external/ColdcardSinglesig.java rename to src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java index d69cb2a8..a2db8777 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/ColdcardSinglesig.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/Device.java b/src/main/java/com/sparrowwallet/sparrow/io/Device.java similarity index 96% rename from src/main/java/com/sparrowwallet/sparrow/external/Device.java rename to src/main/java/com/sparrowwallet/sparrow/io/Device.java index 041ba30b..85f6b7fd 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/Device.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/Electrum.java b/src/main/java/com/sparrowwallet/sparrow/io/Electrum.java similarity index 99% rename from src/main/java/com/sparrowwallet/sparrow/external/Electrum.java rename to src/main/java/com/sparrowwallet/sparrow/io/Electrum.java index 34841838..5542709f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/Electrum.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/Export.java b/src/main/java/com/sparrowwallet/sparrow/io/Export.java similarity index 53% rename from src/main/java/com/sparrowwallet/sparrow/external/Export.java rename to src/main/java/com/sparrowwallet/sparrow/io/Export.java index 87522d7f..2166bcb7 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/Export.java +++ b/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(); diff --git a/src/main/java/com/sparrowwallet/sparrow/external/ExportException.java b/src/main/java/com/sparrowwallet/sparrow/io/ExportException.java similarity index 89% rename from src/main/java/com/sparrowwallet/sparrow/external/ExportException.java rename to src/main/java/com/sparrowwallet/sparrow/io/ExportException.java index 4cb427c4..fa17cdf2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/ExportException.java +++ b/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() { diff --git a/src/main/java/com/sparrowwallet/sparrow/external/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java similarity index 97% rename from src/main/java/com/sparrowwallet/sparrow/external/Hwi.java rename to src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index 13d1e4d6..47998a1c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/Hwi.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/Import.java b/src/main/java/com/sparrowwallet/sparrow/io/Import.java similarity index 53% rename from src/main/java/com/sparrowwallet/sparrow/external/Import.java rename to src/main/java/com/sparrowwallet/sparrow/io/Import.java index 98cde97c..a6aa364c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/Import.java +++ b/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(); diff --git a/src/main/java/com/sparrowwallet/sparrow/external/ImportException.java b/src/main/java/com/sparrowwallet/sparrow/io/ImportException.java similarity index 89% rename from src/main/java/com/sparrowwallet/sparrow/external/ImportException.java rename to src/main/java/com/sparrowwallet/sparrow/io/ImportException.java index 7290f679..e258f903 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/ImportException.java +++ b/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() { diff --git a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreFileImport.java b/src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileImport.java similarity index 86% rename from src/main/java/com/sparrowwallet/sparrow/external/KeystoreFileImport.java rename to src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileImport.java index f046958c..df4eee9a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreFileImport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreImport.java b/src/main/java/com/sparrowwallet/sparrow/io/KeystoreImport.java similarity index 86% rename from src/main/java/com/sparrowwallet/sparrow/external/KeystoreImport.java rename to src/main/java/com/sparrowwallet/sparrow/io/KeystoreImport.java index d47e50d5..e974f23e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreImport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreMnemonicImport.java b/src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicImport.java similarity index 86% rename from src/main/java/com/sparrowwallet/sparrow/external/KeystoreMnemonicImport.java rename to src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicImport.java index 38481f36..ce4bfec0 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/KeystoreMnemonicImport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/MultisigWalletImport.java b/src/main/java/com/sparrowwallet/sparrow/io/MultisigWalletImport.java similarity index 84% rename from src/main/java/com/sparrowwallet/sparrow/external/MultisigWalletImport.java rename to src/main/java/com/sparrowwallet/sparrow/io/MultisigWalletImport.java index 1fe2d24b..172ee16a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/MultisigWalletImport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/SinglesigWalletImport.java b/src/main/java/com/sparrowwallet/sparrow/io/SinglesigWalletImport.java similarity index 88% rename from src/main/java/com/sparrowwallet/sparrow/external/SinglesigWalletImport.java rename to src/main/java/com/sparrowwallet/sparrow/io/SinglesigWalletImport.java index 8a2beb7c..a3424cc5 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/SinglesigWalletImport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/storage/Storage.java b/src/main/java/com/sparrowwallet/sparrow/io/Storage.java similarity index 99% rename from src/main/java/com/sparrowwallet/sparrow/storage/Storage.java rename to src/main/java/com/sparrowwallet/sparrow/io/Storage.java index 57fa7102..b2bd0771 100644 --- a/src/main/java/com/sparrowwallet/sparrow/storage/Storage.java +++ b/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.*; diff --git a/src/main/java/com/sparrowwallet/sparrow/external/WalletExport.java b/src/main/java/com/sparrowwallet/sparrow/io/WalletExport.java similarity index 85% rename from src/main/java/com/sparrowwallet/sparrow/external/WalletExport.java rename to src/main/java/com/sparrowwallet/sparrow/io/WalletExport.java index 1e92a87f..a0cb6576 100644 --- a/src/main/java/com/sparrowwallet/sparrow/external/WalletExport.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwAirgappedController.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwAirgappedController.java index 4a981d06..cb518a74 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwAirgappedController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java index f7405fb9..5945858a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbScanController.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbScanController.java index 0ad99d4c..157b9387 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbScanController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportController.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportController.java index 3cd171f3..a0070150 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/SwController.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/SwController.java index 27ec6c39..05e29d35 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/SwController.java +++ b/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; diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index 6e997b5f..c9f90f50 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/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; diff --git a/src/test/java/com/sparrowwallet/sparrow/external/ColdcardMultisigTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java similarity index 99% rename from src/test/java/com/sparrowwallet/sparrow/external/ColdcardMultisigTest.java rename to src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java index 504e134b..1e023745 100644 --- a/src/test/java/com/sparrowwallet/sparrow/external/ColdcardMultisigTest.java +++ b/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; diff --git a/src/test/java/com/sparrowwallet/sparrow/external/ColdcardSinglesigTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ColdcardSinglesigTest.java similarity index 89% rename from src/test/java/com/sparrowwallet/sparrow/external/ColdcardSinglesigTest.java rename to src/test/java/com/sparrowwallet/sparrow/io/ColdcardSinglesigTest.java index b1a6f0fa..5ffa16e0 100644 --- a/src/test/java/com/sparrowwallet/sparrow/external/ColdcardSinglesigTest.java +++ b/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()); diff --git a/src/test/java/com/sparrowwallet/sparrow/external/ElectrumTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java similarity index 99% rename from src/test/java/com/sparrowwallet/sparrow/external/ElectrumTest.java rename to src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java index 04e75d3e..fc50b72d 100644 --- a/src/test/java/com/sparrowwallet/sparrow/external/ElectrumTest.java +++ b/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; diff --git a/src/test/java/com/sparrowwallet/sparrow/external/ImportExportTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ImportExportTest.java similarity index 70% rename from src/test/java/com/sparrowwallet/sparrow/external/ImportExportTest.java rename to src/test/java/com/sparrowwallet/sparrow/io/ImportExportTest.java index 4f38121a..d4e088f5 100644 --- a/src/test/java/com/sparrowwallet/sparrow/external/ImportExportTest.java +++ b/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); } } diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-1.txt b/src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-1.txt similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-1.txt rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-1.txt diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-2.txt b/src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-2.txt similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-2.txt rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-2.txt diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-multideriv.txt b/src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-multideriv.txt similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-export-multideriv.txt rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-export-multideriv.txt diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-1.json b/src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-1.json similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-1.json rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-1.json diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-2.json b/src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-2.json similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-multisig-keystore-2.json rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-multisig-keystore-2.json diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/cc-wallet-dump.txt b/src/test/resources/com/sparrowwallet/sparrow/io/cc-wallet-dump.txt similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/cc-wallet-dump.txt rename to src/test/resources/com/sparrowwallet/sparrow/io/cc-wallet-dump.txt diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/electrum-multisig-wallet.json b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-multisig-wallet.json similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/electrum-multisig-wallet.json rename to src/test/resources/com/sparrowwallet/sparrow/io/electrum-multisig-wallet.json diff --git a/src/test/resources/com/sparrowwallet/sparrow/external/electrum-singlesig-wallet.json b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json similarity index 100% rename from src/test/resources/com/sparrowwallet/sparrow/external/electrum-singlesig-wallet.json rename to src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json