diff --git a/src/miner/mod.rs b/src/miner/mod.rs index 5fa7f36..a364993 100644 --- a/src/miner/mod.rs +++ b/src/miner/mod.rs @@ -117,7 +117,7 @@ pub fn make_state(genesis_accounts: Vec<(SecretKey, U256)>) -> MinerSt value: balance, input: Rc::new(Vec::new()), nonce: U256::zero(), - }, HeaderParams::from(&genesis.header), &[]); + }, &HeaderParams::from(&genesis.header), &[]); let mut accounts = Vec::new(); for account in vm.accounts() { accounts.push(account.clone()); @@ -169,9 +169,9 @@ pub fn mine_one(state: Arc>, address: Address) { for transaction in transactions.clone() { let transaction_hash = transaction.rlp_hash(); - let valid = state.stateful_mut().to_valid::

(transaction).unwrap(); + let valid = state.stateful_mut().to_valid::

(&transaction).unwrap(); let vm: SeqTransactionVM

= { - let vm = state.stateful_mut().call(valid, HeaderParams::from(¤t_block.header), + let vm = state.stateful_mut().call(valid, &HeaderParams::from(¤t_block.header), &block_hashes); let mut accounts = Vec::new(); for account in vm.accounts() { diff --git a/src/rpc/serves.rs b/src/rpc/serves.rs index 7b8f8c0..9d5c722 100644 --- a/src/rpc/serves.rs +++ b/src/rpc/serves.rs @@ -306,7 +306,7 @@ impl EthereumRPC for MinerEthereumRPC

{ let (valid, transaction) = { let stateful = state.stateful(); let transaction = to_signed_transaction(&state, transaction, &stateful)?; - let valid = stateful.to_valid::

(transaction.clone())?; + let valid = stateful.to_valid::

(&transaction.clone())?; (valid, transaction) }; @@ -324,7 +324,7 @@ impl EthereumRPC for MinerEthereumRPC

{ { let stateful = state.stateful(); - stateful.to_valid::

(transaction.clone())?; + stateful.to_valid::

(&transaction.clone())?; } let hash = state.append_pending_transaction(transaction); @@ -343,7 +343,7 @@ impl EthereumRPC for MinerEthereumRPC

{ let block = state.get_block_by_number(block); let vm: SeqTransactionVM

= stateful.call( - valid, HeaderParams::from(&block.header), + valid, &HeaderParams::from(&block.header), &state.get_last_256_block_hashes()); Ok(Bytes(vm.out().into())) @@ -360,7 +360,7 @@ impl EthereumRPC for MinerEthereumRPC

{ let block = state.get_block_by_number(block); let vm: SeqTransactionVM

= stateful.call( - valid, HeaderParams::from(&block.header), + valid, &HeaderParams::from(&block.header), &state.get_last_256_block_hashes()); Ok(Hex(vm.used_gas())) @@ -600,9 +600,9 @@ impl DebugRPC for MinerDebugRPC

{ let mut stateful: MemoryStateful<'static> = state.stateful_at(last_block.header.state_root); for other_transaction in &block.transactions { if other_transaction != &transaction { - let valid = stateful.to_valid::

(transaction.clone())?; + let valid = stateful.to_valid::

(&transaction.clone())?; let _: SeqTransactionVM

= - stateful.execute::<_, P>(valid, HeaderParams::from(&block.header), &last_hashes); + stateful.execute::<_, P>(valid, &HeaderParams::from(&block.header), &last_hashes); } else { break; } diff --git a/src/rpc/util.rs b/src/rpc/util.rs index 7d0a4f6..3304605 100644 --- a/src/rpc/util.rs +++ b/src/rpc/util.rs @@ -359,7 +359,7 @@ pub fn replay_transaction( stateful: &MemoryStateful<'static>, transaction: Transaction, block: &Block, last_hashes: &[H256], config: &RPCTraceConfig ) -> Result<(Vec, SeqTransactionVM

), Error> { - let valid = stateful.to_valid::

(transaction)?; + let valid = stateful.to_valid::

(&transaction)?; let mut vm = SeqTransactionVM::

::new(valid, HeaderParams::from(&block.header)); let mut steps = Vec::new(); let mut last_gas = Gas::zero();