From 2c01477ea75743c04500e46ce718d3320360c270 Mon Sep 17 00:00:00 2001 From: "Robert G. Jakabosky" Date: Thu, 14 Nov 2024 20:54:23 +0800 Subject: [PATCH] Add missing portfolio events for allow/revoke create portfolio permissions. --- pallets/common/src/traits/portfolio.rs | 20 +++++++++++++++++++- pallets/portfolio/src/lib.rs | 8 ++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pallets/common/src/traits/portfolio.rs b/pallets/common/src/traits/portfolio.rs index bbad3a0f2..5bc5b88f4 100644 --- a/pallets/common/src/traits/portfolio.rs +++ b/pallets/common/src/traits/portfolio.rs @@ -201,7 +201,25 @@ decl_event! { IdentityId, 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, + ), } } diff --git a/pallets/portfolio/src/lib.rs b/pallets/portfolio/src/lib.rs index 6c6600ff5..910c32f8e 100644 --- a/pallets/portfolio/src/lib.rs +++ b/pallets/portfolio/src/lib.rs @@ -864,6 +864,10 @@ impl Module { Error::::SelfAdditionNotAllowed ); AllowedCustodians::insert(callers_did, trusted_identity, true); + Self::deposit_event(Event::AllowIdentityToCreatePortfolios( + callers_did, + trusted_identity, + )); Ok(()) } @@ -873,6 +877,10 @@ impl Module { ) -> DispatchResult { let callers_did = Identity::::ensure_perms(origin)?; AllowedCustodians::remove(callers_did, identity); + Self::deposit_event(Event::RevokeCreatePortfoliosPermission( + callers_did, + identity, + )); Ok(()) }