Add enhanced tests for account ID checksum validator endpoint#235
Merged
Sulex45 merged 1 commit intoJun 2, 2026
Merged
Conversation
- Add test for invalid checksum scenario - Add test for key that is too long - Add test to verify no Horizon API calls are made - All 9 tests passing - Resolves stellarkit-lab-devtools#221
|
@darius-daniel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Account ID Checksum Validator Endpoint - Enhanced Test Coverage
Overview
This PR enhances the test coverage for the account ID checksum validator endpoint (
/utils/validate-account), ensuring comprehensive validation of Stellar account IDs without hitting Horizon.Resolves
Closes #221
Changes Made
Test Enhancements
Added 3 additional test cases to
tests/utils.validateAccount.test.js:Implementation Verification
Confirmed the existing endpoint implementation includes:
GET /utils/validate-account?id=G...returns{ input, isValid, reason }StrKey.isValidEd25519PublicKey()from@stellar/stellar-sdkTest Results
Validation Scenarios Covered
API Response Examples
Valid Account ID
GET /utils/validate-account?id=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN{ "success": true, "data": { "input": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN", "isValid": true, "reason": null } }Invalid Checksum
GET /utils/validate-account?id=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVX{ "success": true, "data": { "input": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVX", "isValid": false, "reason": "Invalid key: checksum verification failed." } }Files Changed
tests/utils.validateAccount.test.js- Added 3 new comprehensive test casespackage-lock.json- Updated fromnpm installAcceptance Criteria Met
Checklist
Additional Notes
This endpoint provides a lightweight, fast validation utility for Stellar account IDs that can be used by developers to verify account ID structure before making Horizon API calls, reducing unnecessary network requests and improving application performance.
Closes #221