Commit d8b2393
authored
feat(permission0): create new curator scope (#97)
Creates a new curator scope for the permission0 system. This change
supersedes the `Curators` storage value in the governance pallet.
A new extrinsic was added to `permission0`:
```rust
pub fn grant_curator_permission(
origin: OriginFor<T>,
grantee: T::AccountId,
flags: u32,
cooldown: Option<BlockNumberFor<T>>,
duration: PermissionDuration<T>,
revocation: RevocationTerms<T>,
) ;
```
For now, only the sudo (root) key is allowed to grant new permissions,
which we will do through a multisig dispatch. Future versions will allow
curators to re-delegate permissions. The new extrinsic allows setting
different sub-permissions for curator actions:
```rust
/// Permission to review and process agent applications
const APPLICATION_REVIEW = 0b0000_0010;
/// Permission to manage the whitelist (add/remove accounts)
const WHITELIST_MANAGE = 0b0000_0100;
/// Permission to apply penalty factors to agents
const PENALTY_CONTROL = 0b0000_1000;
```
The value for `0b1` is reserved for future use and internally assigned
as `ROOT`.
The `flags` field is a bitmask, so OR the different flags together to
get your very own personalized permission.
Finally, I removed the old extrinsics for curators in the governance
pallet.1 parent 000fe75 commit d8b2393
File tree
50 files changed
+3267
-1209
lines changed- docs
- pallets
- emission0/src
- faucet/tests
- governance
- api/src
- src
- tests
- permission0
- api
- src
- src
- ext
- permission
- tests
- torus0
- api/src
- src
- runtime/src
- test-utils
- src
- xtask/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+3267
-1209
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments