mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Remove substrate-in-the-browser (#9541)
* Comment out browser stuff * Remove browser stuff * Remove more wasm transport code * Remove ExtTransport and rework how telemetry initialises. * Change (most) wasm-timer using code to use std::time * Rename CI-job * Aura does not compile for wasm * Remove testing in the browser on CI * Update README * Leave `StreamSink` be * fmt
This commit is contained in:
@@ -25,7 +25,7 @@ use libp2p::{
|
||||
transport::{Boxed, OptionalTransport},
|
||||
upgrade,
|
||||
},
|
||||
identity, mplex, noise, wasm_ext, PeerId, Transport,
|
||||
identity, mplex, noise, PeerId, Transport,
|
||||
};
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
use libp2p::{dns, tcp, websocket};
|
||||
@@ -51,18 +51,11 @@ pub use self::bandwidth::BandwidthSinks;
|
||||
pub fn build_transport(
|
||||
keypair: identity::Keypair,
|
||||
memory_only: bool,
|
||||
wasm_external_transport: Option<wasm_ext::ExtTransport>,
|
||||
yamux_window_size: Option<u32>,
|
||||
yamux_maximum_buffer_size: usize,
|
||||
) -> (Boxed<(PeerId, StreamMuxerBox)>, Arc<BandwidthSinks>) {
|
||||
// Build the base layer of the transport.
|
||||
let transport = if let Some(t) = wasm_external_transport {
|
||||
OptionalTransport::some(t)
|
||||
} else {
|
||||
OptionalTransport::none()
|
||||
};
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
let transport = transport.or_transport(if !memory_only {
|
||||
let transport = if !memory_only {
|
||||
let desktop_trans = tcp::TcpConfig::new().nodelay(true);
|
||||
let desktop_trans =
|
||||
websocket::WsConfig::new(desktop_trans.clone()).or_transport(desktop_trans);
|
||||
@@ -73,9 +66,9 @@ pub fn build_transport(
|
||||
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Transport))
|
||||
})
|
||||
} else {
|
||||
// For the in-memory case we set up the transport with an `.or_transport` below.
|
||||
OptionalTransport::none()
|
||||
});
|
||||
|
||||
};
|
||||
let transport = transport.or_transport(if memory_only {
|
||||
OptionalTransport::some(libp2p::core::transport::MemoryTransport::default())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user