Skip to content

Remove `issuer` arg from `add_cert`

Currently, add_cert has the following signature:

pub fn add_cert(
    origin: OriginFor<T>,
    issuer: T::IdtyIndex,
    receiver: T::IdtyIndex,
) -> DispatchResultWithPostInfo {

But the issuer is redundant with origin. Actually the first thing we do is check they match:

// Verify caller ownership
let issuer_owner_key =
    T::OwnerKeyOf::convert(issuer).ok_or(Error::<T>::IssuerNotFound)?;
ensure!(issuer_owner_key == who, DispatchError::BadOrigin);

I do not see the interest of keeping this and suggest the following:

pub fn add_cert(
    origin: OriginFor<T>,
    target: T::IdtyIndex,
) -> DispatchResultWithPostInfo {

Are there arguments for/against?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information