mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 08:11:04 +00:00
blocks: Move parsing logic to the RPC for the chainHead methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -19,3 +19,4 @@ futures = "0.3.13"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] }
|
||||
hex = "0.4.3"
|
||||
tracing-subscriber = "0.3.11"
|
||||
array-bytes = "4.1"
|
||||
|
||||
@@ -28,7 +28,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Create a client to use:
|
||||
let api = OnlineClient::<PolkadotConfig>::new().await?;
|
||||
|
||||
let genesis = api.rpc().get_chainhead_genesis_hash().await?;
|
||||
let genesis = api.rpc().chainhead_genesis_hash().await?;
|
||||
println!("Genesis: {:?}", genesis);
|
||||
|
||||
let mut follow_sub = api.blocks().subscribe_chainhead_finalized(true).await?;
|
||||
@@ -53,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
let call_params = AccountKeyring::Alice.to_account_id().encode();
|
||||
let call = block
|
||||
.call("AccountNonceApi_account_nonce".into(), &call_params)
|
||||
.call("AccountNonceApi_account_nonce".into(), Some(&call_params))
|
||||
.await?;
|
||||
println!("[hash={:?}] call={:?}", block.hash(), call);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user