@@ -248,11 +248,11 @@ mod tests {
248248 PriceEstimating ,
249249 Query ,
250250 } ,
251+ alloy:: primitives:: Address ,
251252 anyhow:: anyhow,
252253 futures:: channel:: oneshot:: channel,
253254 model:: order:: OrderKind ,
254255 number:: nonzero:: U256 as NonZeroU256 ,
255- primitive_types:: H160 ,
256256 std:: time:: Duration ,
257257 tokio:: time:: sleep,
258258 } ;
@@ -262,44 +262,44 @@ mod tests {
262262 let queries = [
263263 Arc :: new ( Query {
264264 verification : Default :: default ( ) ,
265- sell_token : H160 :: from_low_u64_le ( 0 ) ,
266- buy_token : H160 :: from_low_u64_le ( 1 ) ,
265+ sell_token : Address :: with_last_byte ( 0 ) ,
266+ buy_token : Address :: with_last_byte ( 1 ) ,
267267 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
268268 kind : OrderKind :: Buy ,
269269 block_dependent : false ,
270270 timeout : HEALTHY_PRICE_ESTIMATION_TIME ,
271271 } ) ,
272272 Arc :: new ( Query {
273273 verification : Default :: default ( ) ,
274- sell_token : H160 :: from_low_u64_le ( 2 ) ,
275- buy_token : H160 :: from_low_u64_le ( 3 ) ,
274+ sell_token : Address :: with_last_byte ( 2 ) ,
275+ buy_token : Address :: with_last_byte ( 3 ) ,
276276 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
277277 kind : OrderKind :: Sell ,
278278 block_dependent : false ,
279279 timeout : HEALTHY_PRICE_ESTIMATION_TIME ,
280280 } ) ,
281281 Arc :: new ( Query {
282282 verification : Default :: default ( ) ,
283- sell_token : H160 :: from_low_u64_le ( 2 ) ,
284- buy_token : H160 :: from_low_u64_le ( 3 ) ,
283+ sell_token : Address :: with_last_byte ( 2 ) ,
284+ buy_token : Address :: with_last_byte ( 3 ) ,
285285 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
286286 kind : OrderKind :: Buy ,
287287 block_dependent : false ,
288288 timeout : HEALTHY_PRICE_ESTIMATION_TIME ,
289289 } ) ,
290290 Arc :: new ( Query {
291291 verification : Default :: default ( ) ,
292- sell_token : H160 :: from_low_u64_le ( 3 ) ,
293- buy_token : H160 :: from_low_u64_le ( 4 ) ,
292+ sell_token : Address :: with_last_byte ( 3 ) ,
293+ buy_token : Address :: with_last_byte ( 4 ) ,
294294 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
295295 kind : OrderKind :: Buy ,
296296 block_dependent : false ,
297297 timeout : HEALTHY_PRICE_ESTIMATION_TIME ,
298298 } ) ,
299299 Arc :: new ( Query {
300300 verification : Default :: default ( ) ,
301- sell_token : H160 :: from_low_u64_le ( 5 ) ,
302- buy_token : H160 :: from_low_u64_le ( 6 ) ,
301+ sell_token : Address :: with_last_byte ( 5 ) ,
302+ buy_token : Address :: with_last_byte ( 6 ) ,
303303 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
304304 kind : OrderKind :: Buy ,
305305 block_dependent : false ,
@@ -344,7 +344,7 @@ mod tests {
344344 Ok ( estimates[ 1 ] . clone( ) ) ,
345345 Err ( PriceEstimationError :: ProtocolInternal ( anyhow!( "b" ) ) ) ,
346346 Err ( PriceEstimationError :: UnsupportedToken {
347- token: H160 ( [ 0 ; 20 ] ) ,
347+ token: Address :: new ( [ 0 ; 20 ] ) ,
348348 reason: "" . to_string( ) ,
349349 } ) ,
350350 ] ) ;
@@ -388,8 +388,8 @@ mod tests {
388388 async fn racing_estimator_returns_early ( ) {
389389 let query = Arc :: new ( Query {
390390 verification : Default :: default ( ) ,
391- sell_token : H160 :: from_low_u64_le ( 0 ) ,
392- buy_token : H160 :: from_low_u64_le ( 1 ) ,
391+ sell_token : Address :: with_last_byte ( 0 ) ,
392+ buy_token : Address :: with_last_byte ( 1 ) ,
393393 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
394394 kind : OrderKind :: Buy ,
395395 block_dependent : false ,
@@ -449,8 +449,8 @@ mod tests {
449449 async fn queries_stages_sequentially ( ) {
450450 let query = Arc :: new ( Query {
451451 verification : Default :: default ( ) ,
452- sell_token : H160 :: from_low_u64_le ( 0 ) ,
453- buy_token : H160 :: from_low_u64_le ( 1 ) ,
452+ sell_token : Address :: with_last_byte ( 0 ) ,
453+ buy_token : Address :: with_last_byte ( 1 ) ,
454454 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
455455 kind : OrderKind :: Sell ,
456456 block_dependent : false ,
@@ -526,8 +526,8 @@ mod tests {
526526 async fn combines_stages_if_threshold_bigger_than_next_stage_length ( ) {
527527 let query = Arc :: new ( Query {
528528 verification : Default :: default ( ) ,
529- sell_token : H160 :: from_low_u64_le ( 0 ) ,
530- buy_token : H160 :: from_low_u64_le ( 1 ) ,
529+ sell_token : Address :: with_last_byte ( 0 ) ,
530+ buy_token : Address :: with_last_byte ( 1 ) ,
531531 in_amount : NonZeroU256 :: try_from ( 1 ) . unwrap ( ) ,
532532 kind : OrderKind :: Sell ,
533533 block_dependent : false ,
0 commit comments