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