feat(#396): emit PlatformFeeAllocationOverrideEvent from pf_alloc_admin_override - #434
Open
CollinsC1O wants to merge 1 commit into
Open
feat(#396): emit PlatformFeeAllocationOverrideEvent from pf_alloc_admin_override#434CollinsC1O wants to merge 1 commit into
CollinsC1O wants to merge 1 commit into
Conversation
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.
|
@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! 🚀 |
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.
feat(#396): structured event for pf_alloc_admin_override outcome
What
pf_alloc_admin_overridenow publishesPlatformFeeAllocationOverrideEvent(topic
pfovrride) as its last step.admincontract_idenv.current_contract_address()client_bps/freelancer_bps/treasury_bpsDataKey::PlatformFeeAllocationafter the call (sum toBPS_SCALE)lockedfalse— the override unlocks the allocation in the same stepEmitted inside
if result.is_ok(); all error paths (require_admin,InvalidStatuson 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 vsget_platform_fee_allocation()..._no_event_on_unauthorized,..._no_event_on_invalid_state,..._no_event_on_invalid_ratio—pfovrrideevent count is0, state untouchedVerification
cargo test→ 453 passed, 0 failed (all existing tests unchanged)cargo build --release --target wasm32-unknown-unknown→ okcargo fmt --checkclean; no new clippy warningsNotes
mod admin_override_cancel_tests;declaration so the testcrate compiles.
test_snapshots/is tracked).Closes #396