Repository navigation
feat: testable asset mocks and robust Friendbot error handling - #155
Merged
akargi merged 5 commits intoNov 2, 2026
Merged
Conversation
Add runtime configuration for latency, error rate, and injectable randomness, plus a one-shot failure queue so tests and local development can exercise loading and error states without patching the module. Closes Chulilee#57
Verify the default 200ms delay, zero-latency mode, one-shot failures, error-rate driven failures, validation, and reset behaviour. Closes Chulilee#57
Parse Horizon problem+json, legacy plain-text failures, and proxy error pages into a FriendbotError that carries the normalised code, HTTP status, raw detail, and retry hint. Every documented account-creation and transaction result code gets actionable guidance, and all already-funded response formats remain idempotent successes. Closes Chulilee#56
Keep fundWithFriendbot as the public entry point while moving response parsing into the focused friendbot module. Closes Chulilee#56
Exercise already-funded idempotency, invalid addresses, operation and transaction result codes, rate limits, server pages, unknown bodies, and network failures against a mocked fetch. Closes Chulilee#56
|
@akargi is attempting to deploy a commit to the Akargi Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
Implements the two open issues assigned to Akargi.
#57 — Configurable asset-service mocks
configureAssetService,getAssetServiceConfig,resetAssetServiceConfig, andsimulateAssetServiceFailuretosrc/services/assetService.ts.Math.random.RangeError.src/services/__tests__/assetService.test.tscovering defaults, configurable latency, zero-latency mode, queued failures, error-rate failures, validation, and reset behaviour.#56 — Robust Friendbot error handling
src/lib/stellar/friendbot.ts;fundWithFriendbotinhorizon.tsremains the public entry point.extras.result_codes.operations/transaction) with a legacy plain-text fallback.op_already_exists,createAccountAlreadyExist,account already funded to starting balance, andaccount already exists.FriendbotErrorcarrying the normalisedcode, HTTPstatus, rawdetail,retryablehint, and the originalfriendbotCode.src/lib/stellar/__tests__/friendbot.test.tswith mocked Friendbot responses for success and failure paths.Notes for reviewers
fundWithFriendbotkeeps the same signature; callers inuseWalletcontinue to receive anErrorwhosemessageis safe to display.npm install, CI, and the test suite were not run locally. CI will run lint, type-check, Jest, and the production build.Closes #57
Closes #56