Improve wallet repair with previews, validation, error handling, and multi-coin support#295
Open
QuickMythril wants to merge 9 commits intoQortal:masterfrom
Open
Improve wallet repair with previews, validation, error handling, and multi-coin support#295QuickMythril wants to merge 9 commits intoQortal:masterfrom
QuickMythril wants to merge 9 commits intoQortal:masterfrom
Conversation
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.
Summary
forceoverride.Issue
Refs: #294
Commit breakdown
Require private key for litecoin repair
src/main/java/org/qortal/api/resource/CrossChainLitecoinResource.java: validate deterministic private keys for repair so xpub/tpub are rejected.src/main/java/org/qortal/crosschain/Bitcoiny.java: add a private-key validator helper used by repair endpoints.Return API errors for wallet repair failures
src/main/java/org/qortal/api/resource/CrossChainLitecoinResource.java: map repair failures to API errors so clients get clear error responses.src/main/java/org/qortal/crosschain/Bitcoiny.java: throw structured exceptions instead of returning class-name strings.src/test/java/org/qortal/test/crosschain/BitcoinyTests.java: align tests with the new error handling.Assert repair returns valid txid
src/test/java/org/qortal/test/crosschain/BitcoinyTests.java: verify txid format rather than just non-null responses.Add litecoin repair preview endpoint
src/main/java/org/qortal/crosschain/RepairWalletPreview.java: new response model for preview summaries.src/main/java/org/qortal/crosschain/Bitcoiny.java: implement old-vs-current scan comparison, missing balance, fee/dust estimate, and recommendation logic.src/main/java/org/qortal/api/resource/CrossChainLitecoinResource.java: add/repair/previewendpoint to expose the summary.src/test/java/org/qortal/test/crosschain/BitcoinyTests.java: add preview test coverage.Gate litecoin repair behind recommendation
src/main/java/org/qortal/api/resource/CrossChainLitecoinResource.java: refuse repair when preview is not recommended unlessforce=true.Add repair preview and gated repair for BTC/DOGE/DGB/RVN
src/main/java/org/qortal/api/resource/CrossChainBitcoinResource.java: add preview endpoint and force-gated repair.src/main/java/org/qortal/api/resource/CrossChainDogecoinResource.java: add preview endpoint and force-gated repair.src/main/java/org/qortal/api/resource/CrossChainDigibyteResource.java: add preview endpoint and force-gated repair.src/main/java/org/qortal/api/resource/CrossChainRavencoinResource.java: add preview endpoint and force-gated repair.Document force query param in repair endpoints
src/main/java/org/qortal/api/resource/CrossChainBitcoinResource.java: OpenAPI@Parameterdocs forforce.src/main/java/org/qortal/api/resource/CrossChainLitecoinResource.java: OpenAPI@Parameterdocs forforce.src/main/java/org/qortal/api/resource/CrossChainDogecoinResource.java: OpenAPI@Parameterdocs forforce.src/main/java/org/qortal/api/resource/CrossChainDigibyteResource.java: OpenAPI@Parameterdocs forforce.src/main/java/org/qortal/api/resource/CrossChainRavencoinResource.java: OpenAPI@Parameterdocs forforce.Add API tests for repair preview and force
src/test/java/org/qortal/test/api/CrossChainRepairApiTests.java: new API-level tests for preview summaries and force-gated repair behavior using a dummy provider to avoid network calls.Fix repair test compilation and exception ctor
src/main/java/org/qortal/crosschain/ForeignBlockchainException.java: add a(String, Throwable)constructor so repair paths can preserve causes without build errors.src/test/java/org/qortal/test/api/CrossChainRepairApiTests.java: rely on the staticApiCommon.assertApiErrorhelper to avoid an invalid instance override and keep tests compiling.