pub fn add_delegation<T: Config>(
    delegation_id: DelegationNodeIdOf<T>,
    parent_id: DelegationNodeIdOf<T>,
    delegate: DelegatorIdOf<T>,
    permissions: Permissions,
    delegate_signature: DelegateSignatureTypeOf<T>
)
Expand description

Create a new delegation node.

The new delegation node represents a new trust hierarchy that considers the new node as its root. The owner of this node has full control over any of its direct and indirect descendants.

For the creation to succeed, the delegatee must provide a valid signature over the (blake256) hash of the creation operation details which include (in order) delegation id, root node id, parent id, and permissions of the new node.

There must be no delegation with the same id stored on chain. Furthermore, the referenced root and parent nodes must already be present on chain and contain the valid permissions and revocation status (i.e., not revoked).

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.

Requires the sender of the transaction to have a reservable balance of at least Deposit many tokens.

Emits DelegationCreated.

Weight: O(1)

  • Reads: [Origin Account], Roots, Delegations
  • Writes: Delegations

Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::add_delegation.