Skip to content

Commit

Permalink
MESH-1924: Register cdd with add claim (#1380)
Browse files Browse the repository at this point in the history
* batch extrinsics

* Update comments
  • Loading branch information
adamdossa authored Jan 17, 2023
1 parent 09de6f4 commit 6c255ee
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions pallets/identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@ decl_module! {
/// - `target_account` (primary key of the new Identity) can be linked to just one and only
/// one identity.
/// - External secondary keys can be linked to just one identity.
///
/// # Weight
/// `7_000_000_000 + 600_000 * secondary_keys.len()`
#[weight = <T as Config>::WeightInfo::cdd_register_did(secondary_keys.len() as u32)]
pub fn cdd_register_did(
origin,
Expand Down Expand Up @@ -583,6 +580,27 @@ decl_module! {
pub fn register_custom_claim_type(origin, ty: Vec<u8>) {
Self::base_register_custom_claim_type(origin, ty)?;
}

/// Register `target_account` with a new Identity and issue a CDD claim with a blank CddId
///
/// # Failure
/// - `origin` has to be a active CDD provider. Inactive CDD providers cannot add new
/// claims.
/// - `target_account` (primary key of the new Identity) can be linked to just one and only
/// one identity.
/// - External secondary keys can be linked to just one identity.
#[weight = <T as Config>::WeightInfo::cdd_register_did(secondary_keys.len() as u32).saturating_add(<T as Config>::WeightInfo::add_claim())]
pub fn cdd_register_did_with_cdd(
origin,
target_account: T::AccountId,
secondary_keys: Vec<SecondaryKey<T::AccountId>>,
expiry: Option<T::Moment>
) {
let (cdd_did, target_did) = Self::base_cdd_register_did(origin, target_account, secondary_keys)?;
let cdd_claim = Claim::CustomerDueDiligence(CddId::default());
Self::base_add_claim(target_did, cdd_claim, cdd_did, expiry)?;
}

}
}

Expand Down

0 comments on commit 6c255ee

Please sign in to comment.