We should allow users the ability to configure their bridge such that they can query a gas-price Oracle which returns a JSON schema differing from the above schema. This should be implemented using JMESPath expressions.
A new config option home/foreign.gas_price_oracle_expr should be added to account for the User's JMESPath expression.
Something similar to the following psuedo-code should be added to GasPriceStream's impl Stream.
let json_str = /* Use hyper to GET the Oracle's data, then string-ify the response body */
let resp_json = jmespath::Variable::from_json(json_str).map_err(|_| ... )?;
let gas_price = config.<home/foreign>.gas_price_expr
.search(resp_json).unwrap_or(config.<home/foreign>.default_gas_price);
Currently, a static JSON schema is expected to be returned from the gas-price Oracle:
We should allow users the ability to configure their bridge such that they can query a gas-price Oracle which returns a JSON schema differing from the above schema. This should be implemented using JMESPath expressions.
A new config option
home/foreign.gas_price_oracle_expr
should be added to account for the User's JMESPath expression.Something similar to the following psuedo-code should be added to
GasPriceStream
'simpl Stream
.