/// Reads mutations from a file in the format corresponding to what ic-prep
/// outputs
Reads mutations from a file in the format corresponding to what ic-prep
outputs
Reads mutations from a file in the format corresponding to what ic - prep outputs
pub fn read_initial_registry_mutations<P: AsRef<Path>>(path: P) -> Vec<RegistryMutation> {
    let initial_registry = ProtoRegistryDataProvider::load_from_file(path.as_ref());
    // Because we use the ProtoRegistryDataProvider, we are guaranteed to get
    // the entire registry in one chunk when calling `get_updates_since()`.
    let update = initial_registry
        .get_updates_since(ZERO_REGISTRY_VERSION)
        .expect("Could not load records from initial registry.");
    update
        .into_iter()
        .filter(|r| r.value.is_some())
        .map(|r| {
            let mut mutation = RegistryMutation::default();
            mutation.set_mutation_type(registry_mutation::Type::Insert);
            mutation.key = r.key.as_bytes().to_vec();
            mutation.value = r.value.unwrap();
            mutation
        })
        .collect()
}
pub fn read_initial_registry_mutations < P : AsRef < Path > > ( path : P ) -> Vec < RegistryMutation > { let initial_registry = ProtoRegistryDataProvider :: load_from_file ( path . as_ref ( ) ) ; // Because we use the ProtoRegistryDataProvider, we are guaranteed to get // the entire registry in one chunk when calling `get_updates_since()`. let update = initial_registry . get_updates_since ( ZERO_REGISTRY_VERSION ) . expect ( " " ) ; update . into_iter ( ) . filter ( | r | r . value . is_some ( ) ) . map ( | r | { let mut mutation = RegistryMutation :: default ( ) ; mutation . set_mutation_type ( registry_mutation :: Type :: Insert ) ; mutation . key = r . key . as_bytes ( ) . to_vec ( ) ; mutation . value = r . value . unwrap ( ) ; mutation } ) . collect ( ) }
Reads mutations from a file in the format corresponding to what ic-prep
outputs
Reads mutations from a file in the format corresponding to what ic - prep outputs
path
P