Feature/compliance batch and hardening - #529
Open
jhaydeeee-web wants to merge 4 commits into
Open
Conversation
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>
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #394
Closes #395
Closes #396
Closes #397
SUMMARY
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.
expiry, and clearing a never-allowed address — each asserting is_allowed is false immediately after. No production code change.
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.
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.