Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
1xstj committed Jan 2, 2024
1 parent f32e896 commit a210bf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
26 changes: 6 additions & 20 deletions runtime/mainnet/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,17 @@ impl Contains<RuntimeCall> for MainnetCallFilter {
return false
}

let democracy_related = matches!(
call,
match call {
// Filter democracy proposals creation
RuntimeCall::Democracy(_) |
// disallow council
RuntimeCall::Council(_)
);

// block all democracy calls in mainnet, TODO : this will be enabled later
if democracy_related {
return false
}

let light_client_related = matches!(
call,
RuntimeCall::Council(_) |
// Filter light client calls
RuntimeCall::Eth2Client(_)
);
RuntimeCall::Eth2Client(_) => false,

// block all light client calls in mainnet, TODO : this will be enabled later
if light_client_related {
return false
}
// al other calls are allowed
_ =>true

// al other calls are allowed
true
}
}
}
16 changes: 5 additions & 11 deletions runtime/testnet/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,15 @@ impl Contains<RuntimeCall> for TestnetCallFilter {
return false
}

let democracy_related = matches!(
call,
match call {
// Filter democracy proposals creation
RuntimeCall::Democracy(_) |
// disallow council
RuntimeCall::Council(_)
);
RuntimeCall::Council(_) => false,

// block all democracy calls in testnet
if democracy_related {
// no democracy call
return false
}
// al other calls are allowed
_ => true

// al other calls are allowed
true
}
}
}

0 comments on commit a210bf7

Please sign in to comment.