@@ -3,9 +3,7 @@ use ethers_core::types::BlockNumber;
3
3
use ethers_core:: types:: H256 ;
4
4
use ethers_providers:: { Http , Provider } ;
5
5
use prover_darwin_v2:: BlockTrace ;
6
- use serde:: { de:: DeserializeOwned , Serialize } ;
7
6
use std:: cmp:: Ordering ;
8
- use std:: fmt:: Debug ;
9
7
10
8
pub type CommonHash = H256 ;
11
9
@@ -19,10 +17,7 @@ impl L2gethClient {
19
17
Ok ( Self { provider } )
20
18
}
21
19
22
- pub async fn get_block_trace_by_hash < T > ( & self , hash : & CommonHash ) -> anyhow:: Result < T >
23
- where
24
- T : Serialize + DeserializeOwned + Debug + Send ,
25
- {
20
+ pub async fn get_block_trace_by_hash ( & self , hash : & CommonHash ) -> anyhow:: Result < String > {
26
21
log:: info!(
27
22
"l2geth_client calling get_block_trace_by_hash, hash: {:#?}" ,
28
23
hash
@@ -45,7 +40,7 @@ impl L2gethClient {
45
40
pub async fn get_sorted_traces_by_hashes (
46
41
& self ,
47
42
block_hashes : & [ CommonHash ] ,
48
- ) -> anyhow:: Result < Vec < BlockTrace > > {
43
+ ) -> anyhow:: Result < Vec < String > > {
49
44
if block_hashes. is_empty ( ) {
50
45
log:: error!( "failed to get sorted traces: block_hashes are empty" ) ;
51
46
anyhow:: bail!( "block_hashes are empty" )
@@ -94,6 +89,7 @@ impl L2gethClient {
94
89
}
95
90
}
96
91
97
- fn get_block_number_from_trace ( block_trace : & BlockTrace ) -> Option < u64 > {
92
+ fn get_block_number_from_trace ( block_trace : & String ) -> Option < u64 > {
93
+ let block_trace: BlockTrace = serde_json:: from_str ( block_trace) . unwrap ( ) ;
98
94
block_trace. header . number . map ( |n| n. as_u64 ( ) )
99
95
}
0 commit comments