mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
97cac4ce8b
commit
c2ad27271b
@@ -50,6 +50,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl frame_system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = ();
|
||||
type Index = u64;
|
||||
|
||||
@@ -101,7 +101,7 @@ fn transfer_index_on_accounts_should_work() {
|
||||
fn force_transfer_index_on_preowned_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(Indices::claim(Some(1).into(), 0));
|
||||
assert_ok!(Indices::force_transfer(Origin::ROOT, 3, 0, false));
|
||||
assert_ok!(Indices::force_transfer(Origin::root(), 3, 0, false));
|
||||
assert_eq!(Balances::reserved_balance(1), 0);
|
||||
assert_eq!(Balances::reserved_balance(3), 0);
|
||||
assert_eq!(Indices::lookup_index(0), Some(3));
|
||||
@@ -111,7 +111,7 @@ fn force_transfer_index_on_preowned_should_work() {
|
||||
#[test]
|
||||
fn force_transfer_index_on_free_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(Indices::force_transfer(Origin::ROOT, 3, 0, false));
|
||||
assert_ok!(Indices::force_transfer(Origin::root(), 3, 0, false));
|
||||
assert_eq!(Balances::reserved_balance(3), 0);
|
||||
assert_eq!(Indices::lookup_index(0), Some(3));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user