Use provided usd-per-eth value if an endpoint is specified (#11209)

* Fix `invalid transaction price` error message

* Setup Calibrated GasPriceConfig when usd-per-eth is an endpoint

The change will try to check if the specified value is an endpoint.
If the value of `auto` is specified, the default endpoint URL will be used
otherwise, the user-provided value will be taken as-is for an endpoint.

* Use if-let and check for usd-per-eth arg:

1. auto = use etherscan
2. value = use fixed pricer
3. endpoint = use the provided endpoint as-is

* Fix typo in to_pricce error message

* Correct whitespace indentation

* Use arg_usd_per_eth directly
This commit is contained in:
Rakan Alhneiti
2019-10-29 12:18:30 +01:00
committed by Marek Kotewicz
parent 0d3423cbe0
commit 6993ec9531
6 changed files with 35 additions and 22 deletions

View File

@@ -1910,6 +1910,7 @@ mod tests {
},
fetch,
p,
"fake_endpoint".to_owned()
)
)
}