Skip to content

fix(accounts): treat createAccountAlreadyExist as non-fatal in fundTestnetAccount - #823

Closed
ElNeMeR70 wants to merge 1 commit into
trustflow-protocol:mainfrom
ElNeMeR70:fix/friendbot-already-funded
Closed

ElNeMeR70 wants to merge 1 commit into
trustflow-protocol:mainfrom
ElNeMeR70:fix/friendbot-already-funded

Conversation

@ElNeMeR70

Copy link
Copy Markdown

Summary

  • Adds idempotent fundTestnetAccount(address, options?) helper in src/stellar/account.ts (and re-exports from src/accounts and the root entry point).
  • Inspects Friendbot HTTP 400 responses for createAccountAlreadyExist / op_already_exists and resolves with { address, alreadyFunded: true } instead of throwing.
  • Updates createFundedAccount() in tests/e2e/support/network.ts and adds unit tests in tests/friendbot.test.ts + API docs in docs/API.md.

Fixes #771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] fundTestnetAccount() (friendbot helper) doesn't handle the case where the account already exists and is already funded

2 participants