@@ -499,9 +499,11 @@ where
499499 gas_amount : quote. data . fee_parameters . gas_amount ,
500500 gas_price : quote. data . fee_parameters . gas_price ,
501501 sell_token_price : quote. data . fee_parameters . sell_token_price ,
502- sell_amount : u256_to_big_decimal ( & quote. sell_amount ) ,
503- buy_amount : u256_to_big_decimal ( & quote. buy_amount ) ,
504- solver : ByteArray ( quote. data . solver . 0 ) ,
502+ sell_amount : number:: conversions:: alloy:: u256_to_big_decimal (
503+ & quote. sell_amount ,
504+ ) ,
505+ buy_amount : number:: conversions:: alloy:: u256_to_big_decimal ( & quote. buy_amount ) ,
506+ solver : ByteArray ( * quote. data . solver . 0 ) ,
505507 verified : quote. data . verified ,
506508 metadata : quote. data . metadata . try_into ( ) ?,
507509 } ) ,
@@ -550,11 +552,11 @@ async fn get_quote(
550552 . map_err ( |_| OnchainOrderPlacementError :: Other ) ?;
551553
552554 let parameters = QuoteSearchParameters {
553- sell_token : order_data. sell_token . into_legacy ( ) ,
554- buy_token : order_data. buy_token . into_legacy ( ) ,
555- sell_amount : order_data. sell_amount . into_legacy ( ) ,
556- buy_amount : order_data. buy_amount . into_legacy ( ) ,
557- fee_amount : order_data. fee_amount . into_legacy ( ) ,
555+ sell_token : order_data. sell_token ,
556+ buy_token : order_data. buy_token ,
557+ sell_amount : order_data. sell_amount ,
558+ buy_amount : order_data. buy_amount ,
559+ fee_amount : order_data. fee_amount ,
558560 kind : order_data. kind ,
559561 signing_scheme : quote_signing_scheme,
560562 additional_gas : 0 ,
@@ -598,9 +600,9 @@ fn convert_onchain_order_placement(
598600 // executed fast (we don't want to reserve the user's ETH for too long)
599601 if quote. as_ref ( ) . is_ok_and ( |quote| {
600602 !order_data. within_market ( QuoteAmounts {
601- sell : quote. sell_amount ,
602- buy : quote. buy_amount ,
603- fee : quote. fee_amount ,
603+ sell : quote. sell_amount . into_legacy ( ) ,
604+ buy : quote. buy_amount . into_legacy ( ) ,
605+ fee : quote. fee_amount . into_legacy ( ) ,
604606 } )
605607 } ) {
606608 tracing:: debug!( %order_uid, ?owner, "order is outside market price" ) ;
@@ -1091,8 +1093,8 @@ mod test {
10911093 } ;
10921094 let settlement_contract = H160 :: from ( [ 8u8 ; 20 ] ) ;
10931095 let quote = Quote {
1094- sell_amount : sell_amount . into_legacy ( ) ,
1095- buy_amount : ( buy_amount / U256 :: from ( 2 ) ) . into_legacy ( ) ,
1096+ sell_amount,
1097+ buy_amount : buy_amount / U256 :: from ( 2 ) ,
10961098 ..Default :: default ( )
10971099 } ;
10981100 let order_uid = OrderUid ( [ 9u8 ; 56 ] ) ;
@@ -1212,23 +1214,20 @@ mod test {
12121214 let quote = Quote {
12131215 id : Some ( 0i64 ) ,
12141216 data : QuoteData {
1215- sell_token : sell_token. into_legacy ( ) ,
1216- buy_token : buy_token. into_legacy ( ) ,
1217- quoted_sell_amount : sell_amount
1218- . checked_sub ( U256 :: from ( 1 ) )
1219- . unwrap ( )
1220- . into_legacy ( ) ,
1221- quoted_buy_amount : buy_amount. checked_sub ( U256 :: from ( 1 ) ) . unwrap ( ) . into_legacy ( ) ,
1217+ sell_token,
1218+ buy_token,
1219+ quoted_sell_amount : sell_amount. checked_sub ( U256 :: from ( 1 ) ) . unwrap ( ) ,
1220+ quoted_buy_amount : buy_amount. checked_sub ( U256 :: from ( 1 ) ) . unwrap ( ) ,
12221221 fee_parameters : FeeParameters {
12231222 gas_amount : 2.0f64 ,
12241223 gas_price : 3.0f64 ,
12251224 sell_token_price : 4.0f64 ,
12261225 } ,
12271226 ..Default :: default ( )
12281227 } ,
1229- sell_amount : sell_amount . into_legacy ( ) ,
1230- buy_amount : buy_amount . into_legacy ( ) ,
1231- fee_amount : fee_amount . into_legacy ( ) ,
1228+ sell_amount,
1229+ buy_amount,
1230+ fee_amount,
12321231 } ;
12331232 let cloned_quote = quote. clone ( ) ;
12341233 order_quoter
@@ -1304,9 +1303,9 @@ mod test {
13041303 gas_amount : quote. data . fee_parameters . gas_amount ,
13051304 gas_price : quote. data . fee_parameters . gas_price ,
13061305 sell_token_price : quote. data . fee_parameters . sell_token_price ,
1307- sell_amount : u256_to_big_decimal ( & quote. sell_amount ) ,
1308- buy_amount : u256_to_big_decimal ( & quote. buy_amount ) ,
1309- solver : ByteArray ( quote. data . solver . 0 ) ,
1306+ sell_amount : number :: conversions :: alloy :: u256_to_big_decimal ( & quote. sell_amount ) ,
1307+ buy_amount : number :: conversions :: alloy :: u256_to_big_decimal ( & quote. buy_amount ) ,
1308+ solver : ByteArray ( * quote. data . solver . 0 ) ,
13101309 verified : quote. data . verified ,
13111310 metadata : quote. data . metadata . try_into ( ) . unwrap ( ) ,
13121311 } ;
0 commit comments