Skip to content

feat: #610 get_subscription_token, #611 two-step fee auth, #609 merch… - #772

Open
Naomi-Gift wants to merge 1 commit into
SiLioLabs:masterfrom
Naomi-Gift:master
Open

feat: #610 get_subscription_token, #611 two-step fee auth, #609 merch…#772
Naomi-Gift wants to merge 1 commit into
SiLioLabs:masterfrom
Naomi-Gift:master

Conversation

@Naomi-Gift

Copy link
Copy Markdown

Closes #610 — get_subscription_token(env, user) -> Option

added to lib.rs. No auth required. Returns Some(token) for any existing record (including cancelled), None for users who never subscribed. 4 unit tests + snapshots.

closes #611 — propose_fee and commit_fee now enforce admin::require_admin() at the lib.rs entry point (the logic in fee.rs was already correct, just missing the auth guard). 11 new unit tests covering the full propose→commit flow, NoPendingProposal panic, invalid bps, re-propose override, double-commit guard, and zero/max bps edge cases.

closes #609 — scripts/merchant-analytics.ts with --sort-by subscribers|revenue|growth, --top N, --compare-days N for churn/growth trends, and --format table|json|csv.

closes #608 — scripts/audit-trail.ts with --from/--to ledger range, per-event fee reconstruction from fee_set history, --subscriber/--merchant filters, --format markdown|csv|json, and SHA-256 tamper-evidence hash on every report.

Side fix: renamed HealthReport::pending_merchant_revenues_count → pending_merchant_rev_count to satisfy Soroban's 30-character field name limit (was causing a pre-existing compile error blocking all tests).

…e auth, SiLioLabs#609 merchant analytics, SiLioLabs#608 audit trail SiLioLabs#610 - Add get_subscription_token(env, user) -> Option<Address> - New view function in lib.rs; no auth required - Returns Some(token) for any existing record (active or cancelled) - Returns None for users who never subscribed - 4 unit tests + snapshots SiLioLabs#611 - Enforce admin auth on propose_fee / commit_fee - propose_fee and commit_fee now call admin::require_admin() (were missing guard) - Logic already existed in fee.rs; lib.rs entry points lacked the auth check - 11 unit tests covering full propose→commit flow, NoPendingProposal panic, invalid bps, re-propose, double-commit, zero/max bps edge cases - Updated snapshots for existing fee tests affected by the new auth guard SiLioLabs#609 - Add scripts/merchant-analytics.ts - Extends top-merchants.ts with revenue, avg subscription amount, subscriber count, 30-day churn rate, and subscriber growth rate - --sort-by subscribers|revenue|growth, --top N (default 10) - --compare-days <N> for trend window, --format table|json|csv, --out file SiLioLabs#608 - Add scripts/audit-trail.ts - --from / --to ledger range, streams events to avoid buffering large ranges - Structured AuditEntry: event_type, timestamp, subscriber, merchant, amount/fee/net in stroops, tx_hash, ledger - Reconstructs fee_bps per-event from fee_set/fee_committed event history - --subscriber / --merchant filters, --format markdown|csv|json, --out file - SHA-256 content hash appended to every report for tamper evidence - Totals summary: charges, volume, fees, unique subscribers/merchants Fix HealthReport.pending_merchant_revenues_count field name (>30 chars) - Renamed to pending_merchant_rev_count to satisfy Soroban SDK field limit
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Naomi-Gift 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

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

Labels

None yet

Projects

None yet

1 participant