Skip to content

Commit

Permalink
Update proxies for new pallets (#2048)
Browse files Browse the repository at this point in the history
* Update proxies for new pallets

* Adds missing preimage
  • Loading branch information
Alan Sapede committed Jan 18, 2023
1 parent f680485 commit cc2e62f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
22 changes: 16 additions & 6 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ impl pallet_evm_precompile_proxy::EvmProxyCallFilter for ProxyType {
}
}
ProxyType::NonTransfer => {
call.value == U256::default()
call.value == U256::zero()
&& match PrecompileName::from_address(call.to.0) {
Some(
PrecompileName::AuthorMappingPrecompile
Expand All @@ -862,14 +862,14 @@ impl pallet_evm_precompile_proxy::EvmProxyCallFilter for ProxyType {
}
}
ProxyType::Governance => {
call.value == U256::default()
call.value == U256::zero()
&& matches!(
PrecompileName::from_address(call.to.0),
Some(ref precompile) if is_governance_precompile(precompile)
)
}
ProxyType::Staking => {
call.value == U256::default()
call.value == U256::zero()
&& matches!(
PrecompileName::from_address(call.to.0),
Some(
Expand All @@ -887,7 +887,7 @@ impl pallet_evm_precompile_proxy::EvmProxyCallFilter for ProxyType {
!recipient_has_code && !PrecompilesValue::get().is_precompile(call.to.0)
}
ProxyType::AuthorMapping => {
call.value == U256::default()
call.value == U256::zero()
&& matches!(
PrecompileName::from_address(call.to.0),
Some(PrecompileName::AuthorMappingPrecompile)
Expand All @@ -910,10 +910,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::System(..)
| RuntimeCall::Timestamp(..)
| RuntimeCall::ParachainStaking(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::Democracy(..)
| RuntimeCall::Identity(..)
| RuntimeCall::Referenda(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::ConvictionVoting(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::OpenTechCommitteeCollective(..)
| RuntimeCall::Identity(..)
| RuntimeCall::Utility(..)
| RuntimeCall::Proxy(..) | RuntimeCall::AuthorMapping(..)
| RuntimeCall::CrowdloanRewards(
Expand All @@ -924,8 +929,13 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
ProxyType::Governance => matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Referenda(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::ConvictionVoting(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::OpenTechCommitteeCollective(..)
| RuntimeCall::Utility(..)
),
ProxyType::Staking => matches!(
Expand Down
6 changes: 5 additions & 1 deletion runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,11 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::Timestamp(..)
| RuntimeCall::ParachainStaking(..)
| RuntimeCall::Democracy(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::Identity(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::Identity(..)
| RuntimeCall::Utility(..)
| RuntimeCall::Proxy(..) | RuntimeCall::AuthorMapping(..)
| RuntimeCall::CrowdloanRewards(
Expand All @@ -864,7 +866,9 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
ProxyType::Governance => matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::Utility(..)
),
Expand Down
12 changes: 11 additions & 1 deletion runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,14 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::Timestamp(..)
| RuntimeCall::ParachainStaking(..)
| RuntimeCall::Democracy(..)
| RuntimeCall::Referenda(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::ConvictionVoting(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::Identity(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::OpenTechCommitteeCollective(..)
| RuntimeCall::Identity(..)
| RuntimeCall::Utility(..)
| RuntimeCall::Proxy(..) | RuntimeCall::AuthorMapping(..)
| RuntimeCall::CrowdloanRewards(
Expand All @@ -773,8 +778,13 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
ProxyType::Governance => matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Referenda(..)
| RuntimeCall::Preimage(..)
| RuntimeCall::ConvictionVoting(..)
| RuntimeCall::CouncilCollective(..)
| RuntimeCall::TreasuryCouncilCollective(..)
| RuntimeCall::TechCommitteeCollective(..)
| RuntimeCall::OpenTechCommitteeCollective(..)
| RuntimeCall::Utility(..)
),
ProxyType::Staking => matches!(
Expand Down

0 comments on commit cc2e62f

Please sign in to comment.