fix: #74 implement Wallet.File.key#137
Open
bibonix wants to merge 1 commit into
Open
Conversation
Wallet.File.key() returned an UnsupportedOperationException; it now reads the fourth line of the wallet file and returns the base64 RSA key recorded there, matching the on-disk layout the existing wallet fixtures and Wallet.File.id already rely on. The Wallet interface declaration adds throws IOException so File-backed lookups can surface I/O failures the way id and merge already do. WalletTest.keyIsNotYetImplemented is replaced with readsPublicKey, which exercises the new path against the existing 12345678abcdef fixture.
edmoffo
approved these changes
Jun 22, 2026
edmoffo
left a comment
Contributor
There was a problem hiding this comment.
Diff replaces the UnsupportedOperationException stub in Wallet.File.key with a fourth-line read that mirrors the existing id implementation (same Split/ListOf/Checked chain over this.path, same hex-based fixture layout). The interface picks up throws IOException alongside id and merge, and Fake.key keeps its narrower signature. WalletTest.keyIsNotYetImplemented is replaced with readsPublicKey asserting the base64 key embedded in the 12345678abcdef fixture, and the puzzle marker for #54 in Wallet.java is dropped. Local checks listed in the body match the green CI on this head (mvn across ubuntu/windows/macos, qulice, pdd, xcop, typos, etc.).
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.
Wallet.File.key()threwUnsupportedOperationException("key() not yet supported")since the class was introduced, and the matching puzzle in the source has been open as #74 from 2018. Any caller that asked a file-backed wallet for its RSA key tripped the exception at runtime;Copies.equalWalletsin #79 reaches forWallet.key()and would have hit the same wall once both sides wereWallet.File.The implementation reuses the cactoos
Split/ListOfchain thatWallet.File.idalready uses and returns the fourth line of the wallet file, which is where the base64 RSA key is recorded according to the existing fixtures undersrc/test/resources/walletsandsrc/test/resources/walletsIn. TheWalletinterface gainsthrows IOExceptiononkey()so the file-backed reader can surface I/O failures the same wayidandmergealready do;Wallet.Fake.key()keeps its signature because it does no I/O. The placeholderWalletTest.keyIsNotYetImplementedis replaced byreadsPublicKey, which asserts the value embedded in the12345678abcdeffixture comes back unchanged.Ran
mvn -B test(68 tests, 0 failures, 5 skipped — same skipped set asmaster) andmvn -B -Pqulice -DskipTests verifyto confirm Qulice still passes.Closes #74