Backup platform impl

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-06-02 19:16:52 +03:00
parent ede1094be3
commit b70beaf7a4
10 changed files with 636 additions and 60 deletions
+11
View File
@@ -1,7 +1,9 @@
#![cfg(target_arch = "wasm32")]
use subxt::config::PolkadotConfig;
use subxt::rpc::LightClient;
use wasm_bindgen_test::*;
use std::sync::Arc;
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
@@ -16,3 +18,12 @@ async fn wasm_ws_transport_works() {
let chain = client.rpc().system_chain().await.unwrap();
assert_eq!(&chain, "Development");
}
#[wasm_bindgen_test]
async fn light_client_transport_works() {
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();
let chain = client.rpc().system_chain().await.unwrap();
assert_eq!(&chain, "Development");
}