Skip to content

Feature/compliance batch and hardening - #529

Open
jhaydeeee-web wants to merge 4 commits into
WHEELBACK:mainfrom
jhaydeeee-web:feature/compliance-batch-and-hardening
Open

Feature/compliance batch and hardening#529
jhaydeeee-web wants to merge 4 commits into
WHEELBACK:mainfrom
jhaydeeee-web:feature/compliance-batch-and-hardening

Conversation

@jhaydeeee-web

Copy link
Copy Markdown

Closes #394
Closes #395
Closes #396
Closes #397

SUMMARY

  1. fix(compliance): reject past-expiry timestamps in allow_address_until — Added ContractError::PastExpiry; allow_address_until now rejects
    until <= env.ledger().timestamp() instead of silently creating an already-expired entry. Updated two existing tests that relied on the old
    past-timestamp behavior (they now advance the ledger clock after creation instead), and added 3 new tests for the
    boundary/rejection/acceptance cases. Documented in docs/error-codes.md.
  2. test(compliance): cover clear_address interaction with allow_address_until expiry — Added 3 tests: clearing before expiry, clearing after
    expiry, and clearing a never-allowed address — each asserting is_allowed is false immediately after. No production code change.
  3. feat(compliance): add batch_allow_addresses for bulk merchant onboarding — New batch_allow_addresses(admin, addresses, until) entry point.
    Same admin-auth and past-expiry checks as allow_address_until, capped at 50 addresses (ContractError::BatchTooLarge above that, checked
    before any writes so a rejected batch has zero partial effects), emitting one address_allowed event per address. Documented the new error
    code.
  4. feat(compliance): emit batch summary event and document event shapes — Added a compliance_batch_processed event (payload: admin,
    processed_count) emitted once after each batch_allow_addresses call, so an indexer can confirm a batch fully landed without counting
    individual events. Added a full "Compliance events" section to docs/error-codes.md documenting every compliance event's topic, emitter, and
    payload shape.

jhaydeeee-web and others added 4 commits August 27, 2026 17:45
allow_address_until previously accepted any u64, including timestamps
already in the past, silently creating an entry that was immediately
expired. Add ContractError::PastExpiry and reject until <= now
explicitly, and document the new variant in docs/error-codes.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…until expiry

clear_address (added in WHEELBACK#100) had no coverage for how it interacts
with an active AllowedUntil expiry: whether clearing before expiry,
after expiry, or on a never-allowed address behaves identically.
Add tests asserting is_allowed is false immediately after
clear_address in all three cases.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
allow_address_until only accepted one address per call, forcing one
transaction per address during bulk compliance review onboarding.
Add batch_allow_addresses(admin, addresses, until), enforcing the
same admin-only authorization and expiry validation as
allow_address_until, emitting one address_allowed event per address
processed, and capping the batch at 50 addresses
(ContractError::BatchTooLarge above the cap).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Individual address_allowed/address_blocked events gave the indexer no
way to know when a batch operation had finished without counting
events. Emit a single compliance_batch_processed event (admin,
processed_count) after batch_allow_addresses completes, and document
all compliance event shapes in docs/error-codes.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@jhaydeeee-web 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