pub fn assimilate_storage(
        &self,
        storage : & mut self :: sp_api_hidden_includes_decl_storage :: hidden_include :: sp_runtime :: Storage,
    ) -> std::result::Result<(), String> {
        self :: sp_api_hidden_includes_decl_storage :: hidden_include :: BasicExternalities :: execute_with_storage (storage , | | { let extra_genesis_builder : fn (& Self) = | config : & GenesisConfig < T > | { if T :: SessionHandler :: KEY_TYPE_IDS . len () != T :: Keys :: key_ids () . len () { { :: std :: rt :: begin_panic ("Number of keys in session handler and session keys does not match") } ; } T :: SessionHandler :: KEY_TYPE_IDS . iter () . zip (T :: Keys :: key_ids ()) . enumerate () . for_each (| (i , (sk , kk)) | { if sk != kk { { :: std :: rt :: panic_fmt (:: core :: fmt :: Arguments :: new_v1 (& ["Session handler and session key expect different key type at index: "] , & match (& i ,) { _args => [:: core :: fmt :: ArgumentV1 :: new (_args . 0 , :: core :: fmt :: Display :: fmt)] , })) } ; } }) ; for (account , val , keys) in config . keys . iter () . cloned () { < Module < T > > :: inner_set_keys (& val , keys) . expect ("genesis config must not contain duplicates; qed") ; if frame_system :: Pallet :: < T > :: inc_consumers (& account) . is_err () { frame_system :: Pallet :: < T > :: inc_providers (& account) ; } } let initial_validators_0 = T :: SessionManager :: new_session_genesis (0) . unwrap_or_else (| | { frame_support :: print ("No initial validator provided by `SessionManager`, use \
						session config keys to generate initial validator set.") ; config . keys . iter () . map (| x | x . 1 . clone ()) . collect () }) ; if ! ! initial_validators_0 . is_empty () { { :: std :: rt :: begin_panic ("Empty validator set for session 0 in genesis block!") } } ; let initial_validators_1 = T :: SessionManager :: new_session_genesis (1) . unwrap_or_else (| | initial_validators_0 . clone ()) ; if ! ! initial_validators_1 . is_empty () { { :: std :: rt :: begin_panic ("Empty validator set for session 1 in genesis block!") } } ; let queued_keys : Vec < _ > = initial_validators_1 . iter () . cloned () . map (| v | (v . clone () , < Module < T > > :: load_keys (& v) . unwrap_or_default ())) . collect () ; T :: SessionHandler :: on_genesis_session :: < T :: Keys > (& queued_keys) ; < Validators < T > > :: put (initial_validators_0) ; < QueuedKeys < T > > :: put (queued_keys) ; T :: SessionManager :: start_session (0) ; } ; extra_genesis_builder (self) ; Ok (()) })
    }
/// Assimilate the storage for this module into pre-existing overlays.
Assimilate the storage for this module into pre-existing overlays.
Assimilate the storage for this module into pre - existing overlays .
pub fn assimilate_storage(
        &self,
        storage : & mut self :: sp_api_hidden_includes_decl_storage :: hidden_include :: sp_runtime :: Storage,
    ) -> std::result::Result<(), String> {
        self :: sp_api_hidden_includes_decl_storage :: hidden_include :: BasicExternalities :: execute_with_storage (storage , | | { let extra_genesis_builder : fn (& Self) = | config : & GenesisConfig < T > | { if T :: SessionHandler :: KEY_TYPE_IDS . len () != T :: Keys :: key_ids () . len () { { :: std :: rt :: begin_panic ("Number of keys in session handler and session keys does not match") } ; } T :: SessionHandler :: KEY_TYPE_IDS . iter () . zip (T :: Keys :: key_ids ()) . enumerate () . for_each (| (i , (sk , kk)) | { if sk != kk { { :: std :: rt :: panic_fmt (:: core :: fmt :: Arguments :: new_v1 (& ["Session handler and session key expect different key type at index: "] , & match (& i ,) { _args => [:: core :: fmt :: ArgumentV1 :: new (_args . 0 , :: core :: fmt :: Display :: fmt)] , })) } ; } }) ; for (account , val , keys) in config . keys . iter () . cloned () { < Module < T > > :: inner_set_keys (& val , keys) . expect ("genesis config must not contain duplicates; qed") ; if frame_system :: Pallet :: < T > :: inc_consumers (& account) . is_err () { frame_system :: Pallet :: < T > :: inc_providers (& account) ; } } let initial_validators_0 = T :: SessionManager :: new_session_genesis (0) . unwrap_or_else (| | { frame_support :: print ("No initial validator provided by `SessionManager`, use \
						session config keys to generate initial validator set.") ; config . keys . iter () . map (| x | x . 1 . clone ()) . collect () }) ; if ! ! initial_validators_0 . is_empty () { { :: std :: rt :: begin_panic ("Empty validator set for session 0 in genesis block!") } } ; let initial_validators_1 = T :: SessionManager :: new_session_genesis (1) . unwrap_or_else (| | initial_validators_0 . clone ()) ; if ! ! initial_validators_1 . is_empty () { { :: std :: rt :: begin_panic ("Empty validator set for session 1 in genesis block!") } } ; let queued_keys : Vec < _ > = initial_validators_1 . iter () . cloned () . map (| v | (v . clone () , < Module < T > > :: load_keys (& v) . unwrap_or_default ())) . collect () ; T :: SessionHandler :: on_genesis_session :: < T :: Keys > (& queued_keys) ; < Validators < T > > :: put (initial_validators_0) ; < QueuedKeys < T > > :: put (queued_keys) ; T :: SessionManager :: start_session (0) ; } ; extra_genesis_builder (self) ; Ok (()) })
    }
