-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: compact value serialization * reverse: legacy url to create backend * fix: hash touple argument * chore: cargo clipply * chore: fix depednency * chore: add from_bytes * chore: add no_std flag to cargo
- Loading branch information
Showing
9 changed files
with
188 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use core::future::{Future, IntoFuture}; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::{from_value, Value}; | ||
use sube::{sube, Response}; | ||
|
||
#[async_std::main] | ||
async fn main() -> sube::Result<()> { | ||
env_logger::init(); | ||
|
||
let query = format!( | ||
"ws://127.0.0.1:12281/communityMemberships/account/{}/{}", | ||
"0x12840f0626ac847d41089c4e05cf0719c5698af1e3bb87b66542de70b2de4b2b", | ||
1 | ||
); | ||
|
||
let r = sube!(&query).await?; | ||
|
||
if let Response::ValueSet(ref v) = r { | ||
let json_value = serde_json::to_value(v).expect("to be serializable"); | ||
println!("json: {:?}", json_value); | ||
let x = serde_json::to_string_pretty(&json_value).expect("it must return an str"); | ||
println!("Account info: {:?}", x); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use core::future::{Future, IntoFuture}; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::{from_value, Value}; | ||
use sube::{sube, Response}; | ||
|
||
#[async_std::main] | ||
async fn main() -> sube::Result<()> { | ||
env_logger::init(); | ||
|
||
let query = format!( | ||
"ws://127.0.0.1:12281/preimage/preimageFor/{}/{}", | ||
"0x6b172c3695dca229e71c0bca790f5991b68f8eee96334e842312a0a7d4a46c6c", | ||
30 | ||
); | ||
|
||
let r = sube!(&query).await?; | ||
|
||
if let Response::Value(ref v) = r { | ||
let json_value = serde_json::to_value(v).expect("to be serializable"); | ||
println!("json: {:?}", json_value); | ||
let x = serde_json::to_string_pretty(&json_value).expect("it must return an str"); | ||
println!("Account info: {:?}", x); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use env_logger; | ||
use serde_json; | ||
use sube::{sube, ExtrinsicBody, Response, Result, SubeBuilder}; | ||
|
||
#[async_std::main] | ||
async fn main() -> Result<()> { | ||
env_logger::init(); | ||
|
||
let query = format!( | ||
"https://kreivo.io/communityReferenda/referendumInfoFor/{}", | ||
24 | ||
); | ||
|
||
let r = sube!(&query).await?; | ||
|
||
if let Response::Value(ref v) = r { | ||
let json_value = serde_json::to_value(v).expect("it must to be an valid Value"); | ||
println!("Raw JSON value: {:?}", json_value); | ||
println!("Info: {}", serde_json::to_string_pretty(&json_value).expect("it must return an str")); | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters