@@ -30,15 +30,15 @@ use service::{NetSyncMessage, SyncMessage};
30
30
use env_info:: LastHashes ;
31
31
use verification:: * ;
32
32
use block:: * ;
33
- use transaction:: { LocalizedTransaction , SignedTransaction } ;
33
+ use transaction:: { LocalizedTransaction , SignedTransaction , Action } ;
34
34
use extras:: TransactionAddress ;
35
35
use filter:: Filter ;
36
36
use log_entry:: LocalizedLogEntry ;
37
37
use block_queue:: { BlockQueue , BlockQueueInfo } ;
38
38
use blockchain:: { BlockChain , BlockProvider , TreeRoute , ImportRoute } ;
39
39
use client:: { BlockId , TransactionId , UncleId , ClientConfig , BlockChainClient } ;
40
40
use env_info:: EnvInfo ;
41
- use executive:: { Executive , Executed } ;
41
+ use executive:: { Executive , Executed , contract_address } ;
42
42
use receipt:: LocalizedReceipt ;
43
43
pub use blockchain:: CacheSize as BlockChainCacheSize ;
44
44
@@ -577,8 +577,10 @@ impl<V> BlockChainClient for Client<V> where V: Verifier {
577
577
// TODO: to fix this, query all previous transaction receipts and retrieve their gas usage
578
578
cumulative_gas_used : receipt. gas_used ,
579
579
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
+ } ,
582
584
logs : receipt. logs . into_iter ( ) . enumerate ( ) . map ( |( i, log) | LocalizedLogEntry {
583
585
entry : log,
584
586
block_hash : block_hash. clone ( ) ,
0 commit comments