@@ -18,7 +18,8 @@ use std::sync::Arc;
1818
1919use ccore:: {
2020 Asset , AssetAddress , AssetScheme , AssetSchemeAddress , Balance , BlockChainClient , BlockId , BlockInfo , BlockNumber ,
21- ChainInfo , Client , Invoice , Miner , MinerService , Nonce , ParcelInvoice , RegularKey , SignedParcel , TopStateInfo ,
21+ BlockNumberAndHash , ChainInfo , Client , Invoice , Miner , MinerService , Nonce , ParcelInvoice , RegularKey ,
22+ SignedParcel , TopStateInfo ,
2223} ;
2324use ctypes:: { H160 , H256 , Public , U256 } ;
2425use rlp:: UntrustedRlp ;
@@ -110,6 +111,13 @@ impl Chain for ChainClient {
110111 Ok ( self . client . chain_info ( ) . best_block_number )
111112 }
112113
114+ fn get_best_block_id ( & self ) -> Result < BlockNumberAndHash > {
115+ Ok ( BlockNumberAndHash {
116+ number : self . client . chain_info ( ) . best_block_number ,
117+ hash : self . client . chain_info ( ) . best_block_hash ,
118+ } )
119+ }
120+
113121 fn get_block_hash ( & self , block_number : u64 ) -> Result < Option < H256 > > {
114122 Ok ( self . client . block_hash ( BlockId :: Number ( block_number) ) )
115123 }
0 commit comments