WIP
This commit is contained in:
parent
030bc6f19a
commit
970f3d9fef
1 changed files with 3 additions and 4 deletions
|
@ -4,12 +4,11 @@ use color_eyre::{eyre::eyre, Help, Report, Result};
|
||||||
use cosmrs::{tendermint::chain::Id, AccountId};
|
use cosmrs::{tendermint::chain::Id, AccountId};
|
||||||
use reqwest::Url;
|
use reqwest::Url;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use std::str::FromStr;
|
|
||||||
use quoted_string::strip_dquotes;
|
use quoted_string::strip_dquotes;
|
||||||
use crate::CwClient;
|
use crate::CwClient;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum CliClientType {g
|
pub enum CliClientType {
|
||||||
Wasmd,
|
Wasmd,
|
||||||
Neutrond,
|
Neutrond,
|
||||||
}
|
}
|
||||||
|
@ -72,9 +71,9 @@ 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());
|
let amount = strip_dquotes(&json["price"]["amount"].to_string());
|
||||||
|
|
||||||
let price = amount.as_f64().expect("couldn't parse gas price");
|
let price = amount.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