refactor!: de-stutter the migration errors and pin the NoSyncData contract - #2575
Merged
Merged
Conversation
…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
approved these changes
Jul 29, 2026
Oscar-Pepper
left a comment
Contributor
There was a problem hiding this comment.
not merging until #2582 (review) is resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2574, implementing the two suggestions from its review.
The variant stutter is gone.
MigrationError::MigrationTransactionFailedandMigrationError::MigrationConfirmationTimeoutrepeated the enum's name at every use site. They becomeTransactionFailedandConfirmationTimeout, 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 publicMigrationErrorenum, exactly as the base PR's rename was, and rides the same major bump.The
NoSyncDatacontract is pinned. #2574 gaveget_migration_heightsthe 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 returnsWalletError::NoSyncDataitself, 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