From b60802e1d211a639443287354474d8952e013eb3 Mon Sep 17 00:00:00 2001 From: Tarek Mohamed Abdalla Date: Mon, 22 May 2023 19:38:21 +0300 Subject: [PATCH] add batch and batch_all to social actions type --- runtime/src/lib.rs | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index c8dcb0c3..825a62c9 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -539,15 +539,28 @@ impl InstanceFilter for ProxyType { } false }, - ProxyType::SocialActions => matches!( - c, - RuntimeCall::Posts(..) - | RuntimeCall::Reactions(..) - | RuntimeCall::AccountFollows(..) - | RuntimeCall::SpaceFollows(..) - | RuntimeCall::Spaces(..) - | RuntimeCall::Profiles(..) - ), + ProxyType::SocialActions => { + match c { + RuntimeCall::Utility(pallet_utility::Call::batch { calls }) | + RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => { + for call in calls { + if !ProxyType::SocialActions.filter(call) { + return false; + } + } + return true; + }, + _ => matches!( + c, + RuntimeCall::Posts(..) + | RuntimeCall::Reactions(..) + | RuntimeCall::AccountFollows(..) + | RuntimeCall::SpaceFollows(..) + | RuntimeCall::Spaces(..) + | RuntimeCall::Profiles(..) + ) + } + } // TODO: Think on this proxy type. We probably need this to extend `SocialActions` or either replace it. ProxyType::Management => matches!( c,