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

Commit 0681346

Browse files
committed
fixed #855
1 parent d681b96 commit 0681346

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ethcore/src/client/client.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ use service::{NetSyncMessage, SyncMessage};
3030
use env_info::LastHashes;
3131
use verification::*;
3232
use block::*;
33-
use transaction::{LocalizedTransaction, SignedTransaction};
33+
use transaction::{LocalizedTransaction, SignedTransaction, Action};
3434
use extras::TransactionAddress;
3535
use filter::Filter;
3636
use log_entry::LocalizedLogEntry;
3737
use block_queue::{BlockQueue, BlockQueueInfo};
3838
use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute};
3939
use client::{BlockId, TransactionId, UncleId, ClientConfig, BlockChainClient};
4040
use env_info::EnvInfo;
41-
use executive::{Executive, Executed};
41+
use executive::{Executive, Executed, contract_address};
4242
use receipt::LocalizedReceipt;
4343
pub use blockchain::CacheSize as BlockChainCacheSize;
4444

@@ -577,8 +577,10 @@ impl<V> BlockChainClient for Client<V> where V: Verifier {
577577
// TODO: to fix this, query all previous transaction receipts and retrieve their gas usage
578578
cumulative_gas_used: receipt.gas_used,
579579
gas_used: receipt.gas_used,
580-
// TODO: to fix this, store created contract address in db
581-
contract_address: None,
580+
contract_address: match tx.action {
581+
Action::Call(_) => None,
582+
Action::Create => Some(contract_address(&tx.sender().unwrap(), &tx.nonce))
583+
},
582584
logs: receipt.logs.into_iter().enumerate().map(|(i, log)| LocalizedLogEntry {
583585
entry: log,
584586
block_hash: block_hash.clone(),

0 commit comments

Comments
 (0)