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

refactor(network): remove protobuf from network_manager test #2109

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

asmaastarkware
Copy link
Contributor

@asmaastarkware asmaastarkware commented Jun 16, 2024

This change is Reviewable

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @asmaastarkware)


crates/papyrus_network/src/network_manager/test.rs line 121 at r1 (raw file):

                signatures: vec![],
            };
            let data_bytes = Vec::<u8>::from(DataOrFin(Some(signed_header)));

I meant that you should not have headers at all here, just some random hardcoded vec

Copy link

codecov bot commented Jun 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.25%. Comparing base (faa0e5d) to head (973b795).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2109      +/-   ##
==========================================
- Coverage   68.41%   68.25%   -0.17%     
==========================================
  Files         132      132              
  Lines       17605    17605              
  Branches    17605    17605              
==========================================
- Hits        12045    12016      -29     
- Misses       4229     4261      +32     
+ Partials     1331     1328       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@asmaastarkware asmaastarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama)


crates/papyrus_network/src/network_manager/test.rs line 121 at r1 (raw file):

Previously, ShahakShama wrote…

I meant that you should not have headers at all here, just some random hardcoded vec

Done.

@asmaastarkware asmaastarkware force-pushed the asmaa/remove_protobuf_from_network_manager_test branch from 927e735 to df6753b Compare June 17, 2024 08:18
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @asmaastarkware)


crates/papyrus_network/src/network_manager/test.rs line 95 at r2 (raw file):

    }

    fn create_received_data_events_for_input(

You can still call it query, just keep it Vec


crates/papyrus_network/src/network_manager/test.rs line 95 at r2 (raw file):

    }

    fn create_received_data_events_for_input(

Add to the name of this function what it does
create_response_events_for_query_each_num_becomes_response


crates/papyrus_network/src/network_manager/test.rs line 105 at r2 (raw file):

                    data: vec![data],
                    outbound_session_id,
                    peer_id: PeerId::random(),

Could you fix this on the way? you should receive peer_id from the caller (send_query. It has a peer_id argument)


crates/papyrus_network/src/network_manager/test.rs line 257 at r2 (raw file):

        .take(VEC.len())
        .map(|(i, (result, _report_callback))| {
            let result = result.unwrap();

Add comment that this is how the mock swarm parses the query and sends responses to it

@asmaastarkware asmaastarkware force-pushed the asmaa/remove_protobuf_from_network_manager_test branch from df6753b to 000b74e Compare June 17, 2024 14:02
Copy link
Contributor Author

@asmaastarkware asmaastarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @ShahakShama)


crates/papyrus_network/src/network_manager/test.rs line 95 at r2 (raw file):

Previously, ShahakShama wrote…

Add to the name of this function what it does
create_response_events_for_query_each_num_becomes_response

Done.


crates/papyrus_network/src/network_manager/test.rs line 105 at r2 (raw file):

Previously, ShahakShama wrote…

Could you fix this on the way? you should receive peer_id from the caller (send_query. It has a peer_id argument)

Done.


crates/papyrus_network/src/network_manager/test.rs line 257 at r2 (raw file):

Previously, ShahakShama wrote…

Add comment that this is how the mock swarm parses the query and sends responses to it

Done.

@ShahakShama ShahakShama force-pushed the asmaa/remove_protobuf_from_network_manager_test branch from 000b74e to 973b795 Compare June 19, 2024 04:08
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @asmaastarkware)

@ShahakShama ShahakShama added this pull request to the merge queue Jun 19, 2024
Merged via the queue into main with commit 0b4ac41 Jun 19, 2024
34 checks passed
@ShahakShama ShahakShama deleted the asmaa/remove_protobuf_from_network_manager_test branch June 19, 2024 04:20
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants