pub(crate) fn migrate_data(
    _old_config: WithDir<toml::Value>,
    new_config: WithDir<Config>,
) -> Result<(), Error> {
    let (new_root, new_config) = new_config.into_parts();
    let new_protocol_version = Chainspec::from_path(&new_root)
        .map_err(Error::LoadChainspec)?
        .protocol_config
        .version;
    let secret_key: Arc<SecretKey> = new_config
        .consensus
        .secret_key_path
        .load(&new_root)
        .map_err(Error::LoadSecretKey)?;

    // Get this by actually migrating the global state data.
    let state_hash = Digest::default();

    if state_hash != Digest::default() {
        write_post_migration_info(state_hash, new_protocol_version, &secret_key, info_path())?;
    }

    Ok(())
}
/// Migrates data from that specified in the old config file to that specified in the new one.
Migrates data from that specified in the old config file to that specified in the new one.
Migrates data from that specified in the old config file to that specified in the new one .
pub(crate) fn migrate_data(
    _old_config: WithDir<toml::Value>,
    new_config: WithDir<Config>,
) -> Result<(), Error> {
    let (new_root, new_config) = new_config.into_parts();
    let new_protocol_version = Chainspec::from_path(&new_root)
        .map_err(Error::LoadChainspec)?
        .protocol_config
        .version;
    let secret_key: Arc<SecretKey> = new_config
        .consensus
        .secret_key_path
        .load(&new_root)
        .map_err(Error::LoadSecretKey)?;
    // Get this by actually migrating the global state data.
    let state_hash = Digest::default();
    if state_hash != Digest::default() {
        write_post_migration_info(state_hash, new_protocol_version, &secret_key, info_path())?;
    }
    Ok(())
}
pub ( crate ) fn migrate_data ( _old_config : WithDir < toml :: Value > , new_config : WithDir < Config > , ) -> Result < ( ) , Error > { let ( new_root , new_config ) = new_config . into_parts ( ) ; let new_protocol_version = Chainspec :: from_path ( & new_root ) . map_err ( Error :: LoadChainspec ) ? . protocol_config . version ; let secret_key : Arc < SecretKey > = new_config . consensus . secret_key_path . load ( & new_root ) . map_err ( Error :: LoadSecretKey ) ? ; // Get this by actually migrating the global state data. let state_hash = Digest :: default ( ) ; if state_hash != Digest :: default ( ) { write_post_migration_info ( state_hash , new_protocol_version , & secret_key , info_path ( ) ) ? ; } Ok ( ( ) ) }
Migrates data from that specified in the old config file to that specified in the new one.
Migrates data from that specified in the old config file to that specified in the new one .
_old_config
WithDir<toml::Value>
new_config
WithDir<Config>
_old_config
WithDir<toml::Value>
new_config
WithDir<Config>