Skip to content

refactor!: de-stutter the migration errors and pin the NoSyncData contract - #2575

Merged
zancas merged 1 commit into
pr2428_review_followupsfrom
pr2574_review_suggestions
Jul 29, 2026
Merged

refactor!: de-stutter the migration errors and pin the NoSyncData contract#2575
zancas merged 1 commit into
pr2428_review_followupsfrom
pr2574_review_suggestions

Conversation

@zancas

@zancas zancas commented Jul 28, 2026

Copy link
Copy Markdown
Member

Stacked on #2574, implementing the two suggestions from its review.

The variant stutter is gone. MigrationError::MigrationTransactionFailed and MigrationError::MigrationConfirmationTimeout repeated the enum's name at every use site. They become TransactionFailed and ConfirmationTimeout, which reads as Rust convention intends at the match site. The display strings are unchanged, so no user-facing text moves. The rename is breaking on the public MigrationError enum, exactly as the base PR's rename was, and rides the same major bump.

The NoSyncData contract is pinned. #2574 gave get_migration_heights the job of typing the absent-sync case once, and documented it, but nothing enforced the promise. A unit test now constructs a wallet that has never synced and asserts the wrapper returns WalletError::NoSyncData itself, so every migration site inherits the typed refusal from one place and the doc comment's claim is a tested contract.

🤖 Generated with Claude Code

…tract

This implements the two suggestions from the #2574 review.

MigrationError::MigrationTransactionFailed and
MigrationError::MigrationConfirmationTimeout repeated the enum's name at
every use site; they become TransactionFailed and ConfirmationTimeout.
The display strings are unchanged, so no user-facing text moves. The
rename is breaking on the public MigrationError enum, exactly as the base
PR's rename was.

A unit test pins the contract #2574 gave get_migration_heights: a wallet
that has never synced returns the typed WalletError::NoSyncData from the
wrapper itself, so every migration site inherits the typed refusal from
one place and the promise in the wrapper's doc comment is enforced rather
than asserted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@Oscar-Pepper Oscar-Pepper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not merging until #2582 (review) is resolved

@zancas
zancas merged commit 3be602f into pr2428_review_followups Jul 29, 2026
20 checks passed
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.

2 participants