mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 03:01:07 +00:00
Export light-client functionality for WASM
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Generated
+14
@@ -2231,6 +2231,7 @@ dependencies = [
|
||||
"smoldot-light",
|
||||
"smoldot-light-wasm",
|
||||
"sp-core-hashing",
|
||||
"subxt-light-client",
|
||||
"subxt-macro",
|
||||
"subxt-metadata",
|
||||
"thiserror",
|
||||
@@ -2258,6 +2259,18 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subxt-light-client"
|
||||
version = "0.28.0"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"gloo-timers",
|
||||
"lazy_static",
|
||||
"tracing",
|
||||
"tracing-wasm",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subxt-macro"
|
||||
version = "0.28.0"
|
||||
@@ -2670,6 +2683,7 @@ dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"serde_json",
|
||||
"subxt",
|
||||
"tracing",
|
||||
"tracing-wasm",
|
||||
"wasm-bindgen-test",
|
||||
]
|
||||
|
||||
@@ -10,6 +10,7 @@ publish = false
|
||||
# subxt to work. So, we can't inherit versions.
|
||||
wasm-bindgen-test = "0.3.24"
|
||||
tracing-wasm = "0.2.1"
|
||||
tracing = "0.1.34"
|
||||
console_error_panic_hook = "0.1.7"
|
||||
serde_json = "1"
|
||||
subxt = { path = "../../subxt", default-features = false, features = ["jsonrpsee-web", "unstable-light-client"] }
|
||||
|
||||
@@ -28,8 +28,14 @@ async fn wasm_ws_transport_works() {
|
||||
async fn light_client_transport_works() {
|
||||
init_tracing();
|
||||
|
||||
// let light_client = LightClient::new(include_str!("../../../artifacts/dev_spec.json")).unwrap();
|
||||
// let client = subxt::client::OnlineClient::<PolkadotConfig>::from_rpc_client(Arc::new(light_client)).await.unwrap();
|
||||
tracing::warn!("Starting test");
|
||||
let light_client = LightClient::new(include_str!("../../../artifacts/dev_spec.json")).unwrap();
|
||||
tracing::warn!("RPC layer created..");
|
||||
|
||||
let client = subxt::client::OnlineClient::<PolkadotConfig>::from_rpc_client(Arc::new(light_client)).await.unwrap();
|
||||
|
||||
tracing::warn!("Client Created");
|
||||
|
||||
|
||||
// let chain = client.rpc().system_chain().await.unwrap();
|
||||
// assert_eq!(&chain, "Development");
|
||||
|
||||
Reference in New Issue
Block a user