mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
Move EnsureOneOf into the dispatch.rs, make an interface more general (#10379)
* move EnsureOneOf into the dispatch.rs, make an interface more general * Update frame/support/src/traits/dispatch.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -461,17 +461,6 @@ fn events_not_emitted_during_genesis() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ensure_one_of_works() {
|
||||
fn ensure_root_or_signed(o: RawOrigin<u64>) -> Result<Either<(), u64>, Origin> {
|
||||
EnsureOneOf::<u64, EnsureRoot<u64>, EnsureSigned<u64>>::try_origin(o.into())
|
||||
}
|
||||
|
||||
assert_eq!(ensure_root_or_signed(RawOrigin::Root).unwrap(), Either::Left(()));
|
||||
assert_eq!(ensure_root_or_signed(RawOrigin::Signed(0)).unwrap(), Either::Right(0));
|
||||
assert!(ensure_root_or_signed(RawOrigin::None).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extrinsics_root_is_calculated_correctly() {
|
||||
new_test_ext().execute_with(|| {
|
||||
|
||||
Reference in New Issue
Block a user