Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Language & Add Warning for Signing Without Multisig Descriptor Loaded #533

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/seedsigner/views/psbt_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def run(self):

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


Expand Down Expand Up @@ -330,9 +331,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 @@ -345,7 +348,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 @@ -413,7 +416,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",
Comment on lines +422 to +425
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be a DireWarningScreen (but a yellow standard WarningScreen I'd be good with). This said, I think this PR overall is a good improvement and will merge as is. Would be trivial to change to WarningScreen prior to another release if needed.

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 @@ -73,7 +73,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 @@ -85,7 +86,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
Loading