4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Test the listdescriptors RPC."""
6
6
7
+ from test_framework .blocktools import (
8
+ TIME_GENESIS_BLOCK ,
9
+ )
7
10
from test_framework .descriptors import (
8
- descsum_create
11
+ descsum_create ,
9
12
)
10
13
from test_framework .test_framework import BitcoinTestFramework
11
14
from test_framework .util import (
@@ -66,13 +69,13 @@ def run_test(self):
66
69
wallet = node .get_wallet_rpc ('w2' )
67
70
wallet .importdescriptors ([{
68
71
'desc' : descsum_create ('wpkh(' + xprv + hardened_path + '/0/*)' ),
69
- 'timestamp' : 1296688602 ,
72
+ 'timestamp' : TIME_GENESIS_BLOCK ,
70
73
}])
71
74
expected = {
72
75
'wallet_name' : 'w2' ,
73
76
'descriptors' : [
74
77
{'desc' : descsum_create ('wpkh([80002067' + hardened_path + ']' + xpub_acc + '/0/*)' ),
75
- 'timestamp' : 1296688602 ,
78
+ 'timestamp' : TIME_GENESIS_BLOCK ,
76
79
'active' : False ,
77
80
'range' : [0 , 0 ],
78
81
'next' : 0 },
@@ -86,7 +89,7 @@ def run_test(self):
86
89
'wallet_name' : 'w2' ,
87
90
'descriptors' : [
88
91
{'desc' : descsum_create ('wpkh(' + xprv + hardened_path + '/0/*)' ),
89
- 'timestamp' : 1296688602 ,
92
+ 'timestamp' : TIME_GENESIS_BLOCK ,
90
93
'active' : False ,
91
94
'range' : [0 , 0 ],
92
95
'next' : 0 },
@@ -108,7 +111,7 @@ def run_test(self):
108
111
watch_only_wallet = node .get_wallet_rpc ('watch-only' )
109
112
watch_only_wallet .importdescriptors ([{
110
113
'desc' : descsum_create ('wpkh(' + xpub_acc + ')' ),
111
- 'timestamp' : 1296688602 ,
114
+ 'timestamp' : TIME_GENESIS_BLOCK ,
112
115
}])
113
116
assert_raises_rpc_error (- 4 , 'Can\' t get descriptor string' , watch_only_wallet .listdescriptors , True )
114
117
@@ -117,14 +120,14 @@ def run_test(self):
117
120
wallet = node .get_wallet_rpc ('w4' )
118
121
wallet .importdescriptors ([{
119
122
'desc' : descsum_create ('combo(' + node .get_deterministic_priv_key ().key + ')' ),
120
- 'timestamp' : 1296688602 ,
123
+ 'timestamp' : TIME_GENESIS_BLOCK ,
121
124
}])
122
125
expected = {
123
126
'wallet_name' : 'w4' ,
124
127
'descriptors' : [
125
128
{'active' : False ,
126
129
'desc' : 'combo(0227d85ba011276cf25b51df6a188b75e604b38770a462b2d0e9fb2fc839ef5d3f)#np574htj' ,
127
- 'timestamp' : 1296688602 },
130
+ 'timestamp' : TIME_GENESIS_BLOCK },
128
131
]
129
132
}
130
133
assert_equal (expected , wallet .listdescriptors ())
0 commit comments