mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 11:11:17 +00:00
xxx: Include DispatchError and use balanace_transfer_with_params
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user