From d216f6243d1a9d292e6b212bba4bc4e55fc4189e Mon Sep 17 00:00:00 2001 From: s0c5 Date: Fri, 24 May 2024 08:59:40 -0500 Subject: [PATCH] chore: remove commented code and update communities example --- sube/examples/pallet_communities.rs | 9 ++++++--- sube/src/rpc.rs | 5 +---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sube/examples/pallet_communities.rs b/sube/examples/pallet_communities.rs index 01b25be..a6c84a0 100644 --- a/sube/examples/pallet_communities.rs +++ b/sube/examples/pallet_communities.rs @@ -8,12 +8,15 @@ use sube::{sube, ExtrinsicBody, Response, Result, SubeBuilder}; async fn main() -> Result<()> { env_logger::init(); - log::info!("getting all the keys part of the subset"); + let response = sube!("ws://127.0.0.1:12281/communityMemberships/collection").await?; - // let response = sube!("ws://127.0.0.1:12281/communityMemberships/collection").await?; + if let Response::ValueSet(value) = result { + let data = serde_json::to_value(&value).expect("to be serializable"); + println!("Collection {}", serde_json::to_string_pretty(&data).expect("it must return an str")); + } let result = sube!("ws://127.0.0.1:12281/system/account/0x12840f0626ac847d41089c4e05cf0719c5698af1e3bb87b66542de70b2de4b2b").await?; - // log::info!("response {:?}", &result); + if let Response::Value(value) = result { let data = serde_json::to_value(&value).expect("to be serializable"); println!("Account info: {}", serde_json::to_string_pretty(&data).expect("it must return an str")); diff --git a/sube/src/rpc.rs b/sube/src/rpc.rs index 29eaf34..8021698 100644 --- a/sube/src/rpc.rs +++ b/sube/src/rpc.rs @@ -153,7 +153,4 @@ impl Backend for R { .expect("Block hash is not 32 bytes"), }) } -} -// blake_128(concat) -// hash:encocoded -// hash:? \ No newline at end of file +} \ No newline at end of file