mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 13:41:08 +00:00
Use cached session index to obtain executor params (#1190)
* Import changes from archieved repo * Revert erroneous changes * Fix more tests * Resolve discussions * Fix MORE tests * approval-voting: launch_approval better interface (#1355) --------- Co-authored-by: Javier Viola <javier@parity.io> Co-authored-by: ordian <noreply@reusable.software> Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
@@ -57,7 +57,8 @@ use polkadot_node_subsystem_test_helpers::{
|
||||
mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle,
|
||||
};
|
||||
use polkadot_primitives::{
|
||||
AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo,
|
||||
AuthorityDiscoveryId, CandidateHash, CandidateReceipt, ExecutorParams, Hash, SessionIndex,
|
||||
SessionInfo,
|
||||
};
|
||||
|
||||
use self::mock::{
|
||||
@@ -635,6 +636,16 @@ async fn nested_network_dispute_request<'a, F, O>(
|
||||
},
|
||||
unexpected => panic!("Unexpected message {:?}", unexpected),
|
||||
}
|
||||
match handle.recv().await {
|
||||
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
|
||||
_,
|
||||
RuntimeApiRequest::SessionExecutorParams(_, tx),
|
||||
)) => {
|
||||
tx.send(Ok(Some(ExecutorParams::default())))
|
||||
.expect("Receiver should stay alive.");
|
||||
},
|
||||
unexpected => panic!("Unexpected message {:?}", unexpected),
|
||||
}
|
||||
}
|
||||
|
||||
// Import should get initiated:
|
||||
@@ -746,15 +757,27 @@ async fn activate_leaf(
|
||||
|
||||
if let Some(session_info) = new_session {
|
||||
assert_matches!(
|
||||
handle.recv().await,
|
||||
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
|
||||
h,
|
||||
RuntimeApiRequest::SessionInfo(session_idx, tx)
|
||||
)) => {
|
||||
assert_eq!(h, activate);
|
||||
assert_eq!(session_index, session_idx);
|
||||
tx.send(Ok(Some(session_info))).expect("Receiver should stay alive.");
|
||||
});
|
||||
handle.recv().await,
|
||||
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
|
||||
h,
|
||||
RuntimeApiRequest::SessionInfo(session_idx, tx)
|
||||
)) => {
|
||||
assert_eq!(h, activate);
|
||||
assert_eq!(session_index, session_idx);
|
||||
tx.send(Ok(Some(session_info))).expect("Receiver should stay alive.");
|
||||
}
|
||||
);
|
||||
assert_matches!(
|
||||
handle.recv().await,
|
||||
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
|
||||
h,
|
||||
RuntimeApiRequest::SessionExecutorParams(session_idx, tx)
|
||||
)) => {
|
||||
assert_eq!(h, activate);
|
||||
assert_eq!(session_index, session_idx);
|
||||
tx.send(Ok(Some(ExecutorParams::default()))).expect("Receiver should stay alive.");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
assert_matches!(
|
||||
|
||||
Reference in New Issue
Block a user