mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 00:01:03 +00:00
XXX: Include return type for decoding
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -40,26 +40,12 @@ 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 for polkadot::runtime_api::Core::version(): {:?}\n\n",
|
||||
result
|
||||
);
|
||||
|
||||
let api_tx = polkadot::runtime_api::Metadata::metadata_versions();
|
||||
println!("RuntimeApi payload: {:?}", api_tx);
|
||||
|
||||
let bytes = api.runtime_api().at(None).await?.call(api_tx).await?;
|
||||
println!("Result: {:?}", bytes);
|
||||
|
||||
let result: polkadot::runtime_api::Metadata::metadata_versions_target =
|
||||
Decode::decode(&mut &bytes[..])?;
|
||||
println!(
|
||||
"Result for polkadot::runtime_api::Metadata::metadata_versions(): {:?}\n\n",
|
||||
result
|
||||
);
|
||||
|
||||
let alice = AccountKeyring::Alice.to_account_id().into();
|
||||
let api_tx = polkadot::runtime_api::AccountNonceApi::account_nonce(alice);
|
||||
println!("RuntimeApi payload: {:?}", api_tx);
|
||||
@@ -67,13 +53,6 @@ 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::AccountNonceApi::account_nonce_target =
|
||||
Decode::decode(&mut &bytes[..])?;
|
||||
println!(
|
||||
"Result for polkadot::runtime_api::AccountNonceApi::account_nonce: {:?}\n\n",
|
||||
result
|
||||
);
|
||||
|
||||
// Send from Alice to Bob.
|
||||
let signer = PairSigner::new(AccountKeyring::Alice.pair());
|
||||
let dest = AccountKeyring::Bob.to_account_id().into();
|
||||
@@ -95,12 +74,5 @@ 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::AccountNonceApi::account_nonce_target =
|
||||
Decode::decode(&mut &bytes[..])?;
|
||||
println!(
|
||||
"Result for polkadot::runtime_api::AccountNonceApi::account_nonce: {:?}\n\n",
|
||||
result
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user