44# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55"""Test the listdescriptors RPC."""
66
7+ from test_framework .blocktools import (
8+ TIME_GENESIS_BLOCK ,
9+ )
710from test_framework .descriptors import (
8- descsum_create
11+ descsum_create ,
912)
1013from test_framework .test_framework import BitcoinTestFramework
1114from test_framework .util import (
@@ -66,13 +69,13 @@ def run_test(self):
6669 wallet = node .get_wallet_rpc ('w2' )
6770 wallet .importdescriptors ([{
6871 'desc' : descsum_create ('wpkh(' + xprv + hardened_path + '/0/*)' ),
69- 'timestamp' : 1296688602 ,
72+ 'timestamp' : TIME_GENESIS_BLOCK ,
7073 }])
7174 expected = {
7275 'wallet_name' : 'w2' ,
7376 'descriptors' : [
7477 {'desc' : descsum_create ('wpkh([80002067' + hardened_path + ']' + xpub_acc + '/0/*)' ),
75- 'timestamp' : 1296688602 ,
78+ 'timestamp' : TIME_GENESIS_BLOCK ,
7679 'active' : False ,
7780 'range' : [0 , 0 ],
7881 'next' : 0 },
@@ -86,7 +89,7 @@ def run_test(self):
8689 'wallet_name' : 'w2' ,
8790 'descriptors' : [
8891 {'desc' : descsum_create ('wpkh(' + xprv + hardened_path + '/0/*)' ),
89- 'timestamp' : 1296688602 ,
92+ 'timestamp' : TIME_GENESIS_BLOCK ,
9093 'active' : False ,
9194 'range' : [0 , 0 ],
9295 'next' : 0 },
@@ -108,7 +111,7 @@ def run_test(self):
108111 watch_only_wallet = node .get_wallet_rpc ('watch-only' )
109112 watch_only_wallet .importdescriptors ([{
110113 'desc' : descsum_create ('wpkh(' + xpub_acc + ')' ),
111- 'timestamp' : 1296688602 ,
114+ 'timestamp' : TIME_GENESIS_BLOCK ,
112115 }])
113116 assert_raises_rpc_error (- 4 , 'Can\' t get descriptor string' , watch_only_wallet .listdescriptors , True )
114117
@@ -117,14 +120,14 @@ def run_test(self):
117120 wallet = node .get_wallet_rpc ('w4' )
118121 wallet .importdescriptors ([{
119122 'desc' : descsum_create ('combo(' + node .get_deterministic_priv_key ().key + ')' ),
120- 'timestamp' : 1296688602 ,
123+ 'timestamp' : TIME_GENESIS_BLOCK ,
121124 }])
122125 expected = {
123126 'wallet_name' : 'w4' ,
124127 'descriptors' : [
125128 {'active' : False ,
126129 'desc' : 'combo(0227d85ba011276cf25b51df6a188b75e604b38770a462b2d0e9fb2fc839ef5d3f)#np574htj' ,
127- 'timestamp' : 1296688602 },
130+ 'timestamp' : TIME_GENESIS_BLOCK },
128131 ]
129132 }
130133 assert_equal (expected , wallet .listdescriptors ())
0 commit comments