feat: add per-account flags to block receiving TAO, Alpha, and locked Alpha#2746
Open
ppolewicz wants to merge 412 commits into
Open
feat: add per-account flags to block receiving TAO, Alpha, and locked Alpha#2746ppolewicz wants to merge 412 commits into
ppolewicz wants to merge 412 commits into
Conversation
# Conflicts: # precompiles/src/staking.rs
Added dev test for the setCode tx
Governance update 1
…e-advanced-orders
Referenda benchmarks
[Re-merge] Fix for arithmetic side effect
Re-enable balancer
fix failed eco test
Stage 1 of governance (only pallet-multi-collective unwired for now)
…code Remove CreateSignedTransaction deadcode
Optimize locks to avoid full iteration of lock map
Fix issues in conviction
… Alpha Implements issue #2730. Adds three new storage maps (BlockReceivingTao, BlockReceivingAlpha, BlockReceivingLockedAlpha), three new extrinsics (call_index 139/140/141), and enforces the flags in transfer_tao, stake_into_subnet, and transfer_lock. Includes 9 unit tests.
Contributor
🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨It looks like you are trying to merge a hotfix PR into If you are trying to merge a hotfix PR, please complete the following essential steps:
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to |
Required by the check_spec_version CI check after adding new extrinsics (set_block_receiving_tao/alpha/locked_alpha) that change the runtime.
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.
Summary
Implements issue #2730: adds the ability for a destination address to block incoming transfers of TAO, staked Alpha, and locked Alpha.
What was added
3 new storage maps in
pallet-subtensor:BlockReceivingTao<T>— per-account flag to block incoming TAO transfersBlockReceivingAlpha<T>— per-account flag to block incoming staked-Alpha transfersBlockReceivingLockedAlpha<T>— per-account flag to block incoming locked-Alpha transfers3 new extrinsics (call indices 139 / 140 / 141):
set_block_receiving_tao(enabled: bool)set_block_receiving_alpha(enabled: bool)set_block_receiving_locked_alpha(enabled: bool)3 new error variants:
ReceivingTaoBlockedReceivingAlphaBlockedReceivingLockedAlphaBlocked3 new events:
BlockReceivingTaoSet { account, enabled }BlockReceivingAlphaSet { account, enabled }BlockReceivingLockedAlphaSet { account, enabled }Enforcement in existing transfer paths:
transfer_taochecksBlockReceivingTaostake_into_subnetchecksBlockReceivingAlphatransfer_lockchecksBlockReceivingLockedAlpha9 new unit tests in
pallets/subtensor/src/tests/block_receiving.rscovering set/clear, blocking, and allow-after-clear for each flag.Test plan
cargo fmt— no formatting issuescargo clippy -p pallet-subtensor— no errorscargo test -p pallet-subtensor --lib -- tests::block_receiving— 9/9 tests pass