Function pallet_msa::pallet::dispatchables::grant_delegation
source · pub fn grant_delegation<T: Config>(
delegator_key: T::AccountId,
proof: MultiSignature,
add_provider_payload: AddProvider
)
Expand description
Creates a new Delegation for an existing MSA, with origin
as the Provider and delegator_key
is the delegator.
Since it is being sent on the Delegator’s behalf, it requires the Delegator to authorize the new Delegation.
Remarks
- Origin MUST be the provider
- Signatures should be over the
AddProvider
struct
Events
Errors
Error::AddProviderSignatureVerificationFailed
-origin
’s MSA ID does not equaladd_provider_payload.authorized_msa_id
.Error::DuplicateProvider
- there is already a Delegation fororigin
MSA anddelegator_key
MSA.Error::UnauthorizedProvider
-add_provider_payload.authorized_msa_id
does not match MSA ID ofdelegator_key
.Error::InvalidSelfProvider
- Cannot delegate to the same MSAError::InvalidSignature
-proof
verification fails;delegator_key
must have signedadd_provider_payload
Error::NoKeyExists
- there is no MSA fororigin
ordelegator_key
.Error::ProviderNotRegistered
- the a non-provider MSA is used as the providerError::UnauthorizedDelegator
- Origin attempted to add a delegate for someone else’s MSA
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::grant_delegation
.