ref(deps): Upgrade to iroh 0.4.0 (#4245)

This moves us back to a released version;

- Ticket is now opaque, need to use accessor functions.

- Ticket now ensures it is valid itself, no need to inspect it's
  inners.  Deserialisation would fail if it was bad.

- The git version was accidentally used with default-features enabled
  and thus pulled in a few too many dependencies.  They are now gone.
This commit is contained in:
Floris Bruynooghe
2023-03-29 15:45:35 +02:00
committed by GitHub
parent 943c8a1ab3
commit a2927a6586
4 changed files with 9 additions and 137 deletions

View File

@@ -182,7 +182,7 @@ impl BackupProvider {
.spawn()?;
context.emit_event(SendProgress::ProviderListening.into());
info!(context, "Waiting for remote to connect");
let ticket = provider.ticket(hash);
let ticket = provider.ticket(hash)?;
Ok((provider, ticket))
}
@@ -406,9 +406,6 @@ async fn get_backup_inner(context: &Context, qr: Qr) -> Result<()> {
Qr::Backup { ticket } => ticket,
_ => bail!("QR code for backup must be of type DCBACKUP"),
};
if ticket.addrs.is_empty() {
bail!("ticket is missing addresses to dial");
}
match transfer_from_provider(context, &ticket).await {
Ok(()) => {
@@ -511,7 +508,7 @@ async fn on_blob(
if name.starts_with("db/") {
let context = context.clone();
let token = ticket.token.to_string();
let token = ticket.token().to_string();
jobs.lock().await.spawn(async move {
if let Err(err) = context.sql.import(&path, token).await {
error!(context, "cannot import database: {:#?}", err);