@@ -18,7 +18,6 @@ fn certificate_pending(
18
18
warp:: path!( "certificate-pending" )
19
19
. and ( warp:: get ( ) )
20
20
. and ( middlewares:: with_config ( dependency_manager. clone ( ) ) )
21
- . and ( middlewares:: with_ticker_service ( dependency_manager. clone ( ) ) )
22
21
. and ( middlewares:: with_certificate_pending_store (
23
22
dependency_manager,
24
23
) )
@@ -51,7 +50,6 @@ mod handlers {
51
50
CertificatePendingStore , Configuration , ToCertificatePendingMessageAdapter ,
52
51
} ;
53
52
54
- use mithril_common:: TickerService ;
55
53
use slog_scope:: { debug, warn} ;
56
54
use std:: convert:: Infallible ;
57
55
use std:: sync:: Arc ;
@@ -62,25 +60,16 @@ mod handlers {
62
60
/// Certificate Pending
63
61
pub async fn certificate_pending (
64
62
config : Configuration ,
65
- ticker_service : Arc < dyn TickerService > ,
66
63
certificate_pending_store : Arc < CertificatePendingStore > ,
67
64
) -> Result < impl warp:: Reply , Infallible > {
68
65
debug ! ( "⇄ HTTP SERVER: certificate_pending" ) ;
69
66
70
67
let network =
71
68
unwrap_to_internal_server_error ! ( config. get_network( ) , "certificate_pending::error" ) ;
72
- let time_point = unwrap_to_internal_server_error ! (
73
- ticker_service. get_current_time_point( ) . await ,
74
- "certificate_pending::error"
75
- ) ;
76
69
77
70
match certificate_pending_store. get ( ) . await {
78
71
Ok ( Some ( certificate_pending) ) => Ok ( reply:: json (
79
- & ToCertificatePendingMessageAdapter :: adapt (
80
- certificate_pending,
81
- network,
82
- time_point. immutable_file_number ,
83
- ) ,
72
+ & ToCertificatePendingMessageAdapter :: adapt ( certificate_pending, network, 0 ) ,
84
73
StatusCode :: OK ,
85
74
) ) ,
86
75
Ok ( None ) => Ok ( reply:: empty ( StatusCode :: NO_CONTENT ) ) ,
@@ -138,6 +127,7 @@ mod tests {
138
127
use anyhow:: anyhow;
139
128
use mithril_common:: {
140
129
entities:: CertificatePending ,
130
+ messages:: CertificatePendingMessage ,
141
131
test_utils:: { apispec:: APISpec , fake_data} ,
142
132
} ;
143
133
use mithril_persistence:: store:: adapter:: DumbStoreAdapter ;
@@ -202,6 +192,12 @@ mod tests {
202
192
& StatusCode :: OK ,
203
193
)
204
194
. unwrap ( ) ;
195
+
196
+ let message: CertificatePendingMessage = serde_json:: from_slice ( response. body ( ) ) . unwrap ( ) ;
197
+
198
+ #[ allow( deprecated) ]
199
+ let immutable_file_number = message. beacon . immutable_file_number ;
200
+ assert_eq ! ( 0 , immutable_file_number) ;
205
201
}
206
202
207
203
#[ tokio:: test]
0 commit comments