Browse Source

Modified flow to correctly "Complete" pairing

Also fixed many review comments
PASS1-CASA
coreylakey 4 years ago
parent
commit
c4337a4526
  1. 39
      ports/stm32/boards/Passport/modules/new_wallet.py
  2. 6
      ports/stm32/boards/Passport/modules/wallets/casa.py

39
ports/stm32/boards/Passport/modules/new_wallet.py

@ -402,30 +402,21 @@ class NewWalletUX(UXStateMachine):
else: else:
self.goto(self.IMPORT_MULTISIG_CONFIG_FROM_MICROSD, save_curr=False) self.goto(self.IMPORT_MULTISIG_CONFIG_FROM_MICROSD, save_curr=False)
def is_address_verification_skip_enabled(self): def is_skip_address_verifivation_enabled(self):
if 'skip_address_validation' in self.sw_wallet: if 'skip_address_validation' in self.sw_wallet:
if self.sw_wallet['skip_address_validation'] == 'True': return self.sw_wallet['skip_address_validation']
return True
else:
return False
else: else:
return False return False
def is_skip_multisig_import_enabled(self): def is_skip_multisig_import_enabled(self):
if 'skip_multisig_import' in self.sw_wallet: if 'skip_multisig_import' in self.sw_wallet:
if self.sw_wallet['skip_multisig_import'] == 'True': return self.sw_wallet['skip_multisig_import']
return True
else:
return False
else: else:
return False return False
def is_force_multisig_policy_enabled(self): def is_force_multisig_policy_enabled(self):
if 'force_multisig_policy' in self.sw_wallet: if 'force_multisig_policy' in self.sw_wallet:
if self.sw_wallet['force_multisig_policy'] == 'True': return self.sw_wallet['force_multisig_policy']
return True
else:
return False
else: else:
return False return False
@ -580,16 +571,14 @@ class NewWalletUX(UXStateMachine):
# receive address from the wallet. # receive address from the wallet.
if self.is_multisig(): if self.is_multisig():
# Only perform multisig import if wallet does not prevent it # Only perform multisig import if wallet does not prevent it
if self.is_skip_multisig_import_enabled(): if self.is_skip_multisig_import_enabled() == False:
continue
else:
self.choose_multisig_import_mode() self.choose_multisig_import_mode()
# Only perform address validation if wallet does not prevent it # Only perform address validation if wallet does not prevent it
if self.is_address_verification_skip_enabled(): if self.is_skip_address_verifivation_enabled():
if self.is_force_multisig_policy_enabled(): if self.is_force_multisig_policy_enabled():
result = await ux_show_story('For compatibility with {}, Passport will set your multisig policy to Skip Verification.\n{}'.format(self.sw_wallet['label']), result = await ux_show_story('For compatibility with {}, Passport will set your Multisig Policy to Skip Verification.\n'.format(self.sw_wallet['label']),
left_btn='NEXT', left_btn='OK',
center=True, center=True,
center_vertically=True) center_vertically=True)
if result == 'x': if result == 'x':
@ -657,16 +646,14 @@ class NewWalletUX(UXStateMachine):
# receive address from the wallet. # receive address from the wallet.
if self.is_multisig(): if self.is_multisig():
# Only perform multisig import if wallet does not prevent it # Only perform multisig import if wallet does not prevent it
if self.is_skip_multisig_import_enabled(): if self.is_skip_multisig_import_enabled() == False:
continue
else:
self.choose_multisig_import_mode() self.choose_multisig_import_mode()
# Only perform address validation if wallet does not prevent it # Only perform address validation if wallet does not prevent it
if self.is_address_verification_skip_enabled(): if self.is_skip_address_verifivation_enabled():
if self.is_force_multisig_policy_enabled(): if self.is_force_multisig_policy_enabled():
result = await ux_show_story('For compatibility with {}, Passport will set your multisig policy to Skip Verification.\n{}'.format(self.sw_wallet['label']), result = await ux_show_story('For compatibility with {}, Passport will set your multisig policy to Skip Verification.\n'.format(self.sw_wallet['label']),
left_btn='NEXT', left_btn='OK',
center=True, center=True,
center_vertically=True) center_vertically=True)
if result == 'x': if result == 'x':
@ -914,7 +901,7 @@ Compare them with the addresses shown on the next screen to make sure they match
continue continue
if not self.verified: if not self.verified:
if self.is_address_verification_skip_enabled(): if self.is_skip_address_verifivation_enabled():
if self.is_force_multisig_policy_enabled(): if self.is_force_multisig_policy_enabled():
result = await ux_show_story('For compatibility with {}, Passport will set your multisig policy to Skip Verification.\n{}'.format(self.sw_wallet['label']), result = await ux_show_story('For compatibility with {}, Passport will set your multisig policy to Skip Verification.\n{}'.format(self.sw_wallet['label']),
left_btn='NEXT', left_btn='NEXT',

6
ports/stm32/boards/Passport/modules/wallets/casa.py

@ -57,7 +57,7 @@ CasaWallet = {
{'id': 'microsd', 'label': 'microSD', 'filename_pattern': '{sd}/{xfp}-casa.txt', 'ext': '.txt', {'id': 'microsd', 'label': 'microSD', 'filename_pattern': '{sd}/{xfp}-casa.txt', 'ext': '.txt',
'filename_pattern_multisig': '{sd}/{xfp}-casa-multisig.txt', 'ext_multisig': '.txt'} 'filename_pattern_multisig': '{sd}/{xfp}-casa-multisig.txt', 'ext_multisig': '.txt'}
], ],
'skip_address_validation': 'True', 'skip_address_validation': True,
'skip_multisig_import': 'True', 'skip_multisig_import': True,
'force_multisig_policy': 'True' 'force_multisig_policy': True
} }

Loading…
Cancel
Save