feat: add origin AccountId to StakeAdded/StakeRemoved events#2459
Open
altis0725 wants to merge 3 commits intoopentensor:mainfrom
Open
feat: add origin AccountId to StakeAdded/StakeRemoved events#2459altis0725 wants to merge 3 commits intoopentensor:mainfrom
altis0725 wants to merge 3 commits intoopentensor:mainfrom
Conversation
Fixes opentensor#311 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump spec_version 380 -> 381 for event metadata breaking change - Clarify origin field documentation (coldkey from ensure_signed) - Add test_add_stake_event_has_origin to verify origin field in events Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update event comments to accurately describe origin semantics for both extrinsic calls and automated distributions (leasing) - Add test_remove_stake_event_has_origin for StakeRemoved origin assertion - Add StakeRemoved/StakeAdded origin assertions to move_stake event test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
737952e to
8f099f5
Compare
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.
Fixes #311
Summary
origin(T::AccountId) as the first field ofStakeAddedandStakeRemovedevents to identify which account initiated the staking operationstake_utils.rs(stake_into_subnet,unstake_from_subnet,transfer_stake_within_subnet) to propagate the origin parameterspec_version380 → 381 for the event metadata changeTest plan
test_add_stake_event_has_originassertingStakeAddedorigin == coldkeytest_remove_stake_event_has_originassertingStakeRemovedorigin == coldkeytest_do_move_event_emissionto verify origin in bothStakeRemovedandStakeAddedduring move operations🤖 Generated with Claude Code