mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-15 09:50:57 +00:00
Merge pull request #546 from trezor/tsusanka/1of1
core: enable 1of1 in reset device
This commit is contained in:
commit
bf518665a0
@ -332,24 +332,27 @@ async def slip39_prompt_threshold(ctx, num_of_shares, group_id=None):
|
|||||||
if confirmed:
|
if confirmed:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
text = "The threshold sets the number of shares "
|
||||||
if group_id is None:
|
if group_id is None:
|
||||||
info = InfoConfirm(
|
text += "needed to recover your wallet. "
|
||||||
"The threshold sets the "
|
text += "Set it to %s and you will need " % count
|
||||||
"number of shares "
|
if num_of_shares == 1:
|
||||||
"needed to recover your "
|
text += "1 share."
|
||||||
"wallet. Set it to %s and "
|
elif num_of_shares == count:
|
||||||
"you will need any %s "
|
text += "all %s of your %s shares." % (count, num_of_shares)
|
||||||
"of your %s shares." % (count, count, num_of_shares)
|
else:
|
||||||
)
|
text += "any %s of your %s shares." % (count, num_of_shares)
|
||||||
else:
|
else:
|
||||||
info = InfoConfirm(
|
text += "needed to form a group. "
|
||||||
"The threshold sets the "
|
text += "Set it to %s and you will " % count
|
||||||
"number of shares "
|
if num_of_shares == 1:
|
||||||
"needed to form a group. "
|
text += "need 1 share "
|
||||||
"Set it to %s and you will "
|
elif num_of_shares == count:
|
||||||
"need any %s of %s shares "
|
text += "need all %s of %s shares " % (count, num_of_shares)
|
||||||
"to form Group %s." % (count, count, num_of_shares, group_id + 1)
|
else:
|
||||||
)
|
text += "need any %s of %s shares " % (count, num_of_shares)
|
||||||
|
text += "to form Group %s." % (group_id + 1)
|
||||||
|
info = InfoConfirm(text)
|
||||||
await info
|
await info
|
||||||
|
|
||||||
return count
|
return count
|
||||||
@ -357,10 +360,7 @@ async def slip39_prompt_threshold(ctx, num_of_shares, group_id=None):
|
|||||||
|
|
||||||
async def slip39_prompt_number_of_shares(ctx, group_id=None):
|
async def slip39_prompt_number_of_shares(ctx, group_id=None):
|
||||||
count = 5
|
count = 5
|
||||||
if group_id is not None:
|
min_count = 1
|
||||||
min_count = 1
|
|
||||||
else:
|
|
||||||
min_count = 2
|
|
||||||
max_count = 16
|
max_count = 16
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -551,19 +551,27 @@ class Slip39NumInput(ui.Component):
|
|||||||
# render the counter
|
# render the counter
|
||||||
if self.step is Slip39NumInput.SET_SHARES:
|
if self.step is Slip39NumInput.SET_SHARES:
|
||||||
if self.group_id is None:
|
if self.group_id is None:
|
||||||
first_line_text = "%s people or locations" % count
|
if count == 1:
|
||||||
second_line_text = "will each hold one share."
|
first_line_text = "Only one share will"
|
||||||
|
second_line_text = "be created."
|
||||||
|
else:
|
||||||
|
first_line_text = "%s people or locations" % count
|
||||||
|
second_line_text = "will each hold one share."
|
||||||
else:
|
else:
|
||||||
first_line_text = "Set the total number of"
|
first_line_text = "Set the total number of"
|
||||||
second_line_text = "shares in 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
|
||||||
)
|
)
|
||||||
ui.display.text(12, 156, second_line_text, ui.NORMAL, ui.FG, ui.BG)
|
ui.display.text(
|
||||||
|
12, 156, second_line_text, ui.NORMAL, ui.FG, ui.BG, ui.WIDTH - 12
|
||||||
|
)
|
||||||
elif self.step is Slip39NumInput.SET_THRESHOLD:
|
elif self.step is Slip39NumInput.SET_THRESHOLD:
|
||||||
if self.group_id is None:
|
if self.group_id is None:
|
||||||
first_line_text = "For recovery you need"
|
first_line_text = "For recovery you need"
|
||||||
if count == self.input.max_count:
|
if count == 1:
|
||||||
|
second_line_text = "1 share."
|
||||||
|
elif count == self.input.max_count:
|
||||||
second_line_text = "all %s of the shares." % count
|
second_line_text = "all %s of the shares." % count
|
||||||
else:
|
else:
|
||||||
second_line_text = "any %s of the shares." % count
|
second_line_text = "any %s of the shares." % count
|
||||||
|
Loading…
Reference in New Issue
Block a user