File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,16 @@ def run_test(self):
141
141
if not self .options .descriptors :
142
142
# Check that newkeypool entirely flushes the keypool
143
143
start_keypath = nodes [0 ].getaddressinfo (nodes [0 ].getnewaddress ())['hdkeypath' ]
144
+ start_change_keypath = nodes [0 ].getaddressinfo (nodes [0 ].getrawchangeaddress ())['hdkeypath' ]
145
+ # flush keypool and get new addresses
144
146
nodes [0 ].newkeypool ()
145
147
end_keypath = nodes [0 ].getaddressinfo (nodes [0 ].getnewaddress ())['hdkeypath' ]
148
+ end_change_keypath = nodes [0 ].getaddressinfo (nodes [0 ].getrawchangeaddress ())['hdkeypath' ]
146
149
# The new keypath index should be 100 more than the old one
147
- keypath_prefix = start_keypath .rsplit ('/' , 1 )[0 ]
148
150
new_index = int (start_keypath .rsplit ('/' , 1 )[1 ][:- 1 ]) + 100
149
- assert_equal (end_keypath , keypath_prefix + '/' + str (new_index ) + '\' ' )
151
+ new_change_index = int (start_change_keypath .rsplit ('/' , 1 )[1 ][:- 1 ]) + 100
152
+ assert_equal (end_keypath , "m/0'/0'/" + str (new_index ) + "'" )
153
+ assert_equal (end_change_keypath , "m/0'/1'/" + str (new_change_index ) + "'" )
150
154
151
155
# create a blank wallet
152
156
nodes [0 ].createwallet (wallet_name = 'w2' , blank = True , disable_private_keys = True )
Original file line number Diff line number Diff line change @@ -234,13 +234,13 @@ def copy_split_hd():
234
234
assert_equal (1 , hd_chain_version )
235
235
seed_id = bytearray (seed_id )
236
236
seed_id .reverse ()
237
- old_kvs = new_kvs
238
- # New keys should be HD (the two old keys have been flushed)
237
+
238
+ # New keys (including change) should be HD (the two old keys have been flushed)
239
239
info = wallet .getaddressinfo (wallet .getnewaddress ())
240
240
assert_equal (seed_id .hex (), info ['hdseedid' ])
241
241
assert_equal ('m/0\' /0\' /0\' ' , info ['hdkeypath' ])
242
242
prev_seed_id = info ['hdseedid' ]
243
- # Change key should be the same keypool
243
+ # Change key should be HD and from the same keypool
244
244
info = wallet .getaddressinfo (wallet .getrawchangeaddress ())
245
245
assert_equal (prev_seed_id , info ['hdseedid' ])
246
246
assert_equal ('m/0\' /0\' /1\' ' , info ['hdkeypath' ])
You can’t perform that action at this time.
0 commit comments