1
0

mnemonic: rename seed_type() fn

Some functions have an argument named "seed_type" in which it was annoying to call the seed_type() fn.
(especially for functions inside the same module)
This commit is contained in:
SomberNight
2024-06-10 20:00:52 +00:00
parent b95fbbb86f
commit a2d5e31838
8 changed files with 27 additions and 27 deletions

View File

@@ -32,7 +32,7 @@ from PyQt5.QtWidgets import (QVBoxLayout, QCheckBox, QHBoxLayout, QLineEdit,
QScrollArea, QWidget, QPushButton)
from electrum.i18n import _
from electrum.mnemonic import Mnemonic, seed_type, is_any_2fa_seed_type
from electrum.mnemonic import Mnemonic, calc_seed_type, is_any_2fa_seed_type
from electrum import old_mnemonic
from electrum import slip39
@@ -292,7 +292,7 @@ class SeedLayout(QVBoxLayout):
b = self.slip39_seed is not None
self.update_share_buttons()
else:
t = seed_type(s)
t = calc_seed_type(s)
label = _('Seed Type') + ': ' + t if t else ''
if t and not b: # electrum seed, but does not conform to dialog rules
# FIXME we should just accept any electrum seed and "redirect" the wizard automatically.

View File

@@ -630,7 +630,7 @@ class WCHaveSeed(WalletWizardComponent, Logger):
self.layout().addStretch(1)
def is_seed(self, x):
t = mnemonic.seed_type(x)
t = mnemonic.calc_seed_type(x)
if self.wizard_data['wallet_type'] == 'standard':
return mnemonic.is_seed(x) and not mnemonic.is_any_2fa_seed_type(t)
elif self.wizard_data['wallet_type'] == '2fa':
@@ -665,7 +665,7 @@ class WCHaveSeed(WalletWizardComponent, Logger):
cosigner_data['seed'] = self.slayout.get_seed()
cosigner_data['seed_variant'] = self.slayout.seed_type
if self.slayout.seed_type == 'electrum':
cosigner_data['seed_type'] = mnemonic.seed_type(self.slayout.get_seed())
cosigner_data['seed_type'] = mnemonic.calc_seed_type(self.slayout.get_seed())
else:
cosigner_data['seed_type'] = self.slayout.seed_type
cosigner_data['seed_extend'] = self.slayout.is_ext if self.can_passphrase else False