Skip to content

Commit 6f8135c

Browse files
Merge pull request #4549 from rklaehn/feat-iroh-0-5
Fix transfer test
2 parents 7ede815 + 39a027c commit 6f8135c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/imex/transfer.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use iroh::bytes::get::{fsm, Stats};
4040
use iroh::bytes::protocol::{AnyGetRequest, GetRequest, RequestToken};
4141
use iroh::bytes::provider::Event as ProviderEvent;
4242
use iroh::bytes::util::runtime;
43-
use iroh::collection::Collection;
43+
use iroh::collection::{Collection, IrohCollectionParser};
4444
use iroh::database::flat::DataSource;
4545
use iroh::dial::Ticket;
4646
use iroh::net::defaults::default_derp_map;
@@ -194,12 +194,13 @@ impl BackupProvider {
194194
let provider = Node::builder(db)
195195
.bind_addr((Ipv4Addr::UNSPECIFIED, 0).into())
196196
.custom_auth_handler(Arc::new(auth_token_handler))
197+
.collection_parser(IrohCollectionParser)
197198
.runtime(&rt)
198199
.spawn()
199200
.await?;
200201
context.emit_event(SendProgress::ProviderListening.into());
201202
info!(context, "Waiting for remote to connect");
202-
let ticket = provider.ticket(hash, Some(token)).await?;
203+
let ticket = provider.ticket(hash).await?.with_token(Some(token));
203204
Ok((provider, ticket))
204205
}
205206

@@ -500,7 +501,8 @@ async fn run_get_request(
500501
ticket: Ticket,
501502
) -> anyhow::Result<Stats> {
502503
let opts = ticket.as_get_options(Keypair::generate(), Some(default_derp_map()));
503-
let request = AnyGetRequest::Get(GetRequest::all(ticket.hash()));
504+
let request =
505+
AnyGetRequest::Get(GetRequest::all(ticket.hash())).with_token(ticket.token().cloned());
504506
let connection = iroh::dial::dial(opts).await?;
505507
let initial = fsm::start(connection, request);
506508
use fsm::*;

0 commit comments

Comments
 (0)