XXX: Codegen export decoding type for the result call

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-02-07 19:20:42 +02:00
parent cd497aba54
commit 26d3123d75
2 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -24,7 +24,7 @@ use subxt::{
OnlineClient,
};
use codec::Encode;
use codec::Decode;
#[subxt::subxt(runtime_metadata_url = "http://localhost:9933")]
pub mod polkadot {}
@@ -40,6 +40,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let bytes = api.runtime_api().at(None).await?.call(api_tx).await?;
println!("Result: {:?}", bytes);
let result: polkadot::runtime_api::Core::version_target =
Decode::decode(&mut &bytes[..])?;
println!("Result is: {:?}", result);
Ok(())
}