Skip to content

Commit

Permalink
add new proxy types
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild committed Aug 8, 2024
1 parent 8389088 commit 303db90
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,17 @@ pub enum ProxyType {
Owner, // Subnet owner Calls
NonCritical,
NonTransfer,
Transfer,
SmallTransfer,
Senate,
NonFungibile, // Nothing involving moving TAO
Triumvirate,
Governance, // Both above governance
Staking,
Registration,
}
// Transfers below SMALL_TRANSFER_LIMIT are considered small transfers
pub const SMALL_TRANSFER_LIMIT: Balance = 500_000_000; // 0.5 TAO
impl Default for ProxyType {
fn default() -> Self {
Self::Any
Expand All @@ -645,6 +649,22 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::SubtensorModule(pallet_subtensor::Call::burned_register { .. })
| RuntimeCall::SubtensorModule(pallet_subtensor::Call::root_register { .. })
),
ProxyType::Transfer => matches!(
c,
RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { .. })
| RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { .. })
| RuntimeCall::Balances(pallet_balances::Call::transfer_all { .. })
),
ProxyType::SmallTransfer => match c {
RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive {
value, ..
}) => *value < SMALL_TRANSFER_LIMIT,
RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
value,
..
}) => *value < SMALL_TRANSFER_LIMIT,
_ => false,
},
ProxyType::Owner => matches!(c, RuntimeCall::AdminUtils(..)),
ProxyType::NonCritical => !matches!(
c,
Expand Down

0 comments on commit 303db90

Please sign in to comment.