1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-15 19:08:07 +00:00

core: Improve Super Shamir texts.

This commit is contained in:
Andrew Kozlik 2019-08-27 16:03:11 +02:00
parent fd53c72a3c
commit 90bd453d0a

View File

@ -288,7 +288,7 @@ async def slip39_group_show_checklist_set_groups(ctx):
checklist = Checklist("Backup checklist", ui.ICON_RESET) checklist = Checklist("Backup checklist", ui.ICON_RESET)
checklist.add("Set number of groups") checklist.add("Set number of groups")
checklist.add("Set group threshold") checklist.add("Set group threshold")
checklist.add(("Set number of shares", "and shares threshold")) checklist.add(("Set size and threshold", "for each group"))
checklist.select(0) checklist.select(0)
return await confirm( return await confirm(
ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue" ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue"
@ -299,7 +299,7 @@ async def slip39_group_show_checklist_set_group_threshold(ctx, num_of_shares):
checklist = Checklist("Backup checklist", ui.ICON_RESET) checklist = Checklist("Backup checklist", ui.ICON_RESET)
checklist.add("Set number of groups") checklist.add("Set number of groups")
checklist.add("Set group threshold") checklist.add("Set group threshold")
checklist.add(("Set number of shares", "and shares threshold")) checklist.add(("Set size and threshold", "for each group"))
checklist.select(1) checklist.select(1)
return await confirm( return await confirm(
ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue" ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue"
@ -310,7 +310,7 @@ async def slip39_group_show_checklist_set_shares(ctx, num_of_shares, group_thres
checklist = Checklist("Backup checklist", ui.ICON_RESET) checklist = Checklist("Backup checklist", ui.ICON_RESET)
checklist.add("Set number of groups") checklist.add("Set number of groups")
checklist.add("Set group threshold") checklist.add("Set group threshold")
checklist.add(("Set number of shares", "and shares threshold")) checklist.add(("Set size and threshold", "for each group"))
checklist.select(2) checklist.select(2)
return await confirm( return await confirm(
ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue" ctx, checklist, ButtonRequestType.ResetDevice, cancel=None, confirm="Continue"
@ -341,16 +341,26 @@ async def slip39_prompt_number_of_shares(ctx, group_id=None):
count = shares.input.count count = shares.input.count
if confirmed: if confirmed:
break break
if group_id is None:
info = InfoConfirm(
"Each recovery share is a "
"sequence of 20 words. "
"Next you will choose "
"how many shares you "
"need to recover your "
"wallet."
)
else: else:
info = InfoConfirm( info = InfoConfirm(
"Each recovery share is " "Each recovery share is a "
"a sequence of 20 " "sequence of 20 words. "
"words. Next you will " "Next you will choose "
"choose how many " "the threshold number of "
"shares you need to " "shares needed to form "
"recover your wallet." "Group %s." % (group_id + 1)
) )
await info await info
return count return count
@ -376,12 +386,12 @@ async def slip39_prompt_number_of_groups(ctx):
break break
info = InfoConfirm( info = InfoConfirm(
"Group contains set " "Each group has a set "
"number of shares and " "number of shares and "
"its own threshold. " "its own threshold. In the "
"In the next step you set " "next steps you will set "
"both number of shares " "the numbers of shares "
"and threshold." "and the thresholds."
) )
await info await info
@ -411,10 +421,10 @@ async def slip39_prompt_group_threshold(ctx, num_of_groups):
break break
else: else:
info = InfoConfirm( info = InfoConfirm(
"Group threshold " "The group threshold "
"specifies number of " "specifies the number of "
"groups required " "groups required to "
"to recover wallet. " "recover your wallet. "
) )
await info await info
@ -442,7 +452,8 @@ async def slip39_prompt_threshold(ctx, num_of_shares, group_id=None):
count = shares.input.count count = shares.input.count
if confirmed: if confirmed:
break break
else:
if group_id is None:
info = InfoConfirm( info = InfoConfirm(
"The threshold sets the " "The threshold sets the "
"number of shares " "number of shares "
@ -451,7 +462,16 @@ async def slip39_prompt_threshold(ctx, num_of_shares, group_id=None):
"you will need any %s " "you will need any %s "
"of your %s shares." % (count, count, num_of_shares) "of your %s shares." % (count, count, num_of_shares)
) )
await info else:
info = InfoConfirm(
"The threshold sets the "
"number of shares "
"needed to form a group. "
"Set it to %s and you will "
"need any %s of %s shares "
"to form Group %s." % (count, count, num_of_shares, group_id + 1)
)
await info
return count return count
@ -625,8 +645,8 @@ class ShamirNumInput(ui.Component):
first_line_text = "%s people or locations" % count first_line_text = "%s people or locations" % count
second_line_text = "will each hold one share." second_line_text = "will each hold one share."
else: else:
first_line_text = "Sets number of shares" first_line_text = "Set the total number of"
second_line_text = "for Group %s" % (self.group_id + 1) second_line_text = "shares in Group %s." % (self.group_id + 1)
ui.display.text( ui.display.text(
12, 130, first_line_text, ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12 12, 130, first_line_text, ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12
) )
@ -636,19 +656,23 @@ class ShamirNumInput(ui.Component):
first_line_text = "For recovery you need" first_line_text = "For recovery you need"
second_line_text = "any %s of the shares." % count second_line_text = "any %s of the shares." % count
else: else:
first_line_text = "Required number of " first_line_text = "The required number of "
second_line_text = "shares to form Group %s" % (self.group_id + 1) second_line_text = "shares to form Group %s." % (self.group_id + 1)
ui.display.text(12, 130, first_line_text, ui.NORMAL, ui.FG, ui.BG) ui.display.text(12, 130, first_line_text, ui.NORMAL, ui.FG, ui.BG)
ui.display.text( ui.display.text(
12, 156, second_line_text, ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12 12, 156, second_line_text, ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12
) )
elif self.step is ShamirNumInput.SET_GROUPS: elif self.step is ShamirNumInput.SET_GROUPS:
ui.display.text(12, 130, "A group is made of", ui.NORMAL, ui.FG, ui.BG) ui.display.text(
12, 130, "A group is made up of", ui.NORMAL, ui.FG, ui.BG
)
ui.display.text( ui.display.text(
12, 156, "recovery shares.", ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12 12, 156, "recovery shares.", ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12
) )
elif self.step is ShamirNumInput.SET_GROUP_THRESHOLD: elif self.step is ShamirNumInput.SET_GROUP_THRESHOLD:
ui.display.text(12, 130, "Required number of", ui.NORMAL, ui.FG, ui.BG) ui.display.text(
12, 130, "The required number of", ui.NORMAL, ui.FG, ui.BG
)
ui.display.text( ui.display.text(
12, 12,
156, 156,