Skip to content

Commit e4332eb

Browse files
committed
fix serialization (wrong object was used)
1 parent c18c40b commit e4332eb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/market/src/matcher.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ impl Matcher {
197197
.await
198198
.map_err(|e| MatcherError::GolemBaseOfferError(e.to_string()))?;*/
199199

200+
//save payload to file
201+
202+
let offer_to_str = serde_json::to_string(&offer).map_err(|e| {
203+
MatcherError::GolemBaseOfferError(format!("Failed to serialize offer: {}", e))
204+
})?;
205+
fs::write("offer_base.json", offer_to_str).map_err(|e| {
206+
MatcherError::GolemBaseOfferError(format!(
207+
"Failed to write offer payload to file: {}",
208+
e
209+
))
210+
})?;
211+
200212
let random_bytes: [u8; 32] = rand::random();
201213
let offer: Offer = Offer {
202214
id: SubscriptionId::from_bytes(random_bytes),

0 commit comments

Comments
 (0)