@@ -10,6 +10,25 @@ pub fn filter(
1010 let with_context = warp:: any ( ) . map ( move || context. clone ( ) ) ;
1111 let root = warp:: path!( "v0" / ..) ;
1212
13+ #[ cfg( feature = "evm" ) ]
14+ let address_mapping = {
15+ let root = warp:: path!( "address_mapping" / ..) ;
16+
17+ let get_jor_address = warp:: path!( "jormungandr_address" / String )
18+ . and ( warp:: get ( ) )
19+ . and ( with_context. clone ( ) )
20+ . and_then ( handlers:: get_jor_address)
21+ . boxed ( ) ;
22+
23+ let get_evm_address = warp:: path!( "evm_address" / String )
24+ . and ( warp:: get ( ) )
25+ . and ( with_context. clone ( ) )
26+ . and_then ( handlers:: get_evm_address)
27+ . boxed ( ) ;
28+
29+ root. and ( get_jor_address. or ( get_evm_address) ) . boxed ( )
30+ } ;
31+
1332 let shutdown = warp:: path!( "shutdown" )
1433 . and ( warp:: get ( ) . or ( warp:: post ( ) ) )
1534 . and ( with_context. clone ( ) )
@@ -221,31 +240,12 @@ pub fn filter(
221240
222241 let vote_plans = warp:: path!( "plans" )
223242 . and ( warp:: get ( ) )
224- . and ( with_context. clone ( ) )
243+ . and ( with_context)
225244 . and_then ( handlers:: get_active_vote_plans)
226245 . boxed ( ) ;
227246 root. and ( committees. or ( vote_plans) ) . boxed ( )
228247 } ;
229248
230- #[ cfg( feature = "evm" ) ]
231- let address_mapping = {
232- let root = warp:: path!( "address_mapping" / ..) ;
233-
234- let get_jor_address = warp:: path!( "jormungandr_address" / String )
235- . and ( warp:: get ( ) )
236- . and ( with_context. clone ( ) )
237- . and_then ( handlers:: get_jor_address)
238- . boxed ( ) ;
239-
240- let get_evm_address = warp:: path!( "evm_address" / String )
241- . and ( warp:: get ( ) )
242- . and ( with_context)
243- . and_then ( handlers:: get_evm_address)
244- . boxed ( ) ;
245-
246- root. and ( get_jor_address. or ( get_evm_address) ) . boxed ( )
247- } ;
248-
249249 let routes = shutdown
250250 . or ( account)
251251 . or ( block)
0 commit comments