@@ -17,6 +17,7 @@ from electrum.wallet_db import WalletDB
|
||||
from electrum.bip32 import normalize_bip32_derivation, xpub_type
|
||||
from electrum import keystore, mnemonic, bitcoin
|
||||
from electrum.mnemonic import is_any_2fa_seed_type, can_seed_have_passphrase
|
||||
from electrum.util import multisig_type
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.daemon import Daemon
|
||||
@@ -257,6 +258,14 @@ class KeystoreWizard(AbstractWizard):
|
||||
# one at a time
|
||||
return True
|
||||
|
||||
def _convert_wallet_type(self, wizard_data: dict) -> None:
|
||||
assert 'wallet_type' in wizard_data
|
||||
if multisig_type(wizard_data['wallet_type']):
|
||||
wizard_data['wallet_type'] = 'multisig' # convert from e.g. "2of2" to "multisig"
|
||||
wizard_data['multisig_participants'] = 2
|
||||
wizard_data['multisig_signatures'] = 2
|
||||
wizard_data['multisig_cosigner_data'] = {}
|
||||
|
||||
def start(self, *, start_viewstate: WizardViewState = None) -> WizardViewState:
|
||||
self.reset()
|
||||
if start_viewstate is None:
|
||||
@@ -265,6 +274,7 @@ class KeystoreWizard(AbstractWizard):
|
||||
self._current = WizardViewState(start_view, {}, params)
|
||||
else:
|
||||
self._current = start_viewstate
|
||||
self._convert_wallet_type(self._current.wizard_data) # mutating in-place
|
||||
return self._current
|
||||
|
||||
# returns (sub)dict of current cosigner (or root if first)
|
||||
|
||||
Reference in New Issue
Block a user