Function delegation::pallet::dispatchables::remove_delegation
source · pub fn remove_delegation<T: Config>(
delegation_id: DelegationNodeIdOf<T>,
max_removals: u32
)
Expand description
Remove a delegation node (potentially a root node) and all its children.
Returns the delegation deposit to the deposit owner for each removed DelegationNode by unreserving it.
Removing a delegation node results in the trust hierarchy starting from the given node being removed. Nevertheless, removal starts from the leave nodes upwards, so if the operation ends prematurely because it runs out of gas, the delegation state would be consistent as no child would “survive” its parent. As a consequence, if the given node is removed, the trust hierarchy with the node as root is to be considered removed.
The dispatch origin must be split into
- a submitter of type
AccountId
who is responsible for paying the transaction fee and - a DID subject of type
DelegationEntityId
who creates, owns and can revoke the delegation.
Emits C * DelegationRemoved
.
Weight: O(C) where C is the number of children of the delegation
node which is bounded by max_children
.
- Reads: [Origin Account], Roots, C * Delegations, C * Children.
- Writes: Roots, 2 * C * Delegations
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::remove_delegation
.