xxx: Include DispatchError and use balanace_transfer_with_params

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-03-08 17:30:26 +02:00
parent 2f17c5cf1d
commit 0583e902b3
68 changed files with 110587 additions and 2 deletions
+10
View File
@@ -9,6 +9,7 @@ use jsonrpsee::client_transport::ws::Uri;
use scale::Decode;
use std::io::{
self,
Read,
Write,
};
use subxt_codegen::utils::fetch_metadata_hex;
@@ -35,6 +36,15 @@ pub async fn run(opts: Opts) -> color_eyre::Result<()> {
match opts.format.as_str() {
"json" => {
let bytes = hex::decode(hex_data.trim_start_matches("0x"))?;
// let metadata = <RuntimeMetadataPrefixed as Decode>::decode(&mut &bytes[..])?;
// let mut file = std::fs::File::open(
// "/home/lexnv/workspace/subxt/artifacts/Balances.scale",
// )
// .unwrap();
// let mut bytes = Vec::new();
// file.read_to_end(&mut bytes).unwrap();
let metadata = <RuntimeMetadataPrefixed as Decode>::decode(&mut &bytes[..])?;
let json = serde_json::to_string_pretty(&metadata)?;
println!("{json}");