Skip to content

Commit

Permalink
Merge pull request #931 from opentensor/feat/add-setcode-proxy
Browse files Browse the repository at this point in the history
[feat] add SetCode proxy type
  • Loading branch information
unconst authored Nov 7, 2024
2 parents 4ad316e + 4b22f4b commit c1a9211
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ pub enum ProxyType {
Transfer,
SmallTransfer,
RootWeights,
SudoUncheckedSetCode,
}
// Transfers below SMALL_TRANSFER_LIMIT are considered small transfers
pub const SMALL_TRANSFER_LIMIT: Balance = 500_000_000; // 0.5 TAO
Expand Down Expand Up @@ -688,6 +689,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::SubtensorModule(pallet_subtensor::Call::burned_register { .. })
| RuntimeCall::Triumvirate(..)
| RuntimeCall::SubtensorModule(pallet_subtensor::Call::set_root_weights { .. })
| RuntimeCall::Sudo(..)
),
ProxyType::Triumvirate => matches!(
c,
Expand All @@ -714,6 +716,17 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
c,
RuntimeCall::SubtensorModule(pallet_subtensor::Call::set_root_weights { .. })
),
ProxyType::SudoUncheckedSetCode => match c {
RuntimeCall::Sudo(pallet_sudo::Call::sudo_unchecked_weight { call, weight: _ }) => {
let inner_call: RuntimeCall = *call.clone();

matches!(
inner_call,
RuntimeCall::System(frame_system::Call::set_code { .. })
)
}
_ => false,
},
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down

0 comments on commit c1a9211

Please sign in to comment.