WIP
This commit is contained in:
parent
7da12140fd
commit
f8c7bd5b88
1 changed files with 5 additions and 2 deletions
|
@ -71,9 +71,12 @@ impl CliClient {
|
||||||
let output = command.output().expect("command output failed").stdout;
|
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 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 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::<f64>().expect("couldn't parse gas price");
|
let price = strip_dquotes(amount)
|
||||||
|
.expect("strip dquotes failed")
|
||||||
|
.parse::<f64>()
|
||||||
|
.expect("couldn't parse gas price");
|
||||||
|
|
||||||
let gas_price = format!("{}untrn", price);
|
let gas_price = format!("{}untrn", price);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue