Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Use static call and apparent value transfer for block reward contract code #9603

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ethcore/src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use self::epoch::PendingTransition;

use account_provider::AccountProvider;
use builtin::Builtin;
use vm::{EnvInfo, Schedule, CreateContractAddress};
use vm::{EnvInfo, Schedule, CreateContractAddress, CallType, ActionValue};
use error::Error;
use header::{Header, BlockNumber};
use snapshot::SnapshotComponents;
Expand Down Expand Up @@ -163,8 +163,10 @@ pub fn default_system_or_code_call<'a>(machine: &'a ::machine::EthereumMachine,
None,
Some(code),
Some(code_hash),
Some(ActionValue::Apparent(U256::zero())),
U256::max_value(),
Some(data),
Some(CallType::StaticCall),
)
},
};
Expand Down
12 changes: 8 additions & 4 deletions ethcore/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ impl EthereumMachine {
Some(contract_address),
code,
code_hash,
None,
gas,
data
data,
None,
)
}

Expand All @@ -149,8 +151,10 @@ impl EthereumMachine {
contract_address: Option<Address>,
code: Option<Arc<Vec<u8>>>,
code_hash: Option<H256>,
value: Option<ActionValue>,
gas: U256,
data: Option<Vec<u8>>
data: Option<Vec<u8>>,
call_type: Option<CallType>,
) -> Result<Vec<u8>, Error> {
let env_info = {
let mut env_info = block.env_info();
Expand All @@ -167,11 +171,11 @@ impl EthereumMachine {
origin: SYSTEM_ADDRESS,
gas,
gas_price: 0.into(),
value: ActionValue::Transfer(0.into()),
value: value.unwrap_or(ActionValue::Transfer(0.into())),
code,
code_hash,
data,
call_type: CallType::Call,
call_type: call_type.unwrap_or(CallType::Call),
params_type: ParamsType::Separate,
};
let schedule = self.schedule(env_info.number);
Expand Down