Skip to content

feat(examples): add attestation timeout, zero-amount validation, and …#17

Open
mrnetwork0001 wants to merge 1 commit into
circlefin:masterfrom
mrnetwork0001:feat/examples-timeout-and-dryrun
Open

feat(examples): add attestation timeout, zero-amount validation, and …#17
mrnetwork0001 wants to merge 1 commit into
circlefin:masterfrom
mrnetwork0001:feat/examples-timeout-and-dryrun

Conversation

@mrnetwork0001

Copy link
Copy Markdown

Description

This PR improves the example bridge scripts with better error handling and developer experience.

Changes

  1. Attestation timeout (--timeout): The fetchAttestation() loop now has a configurable timeout (default: 600s / 10 minutes) instead of polling indefinitely. When the timeout is reached, a clear error message is shown suggesting the user retry with a longer timeout.

  2. Progress reporting: Attestation polling now shows attempt count and remaining time, making it much clearer what's happening during the wait.

  3. Zero-amount validation: Added client-side validation for --amount 0 with a clear error message, instead of letting the user hit a confusing AmountMustBeNonzero contract error on-chain.

  4. Dry-run flag (--dryRun): When set to true, the burn transaction is submitted but attestation polling and the receive/mint step are skipped. Useful for testing burn configuration without waiting for cross-chain completion.

  5. Updated examples README: Documented the new --timeout and --dryRun flags in the usage section.

Motivation

The existing infinite polling loop in fetchAttestation() could hang the process forever if an attestation never arrives (e.g., due to a misconfigured domain, insufficient fee, or attestation service issues). New developers trying the bridge tool for the first time may not realize the process is stuck versus still working.

Testing

  • Verified TypeScript types are correct for new ParsedArgs fields
  • Tested --timeout validation with non-numeric and negative values
  • Tested --amount 0 shows proper error message
  • No runtime behavioral changes for existing usage patterns (defaults match prior behavior)

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.

1 participant