From f3e1fe6df4d64e39fb0080151255adfd057e7dbc Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 4 Nov 2020 16:32:17 +0200 Subject: [PATCH] further payjoin tweaks --- src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java | 4 ++-- src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java | 1 - src/test/java/com/sparrowwallet/drongo/psbt/PSBTTest.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java index 5832a2b..f4817c1 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBT.java @@ -569,8 +569,8 @@ public class PSBT { return extendedPublicKeys.get(publicKey); } - public List getExtendedPublicKeys() { - return new ArrayList(extendedPublicKeys.keySet()); + public Map getExtendedPublicKeys() { + return extendedPublicKeys; } public Map getGlobalProprietary() { diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java index a5a426c..5d156f2 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java @@ -543,7 +543,6 @@ public class PSBTInput { sigHash = null; redeemScript = null; witnessScript = null; - derivedPublicKeys.clear(); porCommitment = null; proprietary.clear(); } diff --git a/src/test/java/com/sparrowwallet/drongo/psbt/PSBTTest.java b/src/test/java/com/sparrowwallet/drongo/psbt/PSBTTest.java index efa0780..bb77ecc 100644 --- a/src/test/java/com/sparrowwallet/drongo/psbt/PSBTTest.java +++ b/src/test/java/com/sparrowwallet/drongo/psbt/PSBTTest.java @@ -221,7 +221,7 @@ public class PSBTTest { String psbt = "cHNidP8BAJ0BAAAAAnEOp2q0XFy2Q45gflnMA3YmmBgFrp4N/ZCJASq7C+U1AQAAAAD/////GQmU1qizyMgsy8+y+6QQaqBmObhyqNRHRlwNQliNbWcAAAAAAP////8CAOH1BQAAAAAZdqkUtrwsDuVlWoQ9ea/t0MzD991kNAmIrGBa9AUAAAAAFgAUEYjvjkzgRJ6qyPsUHL9aEXbmoIgAAAAATwEEiLIeA55TDKyAAAAAPbyKXJdp8DGxfnf+oVGGAyIaGP0Y8rmlTGyMGsdcvDUC8jBYSxVdHH8c1FEgplPEjWULQxtnxbLBPyfXFCA3wWkQJ1acUDEAAIAAAACAAAAAgAABAR8A4fUFAAAAABYAFDO5gvkbKPFgySC0q5XljOUN2jpKIgIDMJaA8zx9446mpHzU7NZvH1pJdHxv+4gI7QkDkkPjrVxHMEQCIC1wTO2DDFapCTRL10K2hS3M0QPpY7rpLTjnUlTSu0JFAiAthsQ3GV30bAztoITyopHD2i1kBw92v5uQsZXn7yj3cgEiBgMwloDzPH3jjqakfNTs1m8fWkl0fG/7iAjtCQOSQ+OtXBgnVpxQMQAAgAAAAIAAAACAAAAAAAEAAAAAAQEfAOH1BQAAAAAWABQ4j7lEMH63fvRRl9CwskXgefAR3iICAsd3Fh9z0LfHK57nveZQKT0T8JW8dlatH1Jdpf0uELEQRzBEAiBMsftfhpyULg4mEAV2ElQ5F5rojcqKncO6CPeVOYj6pgIgUh9JynkcJ9cOJzybFGFphZCTYeJb4nTqIA1+CIJ+UU0BIgYCx3cWH3PQt8crnue95lApPRPwlbx2Vq0fUl2l/S4QsRAYJ1acUDEAAIAAAACAAAAAgAAAAAAAAAAAAAAiAgLSDKUC7iiWhtIYFb1DqAY3sGmOH7zb5MrtRF9sGgqQ7xgnVpxQMQAAgAAAAIAAAACAAAAAAAQAAAAA"; PSBT psbt1 = PSBT.fromString(psbt); - ExtendedKey extendedPublicKey = psbt1.getExtendedPublicKeys().get(0); + ExtendedKey extendedPublicKey = psbt1.getExtendedPublicKeys().keySet().iterator().next(); KeyDerivation keyDerivation = psbt1.getKeyDerivation(extendedPublicKey); Assert.assertEquals("27569c50", keyDerivation.getMasterFingerprint()); Assert.assertEquals("m/49'/0'/0'", keyDerivation.getDerivationPath());