@@ -6,10 +6,6 @@ use jsonrpsee::{
6
6
http_client:: { HttpClient , HttpClientBuilder } ,
7
7
rpc_params,
8
8
} ;
9
- use sov_ledger_rpc:: client:: RpcClient ;
10
- use sov_rollup_interface:: rpc:: {
11
- SequencerCommitmentResponse , SoftConfirmationResponse , VerifiedBatchProofResponse ,
12
- } ;
13
9
use tokio:: time:: sleep;
14
10
use tracing:: trace;
15
11
@@ -51,59 +47,19 @@ impl Client {
51
47
. await ?)
52
48
}
53
49
54
- pub async fn ledger_get_head_soft_confirmation (
55
- & self ,
56
- ) -> Result < Option < SoftConfirmationResponse > > {
57
- Ok ( self . client . get_head_soft_confirmation ( ) . await ?)
58
- }
59
-
60
- pub async fn ledger_get_verified_batch_proofs_by_slot_height (
61
- & self ,
62
- height : u64 ,
63
- ) -> Result < Option < Vec < VerifiedBatchProofResponse > > > {
64
- Ok ( self
65
- . client
66
- . get_verified_batch_proofs_by_slot_height ( height)
67
- . await ?)
68
- }
69
-
70
- pub async fn ledger_get_sequencer_commitments_on_slot_by_number (
71
- & self ,
72
- height : u64 ,
73
- ) -> Result < Option < Vec < SequencerCommitmentResponse > > > {
50
+ pub async fn ledger_get_head_soft_confirmation_height ( & self ) -> Result < u64 > {
74
51
Ok ( self
75
52
. client
76
- . get_sequencer_commitments_on_slot_by_number ( height )
53
+ . request ( "ledger_getHeadSoftConfirmationHeight" , rpc_params ! [ ] )
77
54
. await ?)
78
55
}
79
56
80
- pub async fn ledger_get_soft_confirmation_by_number (
81
- & self ,
82
- num : u64 ,
83
- ) -> Result < Option < SoftConfirmationResponse > > {
84
- Ok ( self . client . get_soft_confirmation_by_number ( num) . await ?)
85
- }
86
-
87
- pub async fn ledger_get_sequencer_commitments_on_slot_by_hash (
88
- & self ,
89
- hash : [ u8 ; 32 ] ,
90
- ) -> Result < Option < Vec < SequencerCommitmentResponse > > > {
91
- self . client
92
- . get_sequencer_commitments_on_slot_by_hash ( hash)
93
- . await
94
- . map_err ( Into :: into)
95
- }
96
-
97
- pub async fn ledger_get_head_soft_confirmation_height ( & self ) -> Result < u64 > {
98
- Ok ( self . client . get_head_soft_confirmation_height ( ) . await ?)
99
- }
100
-
101
57
pub async fn wait_for_l2_block ( & self , num : u64 , timeout : Option < Duration > ) -> Result < ( ) > {
102
58
let start = SystemTime :: now ( ) ;
103
59
let timeout = timeout. unwrap_or ( Duration :: from_secs ( 30 ) ) ; // Default 30 seconds timeout
104
60
loop {
105
61
trace ! ( "Waiting for soft confirmation {}" , num) ;
106
- let latest_block = self . client . get_head_soft_confirmation_height ( ) . await ?;
62
+ let latest_block = self . ledger_get_head_soft_confirmation_height ( ) . await ?;
107
63
108
64
if latest_block >= num {
109
65
break ;
0 commit comments