Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(network): remove TryFrom for response from server payload #2244

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/papyrus_network/src/network_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,10 @@ pub struct SqmrClientPayload<Query, Response: TryFrom<Bytes>> {

pub type SqmrClientSender<Query, Response> = GenericSender<SqmrClientPayload<Query, Response>>;

pub struct SqmrServerPayload<Query, Response: TryFrom<Bytes>> {
pub query: Query,
pub struct SqmrServerPayload<Query: TryFrom<Bytes>, Response> {
pub query: Result<Query, <Query as TryFrom<Bytes>>::Error>,
pub report_sender: ReportSender,
pub responses_sender: ResponsesSender<Response>,
pub responses_sender: GenericSender<Response>,
}

// TODO(shahak): Return this type in register_sqmr_protocol_server
Expand Down Expand Up @@ -681,7 +681,7 @@ where
}
}

impl<Query, Response: TryFrom<Bytes>> From<SqmrServerPayloadForNetwork>
impl<Query: TryFrom<Bytes>, Response> From<SqmrServerPayloadForNetwork>
for SqmrServerPayload<Query, Response>
{
fn from(_payload: SqmrServerPayloadForNetwork) -> Self {
Expand Down
Loading