Skip to content

feat(#396): emit PlatformFeeAllocationOverrideEvent from pf_alloc_admin_override - #434

Open
CollinsC1O wants to merge 1 commit into
Goldii-locks:mainfrom
CollinsC1O:event-recording
Open

feat(#396): emit PlatformFeeAllocationOverrideEvent from pf_alloc_admin_override#434
CollinsC1O wants to merge 1 commit into
Goldii-locks:mainfrom
CollinsC1O:event-recording

Conversation

@CollinsC1O

@CollinsC1O CollinsC1O commented Aug 30, 2026

Copy link
Copy Markdown

feat(#396): structured event for pf_alloc_admin_override outcome

What

pf_alloc_admin_override now publishes PlatformFeeAllocationOverrideEvent
(topic pfovrride) as its last step.

field reconciles with
admin the auth-checked caller (acting address)
contract_id env.current_contract_address()
client_bps / freelancer_bps / treasury_bps DataKey::PlatformFeeAllocation after the call (sum to BPS_SCALE)
locked false — the override unlocks the allocation in the same step

Emitted inside if result.is_ok(); all error paths (require_admin,
InvalidStatus on an unlocked allocation, the in-progress guards,
InvalidRatio) return before the publish → no event on failure.

Tests — test.rs

  • ..._event_reconciles_with_persisted_state — every field vs get_platform_fee_allocation()
  • ..._no_event_on_unauthorized, ..._no_event_on_invalid_state,
    ..._no_event_on_invalid_ratiopfovrride event count is 0, state untouched

Verification

  • cargo test → 453 passed, 0 failed (all existing tests unchanged)
  • cargo build --release --target wasm32-unknown-unknown → ok
  • cargo fmt --check clean; no new clippy warnings

Notes

  • Removes a dangling mod admin_override_cancel_tests; declaration so the test
    crate compiles.
  • Adds regenerated Soroban test snapshots (test_snapshots/ is tracked).

Closes #396

feat(Goldii-locks#396): emit PlatformFeeAllocationOverrideEvent from pf_alloc_admin_override

Publish a typed event at the end of pf_alloc_admin_override carrying the acting
admin and the resulting allocation (client/freelancer/treasury bps + unlocked
flag) so indexers get an immutable record of the override. Fields reconcile
with DataKey::PlatformFeeAllocation; emitted only on the success path.

Tests (test.rs):
- event_reconciles_with_persisted_state: fields vs get_platform_fee_allocation()
- no_event_on_unauthorized / no_event_on_invalid_state / no_event_on_invalid_ratio

Also drops the dangling  so cargo test compiles.
Includes regenerated test snapshots.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

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

Development

Successfully merging this pull request may close these issues.

Emit a structured event recording the outcome of pf_alloc_admin_override

1 participant