WIP
This commit is contained in:
parent
e6abeb5ba7
commit
8d87786f84
1 changed files with 4 additions and 4 deletions
|
@ -72,9 +72,9 @@ 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");
|
||||
assert_eq!(json["price"]["amount"].to_string(), "0.005300000000000000");
|
||||
let amount = strip_dquotes(json["price"]["amount"].to_string()));
|
||||
|
||||
let price = &json["price"]["amount"].as_f64().expect("couldn't parse gas price");
|
||||
let price = amount.as_f64().expect("couldn't parse gas price");
|
||||
|
||||
let gas_price = format!("{}untrn", price);
|
||||
|
||||
|
@ -300,11 +300,11 @@ mod tests {
|
|||
.arg("feemarket")
|
||||
.arg("gas-price")
|
||||
.arg("untrn")
|
||||
.arg ("-o")
|
||||
.arg("-o")
|
||||
.arg("json");
|
||||
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");
|
||||
assert_eq!(json["price"]["amount"].to_string(), "0.005300000000000000");
|
||||
assert_eq!(strip_dquotes(json["price"]["amount"].to_string()), "0.005300000000000000");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue