Skip to content

[wip] accounts / signer refactor#4502

Draft
DelevoXDG wants to merge 4 commits into
masterfrom
zdobnikau/accounts-signer-refactor
Draft

[wip] accounts / signer refactor#4502
DelevoXDG wants to merge 4 commits into
masterfrom
zdobnikau/accounts-signer-refactor

Conversation

@DelevoXDG

@DelevoXDG DelevoXDG commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Towards #4498

Introduced changes

Primary:

  1. Replace untagged SignerType deserialize with:
    • i SignerTypeParams - file representation, with flat Option<> fields for signer locators (private_key, ledger_path + upcoming keystore and keyring variants)
    • ii. SignerType - internal repr with Ambiguous variant for clear handling (soft-parsing) of 0 or ≥2 locator fields.
  2. Capture unknown_fields on AccountData
    • TBD: warn/error once accounts-file JSON shape is stabilized
  3. Keep on-disk accounts-file JSON shape unchanged
  4. account list: always show signer_type (private_key | ledger | ambiguous) in text + JSON
  5. Fix command field in account list --json: account deleteaccount list

Context:

  • Hard-fail Ambiguous on use (build_signer) and on serialize (avoid wiping locator keys on write)
  • Centralize accounts-file signing through build_signerSignerBackend (resolve / deploy / address compute / devnet); drop duplicated local/ledger builders

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

Primary:
- Replace untagged `SignerType` deserialize with flat `Option<>` fields; soft-parse `Ambiguous`
- Capture `unknown_fields` on `AccountData`; keep on-disk accounts JSON shape unchanged
- Rework `account list` to display `Ambiguous`/ledger via `SignerDisplay` without serializing `SignerType::Ambiguous`

Context:
- Hard-fail `Ambiguous` on use (`build_signer`) and on serialize (prevent wiping keys)
- Add `build_signer` → `SignerBackend` seam; route account resolve, deploy, and address compute through it
- Add `build_account_variant` wrap helper; remove duplicated local/ledger account construction paths
- Route devnet accounts through `build_signer`; drop separate local-only builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant