Skip to content

Compare policy caps and payments as the same stroop integer - #298

Merged
karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
emrekayat:issue-249-stroop-caps
Oct 1, 2026
Merged

karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
emrekayat:issue-249-stroop-caps

Conversation

@emrekayat

Copy link
Copy Markdown
Contributor

Closes #249

Summary

  • Policy caps and payment amounts convert with the shared stroop helper and are stored as that integer, with no floating-point scaling.
  • The build route rejects a payment whose stroops exceed the allowing rule's cap, before any transaction is built.
  • Policy write and the build route reject amounts with more fractional digits than the asset allows.

Test plan

  • A payment equal to the cap is allowed and builds.
  • One stroop over the cap is denied and does not build.
  • An extra fractional digit is rejected on policy write and on build.
  • Tests use the mocked Horizon client and do not call Horizon.
  • vitest run on the policy engine, stroop helper, policy route, and build-payment route.

Made with Cursor

A cap and a payment now convert with the shared stroop helper, are stored as that integer, and a build is rejected when the payment exceeds the allowing cap or uses more fractional digits than the asset allows.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 00:58
@drips-wave

drips-wave Bot commented Oct 1, 2026

Copy link
Copy Markdown

@emrekayat 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@karagozemin
karagozemin merged commit 0352705 into Fortexa-stellar:main Oct 1, 2026
1 check failed
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.

Compare policy amount caps and built payments in the same stroop integer

3 participants