Skip to content

Commit b0b61d1

Browse files
gui1117kianenigma
andauthored
Introduce in-origin filtering (#6318)
* impl filter in origin * remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter * rename BasicCallFilter -> BaseCallFilter * refactor code * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * remove forgotten temporar comment * better add suggestion in another PR * refactor: use Clone instead of mem::replace * fix tests * fix tests * fix tests * fix benchmarks * Make root bypass filter in utility::batch * fix unused imports Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
1 parent e3e6a5b commit b0b61d1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ parameter_types! {
6464
}
6565

6666
impl frame_system::Trait for Test {
67+
type BaseCallFilter = ();
6768
type Origin = Origin;
6869
type Call = Call;
6970
type Index = u64;

src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn set_recovered_works() {
4646
// Not accessible by a normal user
4747
assert_noop!(Recovery::set_recovered(Origin::signed(1), 5, 1), BadOrigin);
4848
// Root can set a recovered account though
49-
assert_ok!(Recovery::set_recovered(Origin::ROOT, 5, 1));
49+
assert_ok!(Recovery::set_recovered(Origin::root(), 5, 1));
5050
// Account 1 should now be able to make a call through account 5
5151
let call = Box::new(Call::Balances(BalancesCall::transfer(1, 100)));
5252
assert_ok!(Recovery::as_recovered(Origin::signed(1), 5, call));

0 commit comments

Comments
 (0)