Change --min-gas-price to u64

This commit is contained in:
Joseph Mark 2017-07-14 09:40:47 +07:00
parent 9c3bd83d3b
commit 0f37261dbf
No known key found for this signature in database
GPG Key ID: 9BA8D1EE2E53C283
5 changed files with 8 additions and 8 deletions

View File

@ -101,7 +101,7 @@ reseal_min_period = 4000
reseal_max_period = 60000
work_queue_size = 20
relay_set = "cheap"
min_gas_price = ""
min_gas_price = 0
usd_per_tx = "0.0025"
usd_per_eth = "auto"
price_update_period = "hourly"

View File

@ -269,7 +269,7 @@ usage! {
or |c: &Config| otry!(c.mining).tx_time_limit.clone().map(Some),
flag_relay_set: String = "cheap",
or |c: &Config| otry!(c.mining).relay_set.clone(),
flag_min_gas_price: Option<String> = None,
flag_min_gas_price: Option<u64> = None,
or |c: &Config| otry!(c.mining).min_gas_price.clone().map(Some),
flag_usd_per_tx: String = "0.0025",
or |c: &Config| otry!(c.mining).usd_per_tx.clone(),
@ -544,7 +544,7 @@ struct Mining {
tx_gas_limit: Option<String>,
tx_time_limit: Option<u64>,
relay_set: Option<String>,
min_gas_price: Option<String>,
min_gas_price: Option<u64>,
usd_per_tx: Option<String>,
usd_per_eth: Option<String>,
price_update_period: Option<String>,
@ -811,7 +811,7 @@ mod tests {
flag_tx_gas_limit: Some("6283184".into()),
flag_tx_time_limit: Some(100u64),
flag_relay_set: "cheap".into(),
flag_min_gas_price: Some("".into()),
flag_min_gas_price: Some(0u64),
flag_usd_per_tx: "0.0025".into(),
flag_usd_per_eth: "auto".into(),
flag_price_update_period: "hourly".into(),

View File

@ -3,4 +3,4 @@ chain = "dev"
[mining]
reseal_min_period = 0
min_gas_price = "0"
min_gas_price = 0

View File

@ -295,7 +295,7 @@ Sealing/Mining Options:
means we relay nothing if not mining);
lenient - Same as strict when mining, and cheap
when not (default: {flag_relay_set}).
--min-gas-price STRING Minimum amount of Wei per GAS to be paid for a
--min-gas-price WEI Minimum amount of Wei per GAS to be paid for a
transaction to be accepted for mining. Overrides
--basic-tx-usd.
(default: {flag_min_gas_price:?})

View File

@ -621,8 +621,8 @@ impl Configuration {
if let Some(dec) = self.args.flag_gasprice.as_ref() {
return Ok(GasPricerConfig::Fixed(to_u256(dec)?));
} else if let Some(dec) = self.args.flag_min_gas_price.as_ref() {
return Ok(GasPricerConfig::Fixed(to_u256(dec)?));
} else if let Some(dec) = self.args.flag_min_gas_price {
return Ok(GasPricerConfig::Fixed(U256::from(dec)));
}
let usd_per_tx = to_price(&self.args.flag_usd_per_tx)?;