Skip to content

Commit

Permalink
enable features
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Jan 17, 2022
1 parent ee72c98 commit f357bba
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
51 changes: 29 additions & 22 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("acala"),
impl_name: create_runtime_str!("acala"),
authoring_version: 1,
spec_version: 2020,
spec_version: 2021,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -205,31 +205,38 @@ impl Contains<Call> for BaseCallFilter {
return false;
}

let is_whitelisted = matches!(
let is_evm = matches!(
call,
Call::Sudo(_) | // sudo
Call::Scheduler(_) | Call::Utility(_) | Call::Multisig(_) | Call::Proxy(_) | // utility
Call::TransactionPause(_) | // transaction pause
Call::Treasury(_) | Call::Bounties(_) | Call::Tips(_) | // treasury
Call::CollatorSelection(_) | Call::Session(_) | Call::SessionManager(_) | // collator
Call::DmpQueue(_) | Call::OrmlXcm(_) | // xcm
// Call::PolkadotXcm(_) | Call::XTokens(_) | // not allow user to make xcm call
Call::Authority(_) |
Call::GeneralCouncil(_) | Call::GeneralCouncilMembership(_) |
Call::FinancialCouncil(_) | Call::FinancialCouncilMembership(_) |
Call::HomaCouncil(_) | Call::HomaCouncilMembership(_) |
Call::TechnicalCommittee(_) | Call::TechnicalCommitteeMembership(_) | // governance
Call::Democracy(_) | // democracy
Call::AcalaOracle(_) | Call::OperatorMembershipAcala(_) | // oracle
Call::Vesting(_) // vesting
Call::EVM(_) | Call::EvmAccounts(_) // EvmBridge / EvmManager does not have call
);
if is_whitelisted {
// allow whitelisted calls
return true;
if is_evm {
// no evm call
return false;
}

if let Call::PolkadotXcm(xcm_method) = call {
match xcm_method {
pallet_xcm::Call::send { .. }
| pallet_xcm::Call::execute { .. }
| pallet_xcm::Call::teleport_assets { .. }
| pallet_xcm::Call::reserve_transfer_assets { .. }
| pallet_xcm::Call::limited_reserve_transfer_assets { .. }
| pallet_xcm::Call::limited_teleport_assets { .. } => {
return false;
}
pallet_xcm::Call::force_xcm_version { .. }
| pallet_xcm::Call::force_default_xcm_version { .. }
| pallet_xcm::Call::force_subscribe_version_notify { .. }
| pallet_xcm::Call::force_unsubscribe_version_notify { .. } => {
return true;
}
pallet_xcm::Call::__Ignore { .. } => {
unimplemented!()
}
}
}

// disable everything else
false
true
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("karura"),
impl_name: create_runtime_str!("karura"),
authoring_version: 1,
spec_version: 2020,
spec_version: 2021,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion runtime/mandala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("mandala"),
impl_name: create_runtime_str!("mandala"),
authoring_version: 1,
spec_version: 2020,
spec_version: 2021,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit f357bba

Please sign in to comment.