Skip to content

feat(core): implement ExtendFootprintTTLOp with simulation and fee parsing (#115) - #288

Merged
AbdulmalikAlayande merged 1 commit into
TegoLabs:mainfrom
daveades:feat/issue-115-extend-footprint-ttl-op
Jun 30, 2026
Merged

AbdulmalikAlayande merged 1 commit into
TegoLabs:mainfrom
daveades:feat/issue-115-extend-footprint-ttl-op

Conversation

@daveades

Copy link
Copy Markdown
Contributor

Summary

  • feeCharged in SubmitTransactionResult: pollTransaction now parses feeCharged from the Stellar RPC getTransaction response and includes it in every successful submit result
  • feeCharged in ExtensionResult: extendEntries threads the actual fee charged through so callers get back tx hash, ledger, and fee paid in one result object
  • feeCharged field distinction: estimatedFee (from simulateExtension) remains the pre-submission estimate; feeCharged is the post-submission actual cost

New tests

tests/rpc/client.test.ts — ExtendFootprintTTLOp — Simulation and Fee Parsing

  • simulateExtension returns minResourceFee from footprint simulation
  • simulateExtension propagates RPC error on failure
  • submitExtension calls simulateTransaction before sendTransaction (call order asserted via spy invocation indices)
  • submitExtension parses feeCharged from the successful transaction result
  • submitExtension returns feeCharged as undefined when the field is absent from the RPC response

tests/core/extension.test.ts — additions to extendEntries and simulateExtension

  • extendEntries propagates feeCharged from the submitted transaction result
  • simulateExtension delegates to the RPC client and surfaces the estimated fee as estimatedFee

Test plan

  • All 687 tests pass (54 test files)
  • Simulation-before-build verified via spy invocation call order
  • Fee parsing verified with mock feeCharged: 1234 on the getTransaction response
  • Edge case: feeCharged absent from result → undefined (not NaN)

Closes #115

…rsing (TegoLabs#115)

Complete the ExtendFootprintTTLOp transaction building pipeline:

- Add `feeCharged` to `SubmitTransactionResult`: capture the actual fee
  paid by parsing `feeCharged` from the Stellar RPC getTransaction response
  inside `pollTransaction`
- Add `feeCharged` to `ExtensionResult` and thread it through `extendEntries`
  so callers receive both the tx hash and actual fee charged

Tests added in tests/rpc/client.test.ts:
  - simulateExtension returns minResourceFee for footprint estimation
  - simulateExtension propagates RPC error on failure
  - submitExtension calls simulateTransaction before sendTransaction (order verified)
  - submitExtension parses feeCharged from successful transaction result
  - submitExtension returns feeCharged as undefined when absent from result

Tests added in tests/core/extension.test.ts:
  - extendEntries propagates feeCharged from submitted transaction result
  - simulateExtension delegates to RPC client and returns estimated fee
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@daveades, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd1e664b-7ce7-4bef-a5d9-e96cabfb886e

📥 Commits

Reviewing files that changed from the base of the PR and between 92a2417 and 00e5569.

📒 Files selected for processing (4)
  • src/core/extension.ts
  • src/rpc/client.ts
  • tests/core/extension.test.ts
  • tests/rpc/client.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@daveades 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! 🚀

Learn more about application limits

@gitguardian

gitguardian Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 6 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret 3dd17ce tests/core/vault.test.ts View secret
- - Generic High Entropy Secret 3dd17ce tests/core/vault.test.ts View secret
- - Generic High Entropy Secret 3dd17ce tests/core/vault.test.ts View secret
- - Generic High Entropy Secret b59bef4 tests/core/vault.test.ts View secret
- - Generic High Entropy Secret b59bef4 tests/core/vault.test.ts View secret
- - Generic High Entropy Secret b59bef4 tests/core/vault.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@AbdulmalikAlayande
AbdulmalikAlayande merged commit e1c0abe into TegoLabs:main Jun 30, 2026
3 checks passed
AbdulmalikAlayande pushed a commit that referenced this pull request Aug 2, 2026
…rsing (#115) (#288)

Complete the ExtendFootprintTTLOp transaction building pipeline:

- Add `feeCharged` to `SubmitTransactionResult`: capture the actual fee
  paid by parsing `feeCharged` from the Stellar RPC getTransaction response
  inside `pollTransaction`
- Add `feeCharged` to `ExtensionResult` and thread it through `extendEntries`
  so callers receive both the tx hash and actual fee charged

Tests added in tests/rpc/client.test.ts:
  - simulateExtension returns minResourceFee for footprint estimation
  - simulateExtension propagates RPC error on failure
  - submitExtension calls simulateTransaction before sendTransaction (order verified)
  - submitExtension parses feeCharged from successful transaction result
  - submitExtension returns feeCharged as undefined when absent from result

Tests added in tests/core/extension.test.ts:
  - extendEntries propagates feeCharged from submitted transaction result
  - simulateExtension delegates to RPC client and returns estimated fee

Co-authored-by: dave <jesugbohunmi23@mail.com>
AbdulmalikAlayande pushed a commit that referenced this pull request Aug 2, 2026
…rsing (#115) (#288)

Complete the ExtendFootprintTTLOp transaction building pipeline:

- Add `feeCharged` to `SubmitTransactionResult`: capture the actual fee
  paid by parsing `feeCharged` from the Stellar RPC getTransaction response
  inside `pollTransaction`
- Add `feeCharged` to `ExtensionResult` and thread it through `extendEntries`
  so callers receive both the tx hash and actual fee charged

Tests added in tests/rpc/client.test.ts:
  - simulateExtension returns minResourceFee for footprint estimation
  - simulateExtension propagates RPC error on failure
  - submitExtension calls simulateTransaction before sendTransaction (order verified)
  - submitExtension parses feeCharged from successful transaction result
  - submitExtension returns feeCharged as undefined when absent from result

Tests added in tests/core/extension.test.ts:
  - extendEntries propagates feeCharged from submitted transaction result
  - simulateExtension delegates to RPC client and returns estimated fee

Co-authored-by: dave <jesugbohunmi23@mail.com>
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.

feat(core): implement transaction building for ExtendFootprintTTLOp

2 participants