From db27ac935480aeec40a1cfc9d5f10a48be55d61b Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 7 Mar 2022 05:57:54 -0500 Subject: [PATCH] tests: Ensure sorted/multi_a descriptors always generate different addrs Sometimes the multi_a and sortedmulti_a descriptors will produce some of the same addresses in the tests. This causes the wallets to start generating addresses at a different index as they detect that one of the addresses is used. This subsequently causes a test failure. To avoid this problem, use descriptors that will produce unique addresses by putting one of the multi_a in a different branch. --- test/functional/wallet_taproot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/wallet_taproot.py b/test/functional/wallet_taproot.py index 54c9928522..f72e2026a3 100755 --- a/test/functional/wallet_taproot.py +++ b/test/functional/wallet_taproot.py @@ -429,10 +429,10 @@ class WalletTaprootTest(BitcoinTestFramework): lambda k1, k2: (key(H_POINT), [multi_a(1, [k1, k2], True)]) ) self.do_test( - "tr(H,multi_a(1,XPUB,XPRV))", - "tr($H,multi_a(1,$1/*,$2/*))", + "tr(H,{H,multi_a(1,XPUB,XPRV)})", + "tr($H,{pk($H),multi_a(1,$1/*,$2/*)})", [False, True], - lambda k1, k2: (key(H_POINT), [multi_a(1, [k1, k2])]) + lambda k1, k2: (key(H_POINT), [pk(H_POINT), [multi_a(1, [k1, k2])]]) ) self.do_test( "tr(H,sortedmulti_a(1,XPUB,XPRV,XPRV))",