@@ -102,6 +102,7 @@ pub struct SolvableOrdersCache {
102102 native_price_timeout : Duration ,
103103 settlement_contract : H160 ,
104104 disable_order_filters : bool ,
105+ force_presign_order_filtering : bool ,
105106}
106107
107108type Balances = HashMap < Query , U256 > ;
@@ -128,6 +129,7 @@ impl SolvableOrdersCache {
128129 native_price_timeout : Duration ,
129130 settlement_contract : H160 ,
130131 disable_order_filters : bool ,
132+ force_presign_order_filtering : bool ,
131133 ) -> Arc < Self > {
132134 Arc :: new ( Self {
133135 min_order_validity_period,
@@ -146,6 +148,7 @@ impl SolvableOrdersCache {
146148 native_price_timeout,
147149 settlement_contract,
148150 disable_order_filters,
151+ force_presign_order_filtering,
149152 } )
150153 }
151154
@@ -230,7 +233,7 @@ impl SolvableOrdersCache {
230233 . timed_future (
231234 "weth_price_fetch" ,
232235 self . native_price_estimator
233- . estimate_native_price ( self . weth , Default :: default ( ) ) ,
236+ . estimate_native_price ( self . weth . into_alloy ( ) , Default :: default ( ) ) ,
234237 )
235238 . await
236239 . expect ( "weth price fetching can never fail" ) ;
@@ -390,7 +393,7 @@ impl SolvableOrdersCache {
390393 invalid_order_uids : & mut HashSet < OrderUid > ,
391394 ) -> Vec < Order > {
392395 let filter_invalid_signatures = async {
393- if self . disable_order_filters {
396+ if self . disable_order_filters && ! self . force_presign_order_filtering {
394397 return Default :: default ( ) ;
395398 }
396399 find_invalid_signature_orders ( & orders, self . signature_validator . as_ref ( ) ) . await
@@ -924,17 +927,17 @@ mod tests {
924927 let mut native_price_estimator = MockNativePriceEstimating :: new ( ) ;
925928 native_price_estimator
926929 . expect_estimate_native_price ( )
927- . withf ( move |token, _| * token == token1)
930+ . withf ( move |token, _| * token == token1. into_alloy ( ) )
928931 . returning ( |_, _| async { Ok ( 2. ) } . boxed ( ) ) ;
929932 native_price_estimator
930933 . expect_estimate_native_price ( )
931934 . times ( 1 )
932- . withf ( move |token, _| * token == token2)
935+ . withf ( move |token, _| * token == token2. into_alloy ( ) )
933936 . returning ( |_, _| async { Err ( PriceEstimationError :: NoLiquidity ) } . boxed ( ) ) ;
934937 native_price_estimator
935938 . expect_estimate_native_price ( )
936939 . times ( 1 )
937- . withf ( move |token, _| * token == token3)
940+ . withf ( move |token, _| * token == token3. into_alloy ( ) )
938941 . returning ( |_, _| async { Ok ( 0.25 ) } . boxed ( ) ) ;
939942
940943 let native_price_estimator = CachingNativePriceEstimator :: new (
@@ -1005,27 +1008,27 @@ mod tests {
10051008 let mut native_price_estimator = MockNativePriceEstimating :: new ( ) ;
10061009 native_price_estimator
10071010 . expect_estimate_native_price ( )
1008- . withf ( move |token, _| * token == token1)
1011+ . withf ( move |token, _| * token == token1. into_alloy ( ) )
10091012 . returning ( |_, _| async { Ok ( 2. ) } . boxed ( ) ) ;
10101013 native_price_estimator
10111014 . expect_estimate_native_price ( )
10121015 . times ( 1 )
1013- . withf ( move |token, _| * token == token2)
1016+ . withf ( move |token, _| * token == token2. into_alloy ( ) )
10141017 . returning ( |_, _| async { Err ( PriceEstimationError :: NoLiquidity ) } . boxed ( ) ) ;
10151018 native_price_estimator
10161019 . expect_estimate_native_price ( )
10171020 . times ( 1 )
1018- . withf ( move |token, _| * token == token3)
1021+ . withf ( move |token, _| * token == token3. into_alloy ( ) )
10191022 . returning ( |_, _| async { Ok ( 0.25 ) } . boxed ( ) ) ;
10201023 native_price_estimator
10211024 . expect_estimate_native_price ( )
10221025 . times ( 1 )
1023- . withf ( move |token, _| * token == token4)
1026+ . withf ( move |token, _| * token == token4. into_alloy ( ) )
10241027 . returning ( |_, _| async { Ok ( 0. ) } . boxed ( ) ) ;
10251028 native_price_estimator
10261029 . expect_estimate_native_price ( )
10271030 . times ( 1 )
1028- . withf ( move |token, _| * token == token5)
1031+ . withf ( move |token, _| * token == token5. into_alloy ( ) )
10291032 . returning ( |_, _| async { Ok ( 5. ) } . boxed ( ) ) ;
10301033
10311034 let native_price_estimator = CachingNativePriceEstimator :: new (
@@ -1112,17 +1115,17 @@ mod tests {
11121115 native_price_estimator
11131116 . expect_estimate_native_price ( )
11141117 . times ( 1 )
1115- . withf ( move |token, _| * token == token3)
1118+ . withf ( move |token, _| * token == token3. into_alloy ( ) )
11161119 . returning ( |_, _| async { Ok ( 3. ) } . boxed ( ) ) ;
11171120 native_price_estimator
11181121 . expect_estimate_native_price ( )
11191122 . times ( 1 )
1120- . withf ( move |token, _| * token == token_approx1)
1123+ . withf ( move |token, _| * token == token_approx1. into_alloy ( ) )
11211124 . returning ( |_, _| async { Ok ( 40. ) } . boxed ( ) ) ;
11221125 native_price_estimator
11231126 . expect_estimate_native_price ( )
11241127 . times ( 1 )
1125- . withf ( move |token, _| * token == token_approx2)
1128+ . withf ( move |token, _| * token == token_approx2. into_alloy ( ) )
11261129 . returning ( |_, _| async { Ok ( 50. ) } . boxed ( ) ) ;
11271130
11281131 let native_price_estimator = CachingNativePriceEstimator :: new (
0 commit comments