Repository navigation
refactor: remove a deprecated KhaosDatabase overload and unused imports - #7021
Merged
kuny0707 merged 9 commits intoOct 13, 2026
Conversation
The BlockId overload had no callers. Every caller uses getBranch(Sha256Hash, Sha256Hash), which rejects a branch whose parent is missing.
halibobo1205
approved these changes
Oct 12, 2026
bladehan1
approved these changes
Oct 13, 2026
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.
What does this PR do?
KhaosDatabase.getBranch(BlockId, BlockId), which is marked@Deprecatedand has no callers.getBranch(Sha256Hash, Sha256Hash), whichManageruses, is unchanged.src/main/java): chainbase 36, framework 29, consensus 4, p2p 3, crypto 1, plugins 1. Each module is a separate commit.Why are these changes required?
getBranch(Sha256Hash, Sha256Hash)throwsNonCommonBlockException. The existing call sites pass aSha256Hashas one of the two arguments, so they already resolve to the remaining overload and keep their behavior.UnusedImportsrule, and chainbase, consensus, crypto and p2p do not run Checkstyle, so unused imports were never reported.This PR has been tested by:
KhaosDatabaseTest,ManagerMockTestand checkstyle (framework, plugins) pass.src/main/javafile for imports whose name is not used outside comments and string literals. Imports referenced only from Javadoc{@link}are kept (UnsignedBytesinFastByteComparisons,AccountIdIndexStoreinMigrateTurkishKeyHelper).Follow up
None.
Extra details