Skip to content

Fix #229 #228 #227 #226: fee charging, negative guard, withdrawal acc… - #324

Merged
hartz0 merged 2 commits into
hartz0:mainfrom
cathy4455:fix/229-228-227-226-fee-and-audit-fixes
Oct 23, 2026
Merged

hartz0 merged 2 commits into
hartz0:mainfrom
cathy4455:fix/229-228-227-226-fee-and-audit-fixes

Conversation

@cathy4455

Copy link
Copy Markdown

…ounting, and batch override audit trail

#228: set_gate_query_fee now rejects negative amounts (returns InvalidScore) and emits gate_query_fee_set (gqf_set) audit event on every fee update.

#227: withdraw_fees rejects amount <= 0 (returns InvalidWithdrawalAmount), checks amount <= accumulated_fees (returns InsufficientFunds), and decrements the accumulated_fees counter on successful withdrawal.

#229: Added query_risk_gate_paid variant that charges the configured per-query fee via SEP-41 token transfer and increments accumulated_fees. query_risk_gate remains infallible and side-effect free (pure read). Documentation updated to clarify side-effect vs pure query semantics.

#226: batch_override_rate_limit now accepts a justification parameter and writes RateLimitOverrideEntry audit records for every modified wallet, matching the compliance guarantees of the single override_rate_limit path.

Also:

…ve guard, withdrawal accounting, and batch override audit trail

hartz0#228: set_gate_query_fee now rejects negative amounts (returns InvalidScore)
and emits gate_query_fee_set (gqf_set) audit event on every fee update.

hartz0#227: withdraw_fees rejects amount <= 0 (returns InvalidWithdrawalAmount),
checks amount <= accumulated_fees (returns InsufficientFunds), and
decrements the accumulated_fees counter on successful withdrawal.

hartz0#229: Added query_risk_gate_paid variant that charges the configured
per-query fee via SEP-41 token transfer and increments accumulated_fees.
query_risk_gate remains infallible and side-effect free (pure read).
Documentation updated to clarify side-effect vs pure query semantics.

hartz0#226: batch_override_rate_limit now accepts a justification parameter and
writes RateLimitOverrideEntry audit records for every modified wallet,
matching the compliance guarantees of the single override_rate_limit path.

Also:
- Added InsufficientFunds error alias (Error enum at 50-variant XDR limit)
- Added set_accumulated_fees storage helper
- Registered gqf_set event in event_stability.rs
- Updated test_rate_limit.rs for new batch_override_rate_limit signature
- Added comprehensive tests in test_fee.rs for all 4 issues
- Updated .gitignore to exclude test_snapshots/ from version control
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

@hartz0
hartz0 merged commit d6f4415 into hartz0:main Oct 23, 2026
7 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants