feat: settlement claim window#679
Open
EneGab wants to merge 2 commits into
Open
Conversation
Adds a configurable, admin-managed claim window that restricts when a developer can call withdraw_developer_balance to an inclusive [start_ts, end_ts] ledger-timestamp range. Developers with no configured window remain claimable at any time. - set_developer_claim_window / clear_developer_claim_window / get_developer_claim_window, enforced inside withdraw_developer_balance via ClaimWindowClosed (24) / InvalidClaimWindow (25) - Wires up admin.rs, errors.rs, events.rs, limits.rs, migrate.rs, pagination.rs, timelock.rs, and types.rs, which existed on disk but were never declared as modules in lib.rs from a prior bad merge, so the crate did not compile - Restores/implements entrypoints the existing test suite already assumed: two-step admin/vault rotation, upgrade, force_credit_developer, daily withdrawal cap, paginated balance views, and migration wrappers - Fixes a duplicate-field bug in pagination.rs, a missing require_auth in migrate_single_developer, and two incomplete event structs (DepositEvent, DeveloperForceCreditedEvent) - Adds claim window unit tests; updates ERROR_CODES.md, EVENTS_INDEX.md, and docs/interfaces/settlement.json for the new codes/event Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@EneGab 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! 🚀 |
Root causes of the PR CalloraOrg#679 CI failures: - Cargo.lock was gitignored, so every CI run re-resolved dependencies fresh and landed on an ed25519-dalek/rand_core combo that breaks soroban-env-host's own test-prng code. Lockfile is now committed. - batch_withdraw_developer_balance_cursor exceeded Soroban's 32-byte contract function name limit; renamed (unreferenced elsewhere). - Settlement lib.rs/test.rs were missing testutils trait imports (Instance/Persistent for get_ttl, IntoVal for event decoding). - Several test-only bugs never previously caught because the crate didn't compile: duplicate shadowed `token` bindings, an events-read ordered after an event-less getter call, and require_auth called twice inside one as_contract frame in archive.rs's own tests. - test_upgrade_and_get_version needed a real uploaded WASM hash; matched the existing upload_contract_wasm(Bytes::new()) pattern already used in vault/revenue_pool's own upgrade tests. - cargo fmt --check and clippy -D warnings (both required by ci.yml's Test job) had never been run clean on settlement; fixed its lint violations and reformatted vault/revenue_pool (whitespace only) so the repo-wide fmt gate passes. - EVENT_SCHEMA.md was missing docs for revenue_pool's pre-existing emergency_drain_{proposed,executed,cancelled} events, which the event-shape script checks repo-wide. Not addressed here (pre-existing, unrelated to this PR, flagged separately): ~63 clippy violations in vault/revenue_pool, and 17 wasm32-unknown-unknown compile errors in the vault crate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Adds a configurable, admin-managed claim window that restricts when a developer can call withdraw_developer_balance to an inclusive [start_ts, end_ts] ledger-timestamp range. Developers with no configured window remain claimable at any time.
Closes #631