@@ -58,19 +58,19 @@ use crate::types::{BlockId, BlockStatus, TransactionId, VerificationQueueInfo as
5858const MAX_MEM_POOL_SIZE : usize = 4096 ;
5959
6060pub struct Client {
61- engine : Arc < CodeChainEngine > ,
61+ engine : Arc < dyn CodeChainEngine > ,
6262
6363 io_channel : Mutex < IoChannel < ClientIoMessage > > ,
6464
6565 chain : RwLock < BlockChain > ,
6666
6767 /// Client uses this to store blocks, traces, etc.
68- db : Arc < KeyValueDB > ,
68+ db : Arc < dyn KeyValueDB > ,
6969
7070 state_db : RwLock < StateDB > ,
7171
7272 /// List of actors to be notified on certain chain events
73- notify : RwLock < Vec < Weak < ChainNotify > > > ,
73+ notify : RwLock < Vec < Weak < dyn ChainNotify > > > ,
7474
7575 /// Count of pending transactions in the queue
7676 queue_transactions : AtomicUsize ,
@@ -87,7 +87,7 @@ impl Client {
8787 pub fn try_new (
8888 config : & ClientConfig ,
8989 scheme : & Scheme ,
90- db : Arc < KeyValueDB > ,
90+ db : Arc < dyn KeyValueDB > ,
9191 miner : Arc < Miner > ,
9292 message_channel : IoChannel < ClientIoMessage > ,
9393 reseal_timer : TimerApi ,
@@ -133,12 +133,12 @@ impl Client {
133133 }
134134
135135 /// Returns engine reference.
136- pub fn engine ( & self ) -> & CodeChainEngine {
136+ pub fn engine ( & self ) -> & dyn CodeChainEngine {
137137 & * self . engine
138138 }
139139
140140 /// Adds an actor to be notified on certain events
141- pub fn add_notify ( & self , target : Weak < ChainNotify > ) {
141+ pub fn add_notify ( & self , target : Weak < dyn ChainNotify > ) {
142142 self . notify . write ( ) . push ( target) ;
143143 }
144144
@@ -194,7 +194,7 @@ impl Client {
194194
195195 fn notify < F > ( & self , f : F )
196196 where
197- F : Fn ( & ChainNotify ) , {
197+ F : Fn ( & dyn ChainNotify ) , {
198198 for np in self . notify . read ( ) . iter ( ) {
199199 if let Some ( n) = np. upgrade ( ) {
200200 f ( & * n) ;
@@ -305,7 +305,7 @@ impl Client {
305305 }
306306 }
307307
308- fn state_info ( & self , state : StateOrBlock ) -> Option < Box < TopStateView > > {
308+ fn state_info ( & self , state : StateOrBlock ) -> Option < Box < dyn TopStateView > > {
309309 Some ( match state {
310310 StateOrBlock :: State ( state) => state,
311311 StateOrBlock :: Block ( id) => Box :: new ( self . state_at ( id) ?) ,
@@ -320,7 +320,7 @@ impl Client {
320320 self . chain . read ( )
321321 }
322322
323- pub fn db ( & self ) -> & Arc < KeyValueDB > {
323+ pub fn db ( & self ) -> & Arc < dyn KeyValueDB > {
324324 & self . db
325325 }
326326}
@@ -352,7 +352,7 @@ impl TimeoutHandler for Client {
352352}
353353
354354impl DatabaseClient for Client {
355- fn database ( & self ) -> Arc < KeyValueDB > {
355+ fn database ( & self ) -> Arc < dyn KeyValueDB > {
356356 Arc :: clone ( & self . db ( ) )
357357 }
358358}
@@ -440,7 +440,7 @@ impl ExecuteClient for Client {
440440
441441 fn execute_vm (
442442 & self ,
443- tx : & PartialHashing ,
443+ tx : & dyn PartialHashing ,
444444 inputs : & [ AssetTransferInput ] ,
445445 params : & [ Vec < Bytes > ] ,
446446 indices : & [ usize ] ,
@@ -581,7 +581,7 @@ impl EngineClient for Client {
581581 }
582582 }
583583
584- fn get_kvdb ( & self ) -> Arc < KeyValueDB > {
584+ fn get_kvdb ( & self ) -> Arc < dyn KeyValueDB > {
585585 self . db . clone ( )
586586 }
587587}
@@ -905,7 +905,7 @@ impl ChainTimeInfo for Client {
905905}
906906
907907impl FindActionHandler for Client {
908- fn find_action_handler_for ( & self , id : u64 ) -> Option < & ActionHandler > {
908+ fn find_action_handler_for ( & self , id : u64 ) -> Option < & dyn ActionHandler > {
909909 self . engine . find_action_handler_for ( id)
910910 }
911911}
0 commit comments