no fingerprint labels and tests

This commit is contained in:
Craig Raw 2020-05-18 17:19:43 +02:00
parent 68aeb5946a
commit 1ed59bb935
6 changed files with 11 additions and 9 deletions

2
drongo

@ -1 +1 @@
Subproject commit 8ffd22500754b77e420e2a3f887864e89a47e906 Subproject commit aa60e6b92e0401a27c3760cc9cb7e726a2caa845

View file

@ -19,15 +19,15 @@ public class KeystorePassphraseDialog extends Dialog<String> {
final DialogPane dialogPane = getDialogPane(); final DialogPane dialogPane = getDialogPane();
setTitle("Keystore Passphrase"); setTitle("Keystore Passphrase");
dialogPane.setHeaderText("Please enter the passphrase for keystore: " + keystore.getLabel()); dialogPane.setHeaderText("Please enter the passphrase for keystore: \n" + keystore.getLabel());
dialogPane.getStylesheets().add(AppController.class.getResource("general.css").toExternalForm()); dialogPane.getStylesheets().add(AppController.class.getResource("general.css").toExternalForm());
dialogPane.getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK); dialogPane.getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK);
dialogPane.setPrefWidth(380); dialogPane.setPrefWidth(380);
dialogPane.setPrefHeight(200); dialogPane.setPrefHeight(200);
Glyph lock = new Glyph("FontAwesome5", FontAwesome5.Glyph.KEY); Glyph key = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.KEY);
lock.setFontSize(50); key.setFontSize(50);
dialogPane.setGraphic(lock); dialogPane.setGraphic(key);
final VBox content = new VBox(10); final VBox content = new VBox(10);
content.setPrefHeight(50); content.setPrefHeight(50);

View file

@ -36,7 +36,7 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle
InputStreamReader reader = new InputStreamReader(inputStream); InputStreamReader reader = new InputStreamReader(inputStream);
ColdcardKeystore cck = Storage.getGson().fromJson(reader, ColdcardKeystore.class); ColdcardKeystore cck = Storage.getGson().fromJson(reader, ColdcardKeystore.class);
Keystore keystore = new Keystore("Coldcard " + cck.xfp); Keystore keystore = new Keystore("Coldcard");
keystore.setSource(KeystoreSource.HW_AIRGAPPED); keystore.setSource(KeystoreSource.HW_AIRGAPPED);
keystore.setWalletModel(WalletModel.COLDCARD); keystore.setWalletModel(WalletModel.COLDCARD);
@ -109,11 +109,12 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle
break; break;
default: default:
if (key.length() == 8 && Utils.isHex(key)) { if (key.length() == 8 && Utils.isHex(key)) {
Keystore keystore = new Keystore("Coldcard " + key); Keystore keystore = new Keystore("Coldcard");
keystore.setSource(KeystoreSource.HW_AIRGAPPED); keystore.setSource(KeystoreSource.HW_AIRGAPPED);
keystore.setWalletModel(WalletModel.COLDCARD); keystore.setWalletModel(WalletModel.COLDCARD);
keystore.setKeyDerivation(new KeyDerivation(key, derivation)); keystore.setKeyDerivation(new KeyDerivation(key, derivation));
keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(value)); keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(value));
wallet.makeLabelsUnique(keystore);
wallet.getKeystores().add(keystore); wallet.getKeystores().add(keystore);
} }
} }

View file

@ -59,7 +59,7 @@ public class ColdcardSinglesig implements KeystoreFileImport {
ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").toUpperCase()); ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").toUpperCase());
if(ckScriptType.equals(scriptType)) { if(ckScriptType.equals(scriptType)) {
Keystore keystore = new Keystore(); Keystore keystore = new Keystore();
keystore.setLabel("Coldcard " + masterFingerprint.toUpperCase()); keystore.setLabel("Coldcard");
keystore.setSource(KeystoreSource.HW_AIRGAPPED); keystore.setSource(KeystoreSource.HW_AIRGAPPED);
keystore.setWalletModel(WalletModel.COLDCARD); keystore.setWalletModel(WalletModel.COLDCARD);
keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, ck.deriv)); keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, ck.deriv));

View file

@ -131,7 +131,7 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, derivationPath)); keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, derivationPath));
keystore.setExtendedPublicKey(xPub); keystore.setExtendedPublicKey(xPub);
keystore.setLabel(ek.label != null ? ek.label : "Electrum " + masterFingerprint); keystore.setLabel(ek.label != null ? ek.label : "Electrum");
wallet.getKeystores().add(keystore); wallet.getKeystores().add(keystore);
ExtendedKey.Header xpubHeader = ExtendedKey.Header.fromExtendedKey(ek.xpub); ExtendedKey.Header xpubHeader = ExtendedKey.Header.fromExtendedKey(ek.xpub);

View file

@ -182,6 +182,7 @@ public class KeystoreController extends WalletFormController implements Initiali
selectSourcePane.setVisible(false); selectSourcePane.setVisible(false);
Keystore importedKeystore = result.get(); Keystore importedKeystore = result.get();
walletForm.getWallet().makeLabelsUnique(importedKeystore);
keystore.setSource(importedKeystore.getSource()); keystore.setSource(importedKeystore.getSource());
keystore.setWalletModel(importedKeystore.getWalletModel()); keystore.setWalletModel(importedKeystore.getWalletModel());
keystore.setLabel(importedKeystore.getLabel()); keystore.setLabel(importedKeystore.getLabel());