@@ -13,7 +13,7 @@ pub fn routes(
1313fn protocol_configuration (
1414 router_state : & RouterState ,
1515) -> impl Filter < Extract = ( impl warp:: Reply + use < > , ) , Error = warp:: Rejection > + Clone + use < > {
16- warp:: path!( "protocol-configuration" / String )
16+ warp:: path!( "protocol-configuration" / u64 )
1717 . and ( warp:: get ( ) )
1818 . and ( middlewares:: with_logger ( router_state) )
1919 . and ( middlewares:: with_http_message_service ( router_state) )
@@ -34,21 +34,12 @@ mod handlers {
3434
3535 /// Protocol Configuration
3636 pub async fn protocol_configuration (
37- epoch : String ,
37+ epoch : u64 ,
3838 logger : Logger ,
3939 http_message_service : Arc < dyn MessageService > ,
4040 allowed_discriminants : BTreeSet < SignedEntityTypeDiscriminants > ,
4141 ) -> Result < impl warp:: Reply , Infallible > {
42- let epoch = match epoch. parse :: < u64 > ( ) {
43- Ok ( epoch) => Epoch ( epoch) ,
44- Err ( err) => {
45- warn ! ( logger, "protocol_configuration::invalid_epoch" ; "error" => ?err) ;
46- return Ok ( reply:: bad_request (
47- "invalid_epoch" . to_string ( ) ,
48- err. to_string ( ) ,
49- ) ) ;
50- }
51- } ;
42+ let epoch = Epoch ( epoch) ;
5243
5344 let protocol_configuration_message = http_message_service
5445 . get_protocol_configuration_message ( epoch, allowed_discriminants)
0 commit comments