From b7324bf7710b45c2b1c390913329c79fbcd9ab6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 24 Aug 2017 09:16:32 +0200 Subject: [PATCH] Patch eth_call (#6366) --- ethcore/src/miner/miner.rs | 2 +- rpc/src/v1/helpers/fake_sign.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 4b7671946..b8621a741 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -736,7 +736,7 @@ impl MinerService for Miner { let sender = t.sender(); let balance = state.balance(&sender).map_err(ExecutionError::from)?; - let needed_balance = t.value + t.gas * t.gas_price; + let needed_balance = t.value.saturating_add(t.gas.saturating_mul(t.gas_price)); if balance < needed_balance { // give the sender a sufficient balance state.add_balance(&sender, &(needed_balance - balance), CleanupMode::NoEmpty) diff --git a/rpc/src/v1/helpers/fake_sign.rs b/rpc/src/v1/helpers/fake_sign.rs index c5b95f6a4..4300468ab 100644 --- a/rpc/src/v1/helpers/fake_sign.rs +++ b/rpc/src/v1/helpers/fake_sign.rs @@ -31,7 +31,7 @@ pub fn sign_call( gas_cap: bool, ) -> Result { let from = request.from.unwrap_or(0.into()); - let mut gas = request.gas.unwrap_or(U256::max_value()); + let mut gas = request.gas.unwrap_or(U256::from(2) << 50); if gas_cap { let max_gas = 50_000_000.into(); if gas > max_gas {