diff --git a/Cargo.lock b/Cargo.lock index 740d8da..e857708 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -741,6 +741,7 @@ dependencies = [ "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1145,7 +1146,7 @@ dependencies = [ "noise-protocol", "noise-rust-crypto", "percent-encoding", - "rand", + "rand 0.8.5", "rmp-serde", "serde", "serde_derive", @@ -1441,6 +1442,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -1448,10 +1462,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", + "rand_chacha 0.3.1", "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1480,6 +1504,15 @@ dependencies = [ "getrandom 0.2.8", ] +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -1954,7 +1987,7 @@ dependencies = [ "http", "httparse", "log", - "rand", + "rand 0.8.5", "sha-1", "thiserror", "url", @@ -2373,6 +2406,7 @@ dependencies = [ "js-sys", "log", "magic-wormhole", + "rand 0.7.3", "wasm-bindgen-futures", "wasm-logger", "web-sys", diff --git a/Cargo.toml b/Cargo.toml index 54b31b1..f0cac99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,9 @@ log = "0.4.6" wasm-logger = "0.2.0" wasm-bindgen-futures = "0.4.34" +# Temporary until this is fix in magic-wormhole +rand = { version = "0.7", features = ["wasm-bindgen"] } + [profile.release] opt-level = 'z' # Optimize for size. lto = true # Enable Link Time Optimization diff --git a/src/helpers.rs b/src/helpers.rs index 8c68fe0..d30aa50 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -5,7 +5,7 @@ use std::path::PathBuf; use std::pin::Pin; use std::task::{Context, Poll}; -use magic_wormhole::{Code, transfer, transit, Wormhole}; +use magic_wormhole::{Code, transfer, transit, Wormhole, AppConfig, rendezvous::DEFAULT_RENDEZVOUS_SERVER}; pub async fn send(file: web_sys::File) { @@ -49,10 +49,10 @@ fn gen_relay_hints() -> Vec { } relay_hints } -pub fn gen_app_config() -> magic_wormhole::AppConfig { - magic_wormhole::AppConfig { +pub fn gen_app_config() -> AppConfig { + AppConfig { id: transfer::APPID, - rendezvous_url: Cow::from(magic_wormhole::rendezvous::DEFAULT_RENDEZVOUS_SERVER), + rendezvous_url: Cow::from(DEFAULT_RENDEZVOUS_SERVER), app_version: transfer::AppVersion {}, } }