mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 04:27:57 +00:00
Improve call, and usage in pallet utility (#9418)
* WIP * WIP * WIP * add some tests and limit * remove wip test * fmt * Update bin/node/runtime/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * fmt * use primitives allocation limit Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
27d4177f93
commit
38db14089b
@@ -66,6 +66,9 @@ pub mod example {
|
||||
Ok(end_weight.into())
|
||||
}
|
||||
}
|
||||
|
||||
#[weight = 0]
|
||||
fn big_variant(_origin, _arg: [u8; 400]) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,3 +591,12 @@ fn batch_all_does_not_nest() {
|
||||
assert_eq!(Balances::free_balance(2), 10);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn batch_limit() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let calls = vec![Call::System(SystemCall::remark(vec![])); 40_000];
|
||||
assert_noop!(Utility::batch(Origin::signed(1), calls.clone()), Error::<Test>::TooManyCalls);
|
||||
assert_noop!(Utility::batch_all(Origin::signed(1), calls), Error::<Test>::TooManyCalls);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user