Merge branch 'master' into gav
This commit is contained in:
commit
035b29c481
@ -135,13 +135,16 @@ impl<'a> Executive<'a> {
|
|||||||
let mut substate = Substate::new();
|
let mut substate = Substate::new();
|
||||||
let backup = self.state.clone();
|
let backup = self.state.clone();
|
||||||
|
|
||||||
|
let schedule = self.engine.schedule(self.info);
|
||||||
|
let init_gas = t.gas - U256::from(schedule.tx_gas);
|
||||||
|
|
||||||
let res = match t.action() {
|
let res = match t.action() {
|
||||||
&Action::Create => {
|
&Action::Create => {
|
||||||
let params = ActionParams {
|
let params = ActionParams {
|
||||||
address: contract_address(&sender, &nonce),
|
address: contract_address(&sender, &nonce),
|
||||||
sender: sender.clone(),
|
sender: sender.clone(),
|
||||||
origin: sender.clone(),
|
origin: sender.clone(),
|
||||||
gas: t.gas,
|
gas: init_gas,
|
||||||
gas_price: t.gas_price,
|
gas_price: t.gas_price,
|
||||||
value: t.value,
|
value: t.value,
|
||||||
code: t.data.clone(),
|
code: t.data.clone(),
|
||||||
@ -154,7 +157,7 @@ impl<'a> Executive<'a> {
|
|||||||
address: address.clone(),
|
address: address.clone(),
|
||||||
sender: sender.clone(),
|
sender: sender.clone(),
|
||||||
origin: sender.clone(),
|
origin: sender.clone(),
|
||||||
gas: t.gas,
|
gas: init_gas,
|
||||||
gas_price: t.gas_price,
|
gas_price: t.gas_price,
|
||||||
value: t.value,
|
value: t.value,
|
||||||
code: self.state.code(address).unwrap_or(vec![]),
|
code: self.state.code(address).unwrap_or(vec![]),
|
||||||
|
@ -53,9 +53,11 @@ fn do_json_test(json_data: &[u8]) -> Vec<String> {
|
|||||||
let mut s = State::new_temp();
|
let mut s = State::new_temp();
|
||||||
s.populate_from(pre);
|
s.populate_from(pre);
|
||||||
|
|
||||||
Executive::new(&mut s, &env, engine.deref()).transact(&t).unwrap();
|
let e = Executive::new(&mut s, &env, engine.deref()).transact(&t).unwrap();
|
||||||
|
println!("executed: {:?}", e);
|
||||||
let our_post = s.to_pod_map();
|
let our_post = s.to_pod_map();
|
||||||
|
|
||||||
|
s.commit();
|
||||||
if fail_unless(s.root() == &post_state_root) {
|
if fail_unless(s.root() == &post_state_root) {
|
||||||
println!("FAILED {}. Diff:\n{}", name, pod_map_diff(&post, &our_post));
|
println!("FAILED {}. Diff:\n{}", name, pod_map_diff(&post, &our_post));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user