mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
tuple to struct event variants (#10206)
* update sudo pallet * Update mock.rs * cargo +nightly fmt * frame-support remote-externalities * AFNPEV tips * AFNPEV bin & update sudo * cargo +nightly fmt * optional dependency remote-test feature * fmt Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -58,7 +58,7 @@ fn sudo_emits_events_correctly() {
|
||||
// Should emit event to indicate success when called with the root `key` and `call` is `Ok`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::privileged_i32_log { i: 42, weight: 1 }));
|
||||
assert_ok!(Sudo::sudo(Origin::signed(1), call));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid { sudo_result: Ok(()) }));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ fn sudo_unchecked_weight_emits_events_correctly() {
|
||||
// Should emit event to indicate success when called with the root `key` and `call` is `Ok`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::privileged_i32_log { i: 42, weight: 1 }));
|
||||
assert_ok!(Sudo::sudo_unchecked_weight(Origin::signed(1), call, 1_000));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid { sudo_result: Ok(()) }));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ fn set_key_emits_events_correctly() {
|
||||
|
||||
// A root `key` can change the root `key`.
|
||||
assert_ok!(Sudo::set_key(Origin::signed(1), 2));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged(1)));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged { new_sudoer: 1 }));
|
||||
// Double check.
|
||||
assert_ok!(Sudo::set_key(Origin::signed(2), 4));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged(2)));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged { new_sudoer: 2 }));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -161,6 +161,6 @@ fn sudo_as_emits_events_correctly() {
|
||||
// A non-privileged function will work when passed to `sudo_as` with the root `key`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::non_privileged_log { i: 42, weight: 1 }));
|
||||
assert_ok!(Sudo::sudo_as(Origin::signed(1), 2, call));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::SudoAsDone(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::SudoAsDone { sudo_result: Ok(()) }));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user