From f8c7bd5b8809e3319a2e1438468e29c205c0d4bd Mon Sep 17 00:00:00 2001 From: Ajinkya Kulkarni Date: Tue, 25 Feb 2025 14:47:36 +0100 Subject: [PATCH] WIP --- crates/utils/cw-client/src/cli.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/utils/cw-client/src/cli.rs b/crates/utils/cw-client/src/cli.rs index b0a5223..c7c5b79 100644 --- a/crates/utils/cw-client/src/cli.rs +++ b/crates/utils/cw-client/src/cli.rs @@ -71,9 +71,12 @@ impl CliClient { let output = command.output().expect("command output failed").stdout; let output_str: String = std::str::from_utf8(&output).expect("unable to parse command output").to_string(); let json: Value = serde_json::from_str(&output_str).expect("could not convert to JSON"); - let amount = strip_dquotes(&json["price"]["amount"].to_string()).expect("couldn't remove quotes"); + let amount = &json["price"]["amount"].to_string(); - let price = amount.parse::().expect("couldn't parse gas price"); + let price = strip_dquotes(amount) + .expect("strip dquotes failed") + .parse::() + .expect("couldn't parse gas price"); let gas_price = format!("{}untrn", price);