mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
Merge pull request #567 from trezor/tsusanka/566-info-btn2
Fix info button when shares reach its threshold
This commit is contained in:
commit
31494dad6c
@ -226,22 +226,22 @@ async def _show_remaining_groups_and_shares(ctx: wire.Context) -> None:
|
|||||||
first_entered_index = i
|
first_entered_index = i
|
||||||
|
|
||||||
share = None
|
share = None
|
||||||
for i, r in enumerate(shares_remaining):
|
for index, remaining in enumerate(shares_remaining):
|
||||||
if 0 < r < slip39.MAX_SHARE_COUNT:
|
if 0 <= remaining < slip39.MAX_SHARE_COUNT:
|
||||||
m = storage.recovery_shares.fetch_group(i)[0]
|
m = storage.recovery_shares.fetch_group(index)[0]
|
||||||
if not share:
|
if not share:
|
||||||
share = slip39.decode_mnemonic(m)
|
share = slip39.decode_mnemonic(m)
|
||||||
identifier = m.split(" ")[0:3]
|
identifier = m.split(" ")[0:3]
|
||||||
identifiers.append([r, identifier])
|
identifiers.append([remaining, identifier])
|
||||||
elif r == slip39.MAX_SHARE_COUNT:
|
elif remaining == slip39.MAX_SHARE_COUNT: # no shares yet
|
||||||
identifier = storage.recovery_shares.fetch_group(first_entered_index)[
|
identifier = storage.recovery_shares.fetch_group(first_entered_index)[
|
||||||
0
|
0
|
||||||
].split(" ")[0:2]
|
].split(" ")[0:2]
|
||||||
try:
|
try:
|
||||||
# we only add the group (two words) identifier once
|
# we only add the group (two words) identifier once
|
||||||
identifiers.index([r, identifier])
|
identifiers.index([remaining, identifier])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
identifiers.append([r, identifier])
|
identifiers.append([remaining, identifier])
|
||||||
|
|
||||||
return await layout.show_remaining_shares(
|
return await layout.show_remaining_shares(
|
||||||
ctx, identifiers, shares_remaining, share.group_threshold
|
ctx, identifiers, shares_remaining, share.group_threshold
|
||||||
|
Loading…
Reference in New Issue
Block a user