Skip to content

Conversation

@Chaitanya-Keyal
Copy link
Contributor

Description

This PR refactors the seed views to pass the selected Seed object directly to the next view instead of using seed_num.

Previously, almost every view would immediately dereference seed_num to fetch the Seed object from SeedStorage, resulting in redundant lookups. Passing the Seed object itself removes that redundancy and provides a more robust reference to the selected seed, avoiding potential fragility in the future.

The motivation for this change came up while I was working on #785. In that context, it became clear that relying on seed_num is brittle, since it’s only the index of a mutable list. See my comment for details.

Benefits:

  • Removes redundant lookups in views
  • More robust references to seeds
  • Safer against future changes in seed storage (e.g., reordering, new seed types(?))

This pull request is categorized as a:

  • Code refactor

Checklist

  • I’ve run pytest and made sure all unit tests pass before submitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • N/A

I have tested this PR on the following platforms/os:

@Chaitanya-Keyal Chaitanya-Keyal force-pushed the refactor/seed_num-to-seed branch from a1357c3 to 7d20f80 Compare October 23, 2025 17:51
@Chaitanya-Keyal Chaitanya-Keyal force-pushed the refactor/seed_num-to-seed branch 2 times, most recently from 52b74ca to 78982eb Compare December 16, 2025 04:10
@newtonick newtonick added this to the 0.9.0 milestone Dec 16, 2025
@newtonick newtonick moved this to 0.9.0 Needs Code Review in @SeedSigner Development Board Dec 16, 2025
@Chaitanya-Keyal Chaitanya-Keyal force-pushed the refactor/seed_num-to-seed branch from 78982eb to 63327a0 Compare January 20, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 0.9.0 Needs Code Review

Development

Successfully merging this pull request may close these issues.

2 participants