Fix compilation errors after API parity changes

Update Market struct to match reference implementation with all required fields, add Clone trait to Rewards struct, fix Market initialization in decode.rs with proper field mappings, update test calls to use correct parameter types for get_sampling_markets method, remove broken example file that needs complete rewrite.
This commit is contained in:
floor-licker
2025-11-04 23:09:17 -05:00
parent 11765f9fc7
commit c5ac9537aa
6 changed files with 41 additions and 208 deletions
+20 -3
View File
@@ -312,14 +312,31 @@ impl Decoder<Market> for RawMarketResponse {
Ok(Market {
condition_id: self.condition_id.clone(),
tokens,
rewards: crate::types::Rewards {
rates: None,
min_size: Decimal::ZERO,
max_spread: Decimal::ONE,
event_start_date: None,
event_end_date: None,
in_game_multiplier: None,
reward_epoch: None,
},
min_incentive_size: None,
max_incentive_spread: None,
active: self.active,
closed: self.closed,
question: self.question.clone(),
question_id: self.condition_id.clone(), // Use condition_id as fallback
minimum_order_size: self.minimum_order_size,
minimum_tick_size: self.minimum_tick_size,
description: self.description.clone(),
category: self.category.clone(),
end_date_iso: self.end_date_iso.clone(),
minimum_order_size: self.minimum_order_size,
minimum_tick_size: self.minimum_tick_size,
game_start_time: None,
question: self.question.clone(),
market_slug: format!("market-{}", self.condition_id), // Generate a slug
seconds_delay: Decimal::ZERO,
icon: String::new(),
fpmm: String::new(),
})
}
}