mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
pallet-scheduler: fix test (#3923)
fix https://github.com/paritytech/polkadot-sdk/issues/3921 --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
@@ -2285,9 +2285,18 @@ fn postponed_named_task_cannot_be_rescheduled() {
|
||||
|
||||
// Run to a very large block.
|
||||
run_to_block(10);
|
||||
|
||||
// It was not executed.
|
||||
assert!(logger::log().is_empty());
|
||||
assert!(Preimage::is_requested(&hash));
|
||||
|
||||
// Preimage was not available
|
||||
assert_eq!(
|
||||
System::events().last().unwrap().event,
|
||||
crate::Event::CallUnavailable { task: (4, 0), id: Some(name) }.into()
|
||||
);
|
||||
|
||||
// So it should not be requested.
|
||||
assert!(!Preimage::is_requested(&hash));
|
||||
// Postponing removes the lookup.
|
||||
assert!(!Lookup::<Test>::contains_key(name));
|
||||
|
||||
@@ -2307,11 +2316,12 @@ fn postponed_named_task_cannot_be_rescheduled() {
|
||||
);
|
||||
|
||||
// Finally add the preimage.
|
||||
assert_ok!(Preimage::note(call.encode().into()));
|
||||
assert_ok!(Preimage::note_preimage(RuntimeOrigin::signed(0), call.encode()));
|
||||
|
||||
run_to_block(1000);
|
||||
// It did not execute.
|
||||
assert!(logger::log().is_empty());
|
||||
assert!(Preimage::is_requested(&hash));
|
||||
assert!(!Preimage::is_requested(&hash));
|
||||
|
||||
// Manually re-schedule the call by name does not work.
|
||||
assert_err!(
|
||||
|
||||
Reference in New Issue
Block a user