Skip to content

test(staking): cover non-admin rejection of set_slashing_coordinator - #1070

Open
gbengaeben wants to merge 1 commit into
MettaChain:mainfrom
gbengaeben:fix/1029-staking-slashing-coordinator-auth
Open

test(staking): cover non-admin rejection of set_slashing_coordinator#1070
gbengaeben wants to merge 1 commit into
MettaChain:mainfrom
gbengaeben:fix/1029-staking-slashing-coordinator-auth

Conversation

@gbengaeben

Copy link
Copy Markdown

Summary

The staking slashing-coordinator path had slashing-flow tests, but the admin-gated set_slashing_coordinator auth itself was never asserted (see #1029).

Changes

  • Add set_slashing_coordinator_non_admin_fails: asserts a non-admin caller is rejected with Unauthorized.
  • Confirms that after the admin sets the coordinator, the coordinator can slash a validator and the slash correctly reduces self-stake.

Verification

cargo test -p staking passes (108 tests).

Closes #1029

set_slashing_coordinator was only exercised as the admin in test setup; its
admin-gated auth was never asserted. Add a test confirming a non-admin caller
is rejected with Unauthorized, and that after the admin sets the coordinator,
the coordinator can slash a validator and the slash reduces self-stake.

Closes MettaChain#1029
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@gbengaeben 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.

Staking slashing-coordinator path is untested: set_slashing_coordinator and slashing flows are uncovered

1 participant