pub fn assimilate_storage ( & self , storage : & mut self :: sp_api_hidden_includes_decl_storage :: hidden_include :: sp_runtime :: Storage , ) -> std :: result :: Result < ( ) , String > { self :: sp_api_hidden_includes_decl_storage :: hidden_include :: BasicExternalities :: execute_with_storage ( storage , | | { let extra_genesis_builder : fn ( & Self ) = | config : & GenesisConfig < T > | { if T :: SessionHandler :: KEY_TYPE_IDS . len ( ) != T :: Keys :: key_ids ( ) . len ( ) { { :: std :: rt :: begin_panic ( " " ) } ; } T :: SessionHandler :: KEY_TYPE_IDS . iter ( ) . zip ( T :: Keys :: key_ids ( ) ) . enumerate ( ) . for_each ( | ( i , ( sk , kk ) ) | { if sk != kk { { :: std :: rt :: panic_fmt ( :: core :: fmt :: Arguments :: new_v1 ( & [ " " ] , & match ( & i , ) { _args => [ :: core :: fmt :: ArgumentV1 :: new ( _args . 0 , :: core :: fmt :: Display :: fmt ) ] , } ) ) } ; } } ) ; for ( account , val , keys ) in config . keys . iter ( ) . cloned ( ) { < Module < T > > :: inner_set_keys ( & val , keys ) . expect ( " " ) ; if frame_system :: Pallet :: < T > :: inc_consumers ( & account ) . is_err ( ) { frame_system :: Pallet :: < T > :: inc_providers ( & account ) ; } } let initial_validators_0 = T :: SessionManager :: new_session_genesis ( 0 ) . unwrap_or_else ( | | { frame_support :: print ( " \
 " ) ; config . keys . iter ( ) . map ( | x | x . 1 . clone ( ) ) . collect ( ) } ) ; if ! ! initial_validators_0 . is_empty ( ) { { :: std :: rt :: begin_panic ( " " ) } } ; let initial_validators_1 = T :: SessionManager :: new_session_genesis ( 1 ) . unwrap_or_else ( | | initial_validators_0 . clone ( ) ) ; if ! ! initial_validators_1 . is_empty ( ) { { :: std :: rt :: begin_panic ( " " ) } } ; let queued_keys : Vec < _ > = initial_validators_1 . iter ( ) . cloned ( ) . map ( | v | ( v . clone ( ) , < Module < T > > :: load_keys ( & v ) . unwrap_or_default ( ) ) ) . collect ( ) ; T :: SessionHandler :: on_genesis_session :: < T :: Keys > ( & queued_keys ) ; < Validators < T > > :: put ( initial_validators_0 ) ; < QueuedKeys < T > > :: put ( queued_keys ) ; T :: SessionManager :: start_session ( 0 ) ; } ; extra_genesis_builder ( self ) ; Ok ( ( ) ) } ) }
Assimilate the storage for this module into pre-existing overlays.
Assimilate the storage for this module into pre - existing overlays .
&self
storage
& mut self :: sp_api_hidden_includes_decl_storage :: hidden_include :: sp_runtime :: Storage
&self
storage
& mut self :: sp_api_hidden_includes_decl_storage :: hidden_include :: sp_runtime :: Storage