From d4bb2249d26135af94c29d26af64f082200d11b7 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 | 18 ++++++++++++++++++ pallets/portfolio/src/lib.rs | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/pallets/common/src/traits/portfolio.rs b/pallets/common/src/traits/portfolio.rs index bbad3a0f2..783ff8b55 100644 --- a/pallets/common/src/traits/portfolio.rs +++ b/pallets/common/src/traits/portfolio.rs @@ -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, + ) } } diff --git a/pallets/portfolio/src/lib.rs b/pallets/portfolio/src/lib.rs index 6c6600ff5..1d0dddf60 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( + caller_did, + trusted_identity, + )); Ok(()) } @@ -873,6 +877,9 @@ impl Module { ) -> DispatchResult { let callers_did = Identity::::ensure_perms(origin)?; AllowedCustodians::remove(callers_did, identity); + Self::deposit_event(Event::RevokeCreatePortfoliosPermission( + caller_did, identity, + )); Ok(()) }