Skip to content

Commit

Permalink
feat(network): impl From<SqmrServerPayloadForNetwork> for SqmrServerP…
Browse files Browse the repository at this point in the history
…ayload (#2245)
  • Loading branch information
ShahakShama authored Jul 23, 2024
1 parent 05ccf54 commit 3bcfcc6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/papyrus_network/src/network_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,16 @@ where

impl<Query: TryFrom<Bytes>, Response> From<SqmrServerPayloadForNetwork>
for SqmrServerPayload<Query, Response>
where
Bytes: From<Response>,
Response: 'static,
{
fn from(_payload: SqmrServerPayloadForNetwork) -> Self {
unimplemented!()
fn from(payload: SqmrServerPayloadForNetwork) -> Self {
let SqmrServerPayloadForNetwork { query, report_sender, responses_sender } = payload;
let query = Query::try_from(query);
let responses_sender =
Box::new(responses_sender.with(|response| ready(Ok(Bytes::from(response)))));
Self { query, report_sender, responses_sender }
}
}

Expand Down

0 comments on commit 3bcfcc6

Please sign in to comment.