fn take_ownership_command(matches: &ArgMatches) {
    if let Some(matches) = matches.subcommand_matches("take_ownership") {
        if let Some(ref pass) = matches.value_of("password") {
            let new_id = Id::random::<Provider>().expect("Unable to generate a new id");

            let snapshot = get_snapshot_path();
            let client: Client<Provider> = deserialize_from_snapshot(&snapshot, pass);
            let new_client: Client<Provider> = Client::create_chain(client.db.key, new_id);

            new_client.take_ownership(client.id);

            println!("Old owner id: {:?}\nNew owner id: {:?}", client.id, new_client.id);

            let snapshot = get_snapshot_path();
            serialize_to_snapshot(&snapshot, pass, new_client);
        }
    }
}
// Take ownership of an existing chain. Requires that the new chain owner knows the old key to unlock the data.
Take ownership of an existing chain. Requires that the new chain owner knows the old key to unlock the data.
Take ownership of an existing chain . Requires that the new chain owner knows the old key to unlock the data .
fn take_ownership_command(matches: &ArgMatches) {
    if let Some(matches) = matches.subcommand_matches("take_ownership") {
        if let Some(ref pass) = matches.value_of("password") {
            let new_id = Id::random::<Provider>().expect("Unable to generate a new id");
            let snapshot = get_snapshot_path();
            let client: Client<Provider> = deserialize_from_snapshot(&snapshot, pass);
            let new_client: Client<Provider> = Client::create_chain(client.db.key, new_id);
            new_client.take_ownership(client.id);
            println!("Old owner id: {:?}\nNew owner id: {:?}", client.id, new_client.id);
            let snapshot = get_snapshot_path();
            serialize_to_snapshot(&snapshot, pass, new_client);
        }
    }
}
fn take_ownership_command ( matches : & ArgMatches ) { if let Some ( matches ) = matches . subcommand_matches ( " " ) { if let Some ( ref pass ) = matches . value_of ( " " ) { let new_id = Id :: random :: < Provider > ( ) . expect ( " " ) ; let snapshot = get_snapshot_path ( ) ; let client : Client < Provider > = deserialize_from_snapshot ( & snapshot , pass ) ; let new_client : Client < Provider > = Client :: create_chain ( client . db . key , new_id ) ; new_client . take_ownership ( client . id ) ; println ! ( " \n " client id new_client id ) ; let snapshot = get_snapshot_path ( ) ; serialize_to_snapshot ( & snapshot , pass , new_client ) ; } } }
Take ownership of an existing chain.
Take ownership of an existing chain .
matches
&ArgMatches