diff --git a/src/seedsigner/views/psbt_views.py b/src/seedsigner/views/psbt_views.py index 475aef49..9e0fbeb1 100644 --- a/src/seedsigner/views/psbt_views.py +++ b/src/seedsigner/views/psbt_views.py @@ -58,7 +58,7 @@ class PSBTSelectSeedView(View): if len(seeds) > 0 and selected_menu_num < len(seeds): # User selected one of the n seeds - self.controller.psbt_seed = self.controller.get_seed(selected_menu_num) + self.controller.psbt_seed = seeds[selected_menu_num] return Destination(PSBTOverviewView) # The remaining flows are a sub-flow; resume PSBT flow once the seed is loaded. diff --git a/tests/test_flows_psbt.py b/tests/test_flows_psbt.py index 4141e575..1e3067de 100644 --- a/tests/test_flows_psbt.py +++ b/tests/test_flows_psbt.py @@ -57,6 +57,18 @@ class TestPSBTFlows(FlowTest): FlowStep(MainMenuView) ]) + # Run the same PSBT flow again, this time selecting the seed that the + # previous flow left loaded in memory. + self.run_sequence([ + FlowStep(MainMenuView, button_data_selection=MainMenuView.SCAN), + FlowStep(scan_views.ScanView, before_run=load_psbt_into_decoder), + FlowStep(psbt_views.PSBTSelectSeedView, screen_return_value=0), + FlowStep(psbt_views.PSBTOverviewView), + ]) + + # Selecting the existing seed should have set it as the signing seed + assert self.controller.psbt_seed is self.controller.storage.seeds[0] + def test_scan_psbt_first_then_load_electrum_seed(self): """