Skip to content

Commit

Permalink
Set migrated coin type to 0 in wallet_migration.py and add message fo…
Browse files Browse the repository at this point in the history
…r core 26.1 behaviour
  • Loading branch information
timemarkovqtum committed Oct 30, 2024
1 parent be819e3 commit a3c704e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/functional/wallet_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,20 @@ def test_basic(self):
# So, should have a total of 11 descriptors on it.
assert_equal(len(basic0.listdescriptors()["descriptors"]), 13)

# Core 26.1 limitation, message in pull request:
# When migrating legacy wallet to descriptor wallet the coin type is changed from 88 to 0
# in the derivation path for the old legacy addresses. For example: "m/88'/0'/0'" to "m/0h/0h/0h".
# The result address is the same. Send and receive worked, tested in regtest mode.
migr_old_addr_info = old_addr_info
migr_old_addr_info["hdkeypath"] = "m/0'/0'/0'"
migr_old_change_addr_info = old_change_addr_info
migr_old_change_addr_info["hdkeypath"], "m/0'/1'/0'"

# Compare addresses info
addr_info = basic0.getaddressinfo(addr)
change_addr_info = basic0.getaddressinfo(change)
self.assert_addr_info_equal(addr_info, old_addr_info)
self.assert_addr_info_equal(change_addr_info, old_change_addr_info)
self.assert_addr_info_equal(addr_info, migr_old_addr_info)
self.assert_addr_info_equal(change_addr_info, migr_old_change_addr_info)

addr_info = basic0.getaddressinfo(basic0.getnewaddress("", "bech32"))
assert_equal(addr_info["hdkeypath"], "m/84h/88h/0h/0/0")
Expand Down

0 comments on commit a3c704e

Please sign in to comment.