File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11use {
22 super :: Postgres ,
3+ alloy:: primitives:: Address ,
34 anyhow:: Result ,
45 bigdecimal:: BigDecimal ,
5- primitive_types:: H160 ,
66 std:: collections:: HashMap ,
77} ;
88
99impl Postgres {
10- pub async fn fetch_latest_prices ( & self ) -> Result < HashMap < H160 , BigDecimal > > {
10+ pub async fn fetch_latest_prices ( & self ) -> Result < HashMap < Address , BigDecimal > > {
1111 let _timer = super :: Metrics :: get ( )
1212 . database_queries
1313 . with_label_values ( & [ "fetch_latest_prices" ] )
@@ -17,7 +17,7 @@ impl Postgres {
1717 Ok ( database:: auction_prices:: fetch_latest_prices ( & mut ex)
1818 . await ?
1919 . into_iter ( )
20- . map ( |auction_price| ( H160 :: from ( auction_price. token . 0 ) , auction_price. price ) )
20+ . map ( |auction_price| ( Address :: new ( auction_price. token . 0 ) , auction_price. price ) )
2121 . collect :: < HashMap < _ , _ > > ( ) )
2222 }
2323}
Original file line number Diff line number Diff line change @@ -331,7 +331,13 @@ pub async fn run(args: Arguments) {
331331 )
332332 . await
333333 . unwrap ( ) ;
334- let prices = postgres_write. fetch_latest_prices ( ) . await . unwrap ( ) ;
334+ let prices = postgres_write
335+ . fetch_latest_prices ( )
336+ . await
337+ . unwrap ( )
338+ . into_iter ( )
339+ . map ( |( k, v) | ( k. into_legacy ( ) , v) )
340+ . collect ( ) ;
335341 native_price_estimator. initialize_cache ( prices) ;
336342
337343 let price_estimator = price_estimator_factory
You can’t perform that action at this time.
0 commit comments