Adding default for value (#1465)

This commit is contained in:
Tomasz Drwięga 2016-06-28 11:10:39 +02:00 committed by Gav Wood
parent a3a68a20f4
commit 6895a56099
2 changed files with 4 additions and 1 deletions

2
Cargo.lock generated
View File

@ -1446,7 +1446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ws"
version = "0.5.0"
source = "git+https://github.com/ethcore/ws-rs.git?branch=stable#e2452450c830618aed30db02e63f3a68710cc40e"
source = "git+https://github.com/ethcore/ws-rs.git?branch=stable#a876fc115c3ef50a17c8822c9bd2f6e94473e005"
dependencies = [
"httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -29,6 +29,9 @@ use v1::impls::{default_gas_price, sign_and_dispatch};
fn fill_optional_fields<C, M>(request: &mut TransactionRequest, client: &C, miner: &M)
where C: MiningBlockChainClient, M: MinerService {
if request.value.is_none() {
request.value = Some(U256::zero());
}
if request.gas.is_none() {
request.gas = Some(miner.sensible_gas_limit());
}