Skip to content

feat(admin): emit admin_chg event on completed handover - #318

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
thlpkee20-wq:feature/admin-02-event
Jul 28, 2026
Merged

feat(admin): emit admin_chg event on completed handover#318
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
thlpkee20-wq:feature/admin-02-event

Conversation

@thlpkee20-wq

Copy link
Copy Markdown
Contributor

Closes #307

`accept_admin_transfer` now emits `admin_chg(old_admin, new_admin)`
once the rotation is persisted, so indexers can track admin changes
without polling `get_admin`. `propose_admin_transfer` intentionally
does not emit this event: a proposal is not yet a state change (it can
still be re-proposed or cancelled before any handover completes) —
only the completed transfer is the actual "admin state change."

No topic collision: `admin_chg` (9 chars, within the `symbol_short!`
limit) does not match any existing topic in the contract.

Adds tests: the event fires with the correct `(old_admin, new_admin)`
payload on a completed accept, and a mere proposal does not emit
`admin_chg`.

Test plan

accept_admin_transfer now emits admin_chg(old_admin, new_admin) once
the rotation is persisted, so indexers can track admin changes without
polling get_admin. propose_admin_transfer intentionally does not emit
this event: a proposal is not yet a state change (it can be
re-proposed or cancelled before any handover completes).

Adds tests: the event fires with the correct payload on a completed
accept, and a mere proposal does not emit admin_chg.
@mikewheeleer

Copy link
Copy Markdown
Contributor

looks good @thlpkee20-wq — well scoped and easy to review. merging 👍

@mikewheeleer
mikewheeleer merged commit 0cb4700 into Agentpay-Org:main Jul 28, 2026
1 check failed
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 dedicated event when admin state changes

2 participants