diff --git a/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs b/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs index 92b646c53c5dc..2a1d7c63f17f3 100644 --- a/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs +++ b/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs @@ -105,27 +105,23 @@ fn offchainify_works() { roll_one(pool_state.clone(), false); let current_phase = ElectionProviderMultiPhase::current_phase(); - let result = match QueuedSolution::::get() { - Some(_solution) if !current_phase.is_unsigned() => - Err("solution must be queued only in unsigned phase."), - None if current_phase.is_unsigned() => - Err("solution must be queued during unsigned phase."), - _ => Ok(()), - }; - - assert_ok!(result); + assert!( + match QueuedSolution::::get() { + Some(_) => current_phase.is_unsigned(), + None => !current_phase.is_unsigned(), + }, + "solution must be queued *only* in unsigned phase" + ); } + // test ocw solution queue if submission in unsigned phase is delayed. for _ in 0..100 { roll_one(pool_state.clone(), true); - - let result = match QueuedSolution::::get() { - Some(_solution) => - Err("solution must never be submitted since it has been delayed."), - _ => Ok(()), - }; - - assert_ok!(result); + assert_eq!( + QueuedSolution::::get(), + None, + "solution must never be submitted and stored since it is delayed" + ); } }) } diff --git a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs index 8b294c2038173..011c9c9e18e05 100644 --- a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -178,6 +178,7 @@ parameter_types! { pub static MinerMaxLength: u32 = 256; pub static MinerMaxWeight: Weight = BlockWeights::get().max_block; pub static TransactionPriority: transaction_validity::TransactionPriority = 1; + #[derive(Debug)] pub static MaxWinners: u32 = 100; pub static MaxVotesPerVoter: u32 = 16; pub static MaxNominations: u32 = 16;