Skip to content

Commit

Permalink
SFT-2392: added migration for next_addrs defaulting to main xfp and
Browse files Browse the repository at this point in the history
mainnet
  • Loading branch information
mjg-foundation committed Aug 21, 2023
1 parent 65d1454 commit fbeb59c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ports/stm32/boards/Passport/modules/flows/main_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self):

async def start(self):
import common
from utils import start_task, is_logged_in, has_seed
from utils import start_task, is_logged_in, has_seed, xfp2str
from flows import SelectSetupModeFlow, LoginFlow, InitialSeedSetupFlow

await SelectSetupModeFlow().run()
Expand All @@ -23,6 +23,14 @@ async def start(self):
if not has_seed():
await InitialSeedSetupFlow(allow_backtrack=False).run()

# Update old next_addrs keys to include the coin type and xfp
next_addrs = common.settings.get('next_addrs', {})
xfp = xfp2str(common.settings.get('xfp'))
for key in next_addrs:
if "." not in key: # new key format uses periods to prepend coin type and xfp
next_addrs["0.{}.".format(xfp) + key] = next_addrs[key]
del next_addrs[key]

# Create initial cards by calling ui.update_cards()
common.ui.update_cards(is_init=True)

Expand Down

0 comments on commit fbeb59c

Please sign in to comment.