forked from paritytech/subxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.rs
40 lines (31 loc) · 952 Bytes
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019-2023 Parity Technologies (UK) Ltd.
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
//! Default platform for WASM environments.
#[cfg(feature = "web")]
mod wasm_helpers;
#[cfg(feature = "web")]
mod wasm_platform;
#[cfg(feature = "web")]
mod wasm_socket;
pub use helpers::{build_platform, DefaultPlatform};
#[cfg(feature = "native")]
mod helpers {
use smoldot_light::platform::default::DefaultPlatform as Platform;
use std::sync::Arc;
pub type DefaultPlatform = Arc<Platform>;
pub fn build_platform() -> DefaultPlatform {
Platform::new(
"subxt-light-client".into(),
env!("CARGO_PKG_VERSION").into(),
)
}
}
#[cfg(feature = "web")]
mod helpers {
use super::wasm_platform::SubxtPlatform as Platform;
pub type DefaultPlatform = Platform;
pub fn build_platform() -> DefaultPlatform {
Platform::new()
}
}