@@ -283,7 +283,21 @@ type SurfClient = surf_disco::Client<ServerError, <SequencerVersions as Versions
283
283
284
284
#[ derive( Debug , Clone , Eq , PartialEq , Hash ) ]
285
285
/// Auction Results provider holding the Url of the solver in order to fetch auction results.
286
- pub struct SolverAuctionResultsProvider ( pub Url ) ;
286
+ pub struct SolverAuctionResultsProvider {
287
+ pub url : Url ,
288
+ pub marketplace_path : String ,
289
+ pub results_path : String ,
290
+ }
291
+
292
+ impl Default for SolverAuctionResultsProvider {
293
+ fn default ( ) -> Self {
294
+ Self {
295
+ url : Url :: from_str ( "http://localhost:25000" ) . unwrap ( ) ,
296
+ marketplace_path : "marketplace-solver/" . into ( ) ,
297
+ results_path : "auction_results/" . into ( ) ,
298
+ }
299
+ }
300
+ }
287
301
288
302
#[ async_trait]
289
303
impl < TYPES : NodeType > AuctionResultsProvider < TYPES > for SolverAuctionResultsProvider {
@@ -293,11 +307,11 @@ impl<TYPES: NodeType> AuctionResultsProvider<TYPES> for SolverAuctionResultsProv
293
307
view_number : TYPES :: Time ,
294
308
) -> anyhow:: Result < TYPES :: AuctionResult > {
295
309
let resp = SurfClient :: new (
296
- self . 0
297
- . join ( "marketplace-solver/" )
310
+ self . url
311
+ . join ( & self . marketplace_path )
298
312
. context ( "Malformed solver URL" ) ?,
299
313
)
300
- . get :: < TYPES :: AuctionResult > ( & format ! ( "auction_results/{}" , * view_number) )
314
+ . get :: < TYPES :: AuctionResult > ( & format ! ( "{}{}" , self . results_path , * view_number) )
301
315
. send ( )
302
316
. await ?;
303
317
Ok ( resp)
0 commit comments