session-info: add new fields + migration (#4545)

* session_info: v2 + migration

* use primitives::v2

* use polkadot_primitives::v2

* impl primitives::v2

* fix approval-voting tests

* fix other tests

* hook storage migration up

* backwards compat (1)

* backwards compat (2)

* fmt

* fix tests

* FMT

* do not reexport v1 in v2

* fmt

* set storage version to 1

Co-authored-by: Javier Viola <javier@parity.io>
This commit is contained in:
Andronik Ordian
2021-12-27 09:01:30 +01:00
committed by GitHub
parent 2e360f0aac
commit b342ae11d3
38 changed files with 542 additions and 299 deletions
@@ -32,9 +32,12 @@ use sp_runtime::traits::AppVerify;
use polkadot_node_network_protocol::{our_view, request_response::IncomingRequest, view};
use polkadot_node_primitives::BlockData;
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_primitives::v1::{
AuthorityDiscoveryId, CollatorPair, GroupRotationInfo, ScheduledCore, SessionIndex,
SessionInfo, ValidatorId, ValidatorIndex,
use polkadot_primitives::{
v1::{
AuthorityDiscoveryId, CollatorPair, GroupRotationInfo, ScheduledCore, SessionIndex,
ValidatorId, ValidatorIndex,
},
v2::SessionInfo,
};
use polkadot_primitives_test_helpers::TestCandidateBuilder;
use polkadot_subsystem::{
@@ -110,6 +113,7 @@ impl Default for TestState {
n_delay_tranches: 0,
no_show_slots: 0,
needed_approvals: 0,
active_validator_indices: vec![],
},
group_rotation_info,
validator_peer_id,