From f25d2618b6818831ac1920b6b651d4c229cb1912 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 8 Sep 2020 08:31:42 +0200 Subject: [PATCH] descriptor change multi to sortedmulti --- drongo | 2 +- .../sparrow/io/ColdcardMultisigTest.java | 6 +++--- .../com/sparrowwallet/sparrow/io/ElectrumTest.java | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drongo b/drongo index 70fdecf9..794cde72 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 70fdecf919ea9dcae46cc35df23e0a20ba90683f +Subproject commit 794cde72509650c3659a4250c223d3ae4a82d9d6 diff --git a/src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java index 56466f29..be105554 100644 --- a/src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java +++ b/src/test/java/com/sparrowwallet/sparrow/io/ColdcardMultisigTest.java @@ -59,7 +59,7 @@ public class ColdcardMultisigTest extends IoTest { Assert.assertEquals(PolicyType.MULTI, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2WSH, wallet.getScriptType()); Assert.assertEquals(2, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("multi(2,coldcard1,coldcard2,coldcard3,coldcard4)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("wsh(sortedmulti(2,coldcard1,coldcard2,coldcard3,coldcard4))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertTrue(wallet.isValid()); } @@ -71,7 +71,7 @@ public class ColdcardMultisigTest extends IoTest { Assert.assertEquals(PolicyType.MULTI, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2SH_P2WSH, wallet.getScriptType()); Assert.assertEquals(2, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("multi(2,coldcard1,coldcard2,coldcard3,coldcard4)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("sh(wsh(sortedmulti(2,coldcard1,coldcard2,coldcard3,coldcard4)))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertTrue(wallet.isValid()); } @@ -83,7 +83,7 @@ public class ColdcardMultisigTest extends IoTest { Assert.assertEquals(PolicyType.MULTI, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2WSH, wallet.getScriptType()); Assert.assertEquals(3, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("multi(3,coldcard1,coldcard2,coldcard3)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("wsh(sortedmulti(3,coldcard1,coldcard2,coldcard3))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("06b57041", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/48'/0'/0'/2'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6EfEGa5isJbQFSswM5Uptw5BSq2Td1ZDJr3QUNUcMySpC7itZ3ccypVHtLPnvMzKQ2qxrAgH49vhVxRcaQLFbixAVRR8RACrYTp88Uv9h8Z", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); diff --git a/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java index 338e739b..0536d7f3 100644 --- a/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java +++ b/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java @@ -22,7 +22,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2SH_P2WPKH, wallet.getScriptType()); Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("pkh(trezortest)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("sh(wpkh(trezortest))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("ab543c67", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/49'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); @@ -42,7 +42,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2SH_P2WPKH, wallet.getScriptType()); Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("pkh(trezortest)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("sh(wpkh(trezortest))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("ab543c67", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/49'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); @@ -56,7 +56,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.MULTI, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2SH_P2WSH, wallet.getScriptType()); Assert.assertEquals(2, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("multi(2,coldcard6ba6cfd0,coldcard747b698e,coldcard7bb026be,coldcard0f056943)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("sh(wsh(sortedmulti(2,coldcard6ba6cfd0,coldcard747b698e,coldcard7bb026be,coldcard0f056943)))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("6ba6cfd0", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/48'/1'/0'/1'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); @@ -78,7 +78,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.MULTI, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2SH_P2WSH, wallet.getScriptType()); Assert.assertEquals(2, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("multi(2,coldcard6ba6cfd0,coldcard747b698e,coldcard7bb026be,coldcard0f056943)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("sh(wsh(sortedmulti(2,coldcard6ba6cfd0,coldcard747b698e,coldcard7bb026be,coldcard0f056943)))", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("6ba6cfd0", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/48'/1'/0'/1'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); @@ -96,7 +96,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2WPKH, wallet.getScriptType()); Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("pkh(electrum)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("wpkh(electrum)", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("f881eac5", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub69iSRreMB6fu24sU8Tdxv7yYGqzPkDwPkwqUfKJTxW3p8afW7XvTewVCapuX3dQjdD197iF65WcjYaNpFbwWT3RyuZ1KJ3ToJNVWKWyAJ6f", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); @@ -116,7 +116,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2WPKH, wallet.getScriptType()); Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("pkh(electrum)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("wpkh(electrum)", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("59c5474f", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub68YmVxWbxqjpxbUqqaPrgkBQPBSJuq6gEaL22uuytSEojtS2x5eLPN2uspUuyigtnMkoHrFSF1KwoXPwjzuaUjErUwztxfHquAwuaQhSd9J", wallet.getKeystores().get(0).getExtendedPublicKey().toString());