From a1d2de185981f628ed1f7e129aebf5c87e3c1a9c Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 2 Jul 2021 10:44:24 +0200 Subject: [PATCH] use all addressable script types (not just single hash types) --- drongo | 2 +- .../java/com/sparrowwallet/sparrow/control/DevicePane.java | 2 +- src/main/java/com/sparrowwallet/sparrow/io/Hwi.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drongo b/drongo index 107a165f..967a2c20 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 107a165fc1db84f80febbe358aaab16b2764a5d5 +Subproject commit 967a2c2026f15a6b458d055e33ac488e53df65fd diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java index a63c04e8..0d815697 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java @@ -546,7 +546,7 @@ public class DevicePane extends TitledDescriptionPane { keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(xpub)); if(wallet.getScriptType() == null) { - ScriptType scriptType = Arrays.stream(ScriptType.SINGLE_HASH_TYPES).filter(type -> type.getDefaultDerivation().get(0).equals(derivation.get(0))).findFirst().orElse(ScriptType.P2PKH); + ScriptType scriptType = Arrays.stream(ScriptType.ADDRESSABLE_TYPES).filter(type -> type.getDefaultDerivation().get(0).equals(derivation.get(0))).findFirst().orElse(ScriptType.P2PKH); wallet.setName(device.getModel().toDisplayString()); wallet.setPolicyType(PolicyType.SINGLE); wallet.setScriptType(scriptType); diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index b3e0f345..2296b8b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java @@ -119,8 +119,8 @@ public class Hwi { public String displayAddress(Device device, String passphrase, ScriptType scriptType, OutputDescriptor outputDescriptor) throws DisplayAddressException { try { - if(!Arrays.asList(ScriptType.SINGLE_HASH_TYPES).contains(scriptType)) { - throw new IllegalArgumentException("Cannot display address for script type " + scriptType + ": Only single hash types supported"); + if(!Arrays.asList(ScriptType.ADDRESSABLE_TYPES).contains(scriptType)) { + throw new IllegalArgumentException("Cannot display address for script type " + scriptType + ": Only addressable types supported"); } String descriptor = outputDescriptor.toString();