Skip to content

Commit

Permalink
Add missing portfolio events for allow/revoke create portfolio permis…
Browse files Browse the repository at this point in the history
…sions.
  • Loading branch information
Neopallium committed Nov 14, 2024
1 parent 83535d2 commit d4bb224
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pallets/common/src/traits/portfolio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,24 @@ decl_event! {
PortfolioId,
AssetId
)
/// Allow another identity to create portfolios.
///
/// # Parameters
/// * [`IdentityId`] of the caller.
/// * [`IdentityId`] allowed to create portfolios.
AllowIdentityToCreatePortfolios(
IdentityId,
IdentityId,
)
/// Revoke another identities permission to create portfolios.
///
/// # Parameters
/// * [`IdentityId`] of the caller.
/// * [`IdentityId`] permissions to create portfolios is revoked.
RevokeCreatePortfoliosPermission(
IdentityId,
IdentityId,
)
}
}

Expand Down
7 changes: 7 additions & 0 deletions pallets/portfolio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,10 @@ impl<T: Config> Module<T> {
Error::<T>::SelfAdditionNotAllowed
);
AllowedCustodians::insert(callers_did, trusted_identity, true);
Self::deposit_event(Event::AllowIdentityToCreatePortfolios(
caller_did,
trusted_identity,
));
Ok(())
}

Expand All @@ -873,6 +877,9 @@ impl<T: Config> Module<T> {
) -> DispatchResult {
let callers_did = Identity::<T>::ensure_perms(origin)?;
AllowedCustodians::remove(callers_did, identity);
Self::deposit_event(Event::RevokeCreatePortfoliosPermission(
caller_did, identity,
));
Ok(())
}

Expand Down

0 comments on commit d4bb224

Please sign in to comment.