@@ -4,6 +4,7 @@ use cfx_execute_helper::{
44} ;
55use cfx_rpc_cfx_types:: PhantomBlock ;
66use cfx_types:: { Bloom , Space , H256 , U256 } ;
7+ use cfxcore_errors:: ProviderBlockError ;
78use primitives:: { receipt:: Receipt , EpochNumber , TransactionStatus } ;
89use std:: sync:: Arc ;
910
@@ -12,7 +13,7 @@ use super::super::ConsensusGraph;
1213impl ConsensusGraph {
1314 pub fn get_phantom_block_bloom_filter (
1415 & self , block_num : EpochNumber , pivot_assumption : H256 ,
15- ) -> Result < Option < Bloom > , String > {
16+ ) -> Result < Option < Bloom > , ProviderBlockError > {
1617 let hashes = self . get_block_hashes_by_epoch ( block_num) ?;
1718
1819 // sanity check: epoch is not empty
@@ -66,7 +67,7 @@ impl ConsensusGraph {
6667 pub fn get_phantom_block_pivot_by_number (
6768 & self , block_num : EpochNumber , pivot_assumption : Option < H256 > ,
6869 include_traces : bool ,
69- ) -> Result < Option < PhantomBlock > , String > {
70+ ) -> Result < Option < PhantomBlock > , ProviderBlockError > {
7071 self . get_phantom_block_by_number_inner (
7172 block_num,
7273 pivot_assumption,
@@ -78,7 +79,7 @@ impl ConsensusGraph {
7879 pub fn get_phantom_block_by_number (
7980 & self , block_num : EpochNumber , pivot_assumption : Option < H256 > ,
8081 include_traces : bool ,
81- ) -> Result < Option < PhantomBlock > , String > {
82+ ) -> Result < Option < PhantomBlock > , ProviderBlockError > {
8283 self . get_phantom_block_by_number_inner (
8384 block_num,
8485 pivot_assumption,
@@ -90,7 +91,7 @@ impl ConsensusGraph {
9091 fn get_phantom_block_by_number_inner (
9192 & self , block_num : EpochNumber , pivot_assumption : Option < H256 > ,
9293 include_traces : bool , only_pivot : bool ,
93- ) -> Result < Option < PhantomBlock > , String > {
94+ ) -> Result < Option < PhantomBlock > , ProviderBlockError > {
9495 let hashes = self . get_block_hashes_by_epoch ( block_num) ?;
9596
9697 // special handling for genesis block
@@ -297,7 +298,7 @@ impl ConsensusGraph {
297298
298299 pub fn get_phantom_block_by_hash (
299300 & self , hash : & H256 , include_traces : bool ,
300- ) -> Result < Option < PhantomBlock > , String > {
301+ ) -> Result < Option < PhantomBlock > , ProviderBlockError > {
301302 let epoch_num = match self . get_block_epoch_number ( hash) {
302303 None => return Ok ( None ) ,
303304 Some ( n) => n,
0 commit comments