mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
approval-voting: populate session cache in advance (#3954)
* try populating session cache in advance * remove unused arg * fmt * fix compilation * fix tests * Revert "fix tests" This reverts commit e8222b1108e09a39727a38e3b4e4c3061642a213. * fix tests * bump dispute window const by 1 * fix tests
This commit is contained in:
@@ -324,7 +324,7 @@ pub(crate) async fn handle_new_head(
|
||||
}
|
||||
};
|
||||
|
||||
match state.session_window.cache_session_info_for_head(ctx, head, &header).await {
|
||||
match state.session_window.cache_session_info_for_head(ctx, head).await {
|
||||
Err(e) => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
@@ -1236,7 +1236,7 @@ pub(crate) mod tests {
|
||||
h,
|
||||
RuntimeApiRequest::SessionIndexForChild(c_tx),
|
||||
)) => {
|
||||
assert_eq!(h, parent_hash.clone());
|
||||
assert_eq!(h, hash);
|
||||
let _ = c_tx.send(Ok(session));
|
||||
}
|
||||
);
|
||||
|
||||
@@ -786,8 +786,8 @@ async fn import_block(
|
||||
RuntimeApiRequest::SessionIndexForChild(s_tx)
|
||||
)
|
||||
) => {
|
||||
let hash = &hashes[number.saturating_sub(1) as usize];
|
||||
assert_eq!(req_block_hash, hash.0.clone());
|
||||
let hash = &hashes[number as usize];
|
||||
assert_eq!(req_block_hash, hash.0);
|
||||
s_tx.send(Ok(number.into())).unwrap();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user