Skip to content

Commit

Permalink
proxy_type: Add proxy types for pod operations and pod auth (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdamian authored Aug 29, 2022
1 parent 4a2e6b2 commit bfbe212
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,8 @@ pub enum ProxyType {
Invest,
ProxyManagement,
KeystoreManagement,
NFTMint,
NFTTransfer,
NFTManagement,
AnchorManagement,
PodOperation,
PodAuth,
}
impl Default for ProxyType {
fn default() -> Self {
Expand Down Expand Up @@ -419,17 +417,10 @@ impl InstanceFilter<Call> for ProxyType {
Call::Keystore(pallet_keystore::Call::add_keys { .. })
| Call::Keystore(pallet_keystore::Call::revoke_keys { .. })
),
ProxyType::NFTMint => matches!(
c,
Call::Uniques(pallet_uniques::Call::mint { .. })
| Call::Uniques(pallet_uniques::Call::set_metadata { .. })
| Call::Uniques(pallet_uniques::Call::set_attribute { .. })
),
ProxyType::NFTTransfer => {
matches!(c, Call::Uniques(pallet_uniques::Call::transfer { .. }))
}
ProxyType::NFTManagement => matches!(c, Call::Uniques(..)),
ProxyType::AnchorManagement => matches!(c, Call::Anchor(..)),
ProxyType::PodOperation => matches!(c, Call::Uniques(..) | Call::Anchor(..)),
// This type of proxy is used only for authenticating with the centrifuge POD,
// having it here also allows us to validate authentication with on-chain data.
ProxyType::PodAuth => false,
}
}

Expand Down

0 comments on commit bfbe212

Please sign in to comment.