Skip to content

Commit

Permalink
Merge branch 'main' into f3/transfer-domains
Browse files Browse the repository at this point in the history
  • Loading branch information
F3Joule committed Mar 20, 2024
2 parents 901a75c + da9c0b8 commit 1acdc6a
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ pub struct WeightToFee;
impl WeightToFeePolynomial for WeightToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// Extrinsic base weight (smallest non-zero weight) is mapped to 10 MILLIUNIT
let p = 10 * MILLIUNIT;
// Extrinsic base weight (smallest non-zero weight) is mapped to 100 MILLIUNIT
let p = 100 * MILLIUNIT;
let q = Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
Expand Down Expand Up @@ -573,9 +573,15 @@ parameter_types! {
)]
pub enum ProxyType {
Any,
#[deprecated(note = "Will be removed in the next release")]
// TODO: remove as it's not used
DomainRegistrar,
SocialActions,
#[deprecated(note = "Will be removed in the next release")]
// TODO: remove or either replace as it's not used
Management,
#[deprecated(note = "Will be removed in the next release")]
// TODO: remove or either replace (if we have use-cases for it) as it's not used
SocialActionsProxy,
}

Expand All @@ -587,34 +593,23 @@ impl Default for ProxyType {

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
let is_social_action = matches!(
c,
RuntimeCall::AccountFollows(..)
| RuntimeCall::Domains(..)
| RuntimeCall::PostFollows(..)
| RuntimeCall::Posts(..)
| RuntimeCall::Profiles(..)
| RuntimeCall::Reactions(..)
| RuntimeCall::Roles(..)
| RuntimeCall::SpaceFollows(..)
| RuntimeCall::Spaces(..)
);

match self {
ProxyType::Any => true,
ProxyType::DomainRegistrar => false,
ProxyType::SocialActions => 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,
RuntimeCall::Spaces(..)
| RuntimeCall::Ownership(..)
| RuntimeCall::Roles(..)
| RuntimeCall::Profiles(..)
| RuntimeCall::Domains(..)
),
ProxyType::SocialActionsProxy => {
matches!(
c,
RuntimeCall::Proxy(pallet_proxy::Call::proxy { call, .. })
if ProxyType::SocialActions.filter(call),
)
},
ProxyType::SocialActions => is_social_action,
_ => false,
}
}

Expand Down

0 comments on commit 1acdc6a

Please sign in to comment.