Skip to content

Commit

Permalink
Merge pull request #533 from 3rdIteration/fix_multisig_descriptor_wipe
Browse files Browse the repository at this point in the history
Clarify Language & Add Warning for Signing Without Multisig Descriptor Loaded
  • Loading branch information
newtonick authored Apr 29, 2024
2 parents e5d3133 + 2e3c74e commit adbf5bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 17 additions & 2 deletions src/seedsigner/views/psbt_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def run(self):

class PSBTChangeDetailsView(View):
NEXT = "Next"
SKIP_VERIFICATION = "Skip Verificiation"
VERIFY_MULTISIG = "Verify Multisig Change"


Expand Down Expand Up @@ -329,9 +330,11 @@ def run(self):
if is_change_derivation_path:
title = "Your Change"
self.VERIFY_MULTISIG = "Verify Multisig Change"
unverified_warning_text = "Can't Verify that Change Outputs Belong to your Wallet"
else:
title = "Self-Transfer"
self.VERIFY_MULTISIG = "Verify Multisig Addr"
unverified_warning_text = "Can't Verify that Self-Transfer Outputs Belong to your Wallet"
# if psbt_parser.num_change_outputs > 1:
# title += f" (#{self.change_address_num + 1})"

Expand All @@ -344,7 +347,7 @@ def run(self):

else:
# Have the Screen offer to load in the multisig descriptor.
button_data = [self.VERIFY_MULTISIG, self.NEXT]
button_data = [self.VERIFY_MULTISIG, self.SKIP_VERIFICATION]

else:
# Single sig
Expand Down Expand Up @@ -412,7 +415,19 @@ def run(self):
if selected_menu_num == RET_CODE__BACK_BUTTON:
return Destination(BackStackView)

elif button_data[selected_menu_num] == self.NEXT:
elif button_data[selected_menu_num] == self.NEXT or button_data[selected_menu_num] == self.SKIP_VERIFICATION:
if button_data[selected_menu_num] == self.SKIP_VERIFICATION:
selected_menu_num = self.run_screen(
DireWarningScreen,
title="Security Warning",
status_icon_name=SeedSignerIconConstants.WARNING,
status_headline="Potential Loss of Funds",
text=unverified_warning_text,
)

if selected_menu_num == RET_CODE__BACK_BUTTON:
return Destination(BackStackView)

if self.change_address_num < psbt_parser.num_change_outputs - 1:
return Destination(PSBTChangeDetailsView, view_args={"change_address_num": self.change_address_num + 1})
else:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_flows_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def load_seed_into_decoder(view: scan_views.ScanView):
FlowStep(psbt_views.PSBTOverviewView),
FlowStep(psbt_views.PSBTMathView),
FlowStep(psbt_views.PSBTAddressDetailsView, button_data_selection=0),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=psbt_views.PSBTChangeDetailsView.NEXT),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=psbt_views.PSBTChangeDetailsView.SKIP_VERIFICATION),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=0),
FlowStep(psbt_views.PSBTFinalizeView, button_data_selection=psbt_views.PSBTFinalizeView.APPROVE_PSBT),
FlowStep(psbt_views.PSBTSigningErrorView, button_data_selection=psbt_views.PSBTSigningErrorView.SELECT_DIFF_SEED),
FlowStep(psbt_views.PSBTSelectSeedView, button_data_selection=psbt_views.PSBTSelectSeedView.SCAN_SEED),
Expand All @@ -84,7 +85,8 @@ def load_seed_into_decoder(view: scan_views.ScanView):
FlowStep(psbt_views.PSBTOverviewView),
FlowStep(psbt_views.PSBTMathView),
FlowStep(psbt_views.PSBTAddressDetailsView, button_data_selection=0),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=psbt_views.PSBTChangeDetailsView.NEXT),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=psbt_views.PSBTChangeDetailsView.SKIP_VERIFICATION),
FlowStep(psbt_views.PSBTChangeDetailsView, button_data_selection=0),
FlowStep(psbt_views.PSBTFinalizeView, button_data_selection=psbt_views.PSBTFinalizeView.APPROVE_PSBT),
FlowStep(psbt_views.PSBTSignedQRDisplayView),
FlowStep(MainMenuView),
Expand Down

0 comments on commit adbf5bc

Please sign in to comment.