From 5aabf3a8304ccfbca8da5d45625878f76a9bc00b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 14 Dec 2023 11:29:53 +0200 Subject: [PATCH] follow up --- .../hummingbird/registry/CryptoKeypath.java | 2 +- .../sparrowwallet/hummingbird/registry/URHDKey.java | 4 ++-- .../hummingbird/registry/UROutputDescriptor.java | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sparrowwallet/hummingbird/registry/CryptoKeypath.java b/src/main/java/com/sparrowwallet/hummingbird/registry/CryptoKeypath.java index 198d884..44666d8 100644 --- a/src/main/java/com/sparrowwallet/hummingbird/registry/CryptoKeypath.java +++ b/src/main/java/com/sparrowwallet/hummingbird/registry/CryptoKeypath.java @@ -19,7 +19,7 @@ public class CryptoKeypath extends RegistryItem { private final Integer depth; public CryptoKeypath(List components, byte[] sourceFingerprint) { - this(components, sourceFingerprint, 0); + this(components, sourceFingerprint, null); } public CryptoKeypath(List components, byte[] sourceFingerprint, Integer depth) { diff --git a/src/main/java/com/sparrowwallet/hummingbird/registry/URHDKey.java b/src/main/java/com/sparrowwallet/hummingbird/registry/URHDKey.java index e21be8e..6920554 100644 --- a/src/main/java/com/sparrowwallet/hummingbird/registry/URHDKey.java +++ b/src/main/java/com/sparrowwallet/hummingbird/registry/URHDKey.java @@ -7,11 +7,11 @@ public class URHDKey extends CryptoHDKey { super(key, chainCode); } - public URHDKey(Boolean privateKey, byte[] key, byte[] chainCode, CryptoCoinInfo useInfo, CryptoKeypath origin, CryptoKeypath children, byte[] parentFingerprint) { + public URHDKey(Boolean privateKey, byte[] key, byte[] chainCode, URCoinInfo useInfo, URKeypath origin, URKeypath children, byte[] parentFingerprint) { super(privateKey, key, chainCode, useInfo, origin, children, parentFingerprint); } - public URHDKey(Boolean privateKey, byte[] key, byte[] chainCode, CryptoCoinInfo useInfo, CryptoKeypath origin, CryptoKeypath children, byte[] parentFingerprint, String name, String note) { + public URHDKey(Boolean privateKey, byte[] key, byte[] chainCode, URCoinInfo useInfo, URKeypath origin, URKeypath children, byte[] parentFingerprint, String name, String note) { super(privateKey, key, chainCode, useInfo, origin, children, parentFingerprint, name, note); } diff --git a/src/main/java/com/sparrowwallet/hummingbird/registry/UROutputDescriptor.java b/src/main/java/com/sparrowwallet/hummingbird/registry/UROutputDescriptor.java index efe57b4..b05e5c8 100644 --- a/src/main/java/com/sparrowwallet/hummingbird/registry/UROutputDescriptor.java +++ b/src/main/java/com/sparrowwallet/hummingbird/registry/UROutputDescriptor.java @@ -58,7 +58,15 @@ public class UROutputDescriptor extends RegistryItem { if(keys != null && !keys.isEmpty()) { Array array = new Array(); for(RegistryItem key : keys) { - array.add(key.toCbor()); + DataItem keyItem = key.toCbor(); + if(key instanceof URHDKey) { + keyItem.setTag(RegistryType.HDKEY.getTag()); + } else if(key instanceof URECKey) { + keyItem.setTag(RegistryType.ECKEY.getTag()); + } else if(key instanceof URAddress) { + keyItem.setTag(RegistryType.ADDRESS.getTag()); + } + array.add(keyItem); } map.put(new UnsignedInteger(KEYS), array); }