1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

core/storage: swap arguments in recovery_shares.set

This commit is contained in:
Tomas Susanka 2019-09-20 09:22:30 +02:00
parent 6938d2b238
commit cf5a794436
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ if False:
# Each mnemonic is stored under key = index. # Each mnemonic is stored under key = index.
def set(index: int, mnemonic: str, group_index: int) -> None: def set(index: int, group_index: int, mnemonic: str) -> None:
common.set( common.set(
common.APP_RECOVERY_SHARES, common.APP_RECOVERY_SHARES,
index + group_index * slip39.MAX_SHARE_COUNT, index + group_index * slip39.MAX_SHARE_COUNT,

View File

@ -40,7 +40,7 @@ def process_slip39(words: str) -> Tuple[Optional[bytes], slip39.Share]:
storage.recovery.set_slip39_remaining_shares( storage.recovery.set_slip39_remaining_shares(
share.threshold - 1, share.group_index share.threshold - 1, share.group_index
) )
storage.recovery_shares.set(share.index, words, share.group_index) storage.recovery_shares.set(share.index, share.group_index, words)
# if share threshold and group threshold are 1 # if share threshold and group threshold are 1
# we can calculate the secret right away # we can calculate the secret right away
@ -67,7 +67,7 @@ def process_slip39(words: str) -> Tuple[Optional[bytes], slip39.Share]:
remaining_for_share - 1, share.group_index remaining_for_share - 1, share.group_index
) )
remaining[share.group_index] = remaining_for_share - 1 remaining[share.group_index] = remaining_for_share - 1
storage.recovery_shares.set(share.index, words, share.group_index) storage.recovery_shares.set(share.index, share.group_index, words)
if remaining.count(0) < share.group_threshold: if remaining.count(0) < share.group_threshold:
# we need more shares # we need more shares