forked from libp2p/py-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/fixed remaining types errors #32
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
Open
Aldorax
wants to merge
93
commits into
arcinston:main
Choose a base branch
from
Aldorax:feat/fixed-remaining-types-errors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/fixed remaining types errors #32
Aldorax
wants to merge
93
commits into
arcinston:main
from
Aldorax:feat/fixed-remaining-types-errors
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix:corrected argument-errors in peerId and Multiaddr in peer tests
…n, fix type hints, and comment out ClosedStream assertions
Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>
Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
fix: add null checks for noise protocol initialization and key handling
…b/floodsub | protocol_muxer/multiselect (libp2p#18)
|
Typecheck Report (Comparison with
✅ No type errors in this PR and Full list of errors in this PR(No errors found in this PR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Was Wrong?
The security tests (
tests/core/security/test_security_multistream.py) were failing due to anAssertionError. This error arose because of a critical mismatch between what theperform_simple_testfunction was passing to itsassertion_func, and what thatassertion_funcwas designed to verify.Specifically, the
perform_simple_testfunction had been modified to pass the entireIMuxedConnobject (e.g., aYamuxinstance) to theassertion_func. However, theassertion_funcitself was still structured to expect and perform type checks directly on anISecureConnobject (likeInsecureSessionorSecureSession). This meantisinstance(muxed_conn_object, InsecureSession)would always evaluate toFalse, triggering the assertion failure.How Was It Fixed?
The resolution involved a precise, two-step reconciliation within the test file to ensure the assertions correctly target the secure connection type:
Adjusted
perform_simple_test(Existing Change):The
perform_simple_testfunction now consistently passes the completemuxed_connobject (e.g.,conn_0.muxed_connandconn_1.muxed_conn) to theassertion_func. This provides the assertion logic with the full context of the multiplexed connection, allowing for more comprehensive testing if needed in the future.Updated
assertion_funcLogic (New Change):To correctly handle the
muxed_connobject it now receives, theassertion_funcwithin each test case (test_single_insecure_security_transport_succeedsandtest_default_insecure_security) was modified. It now explicitly accesses thesecured_connattribute from themuxed_connobject before performing the type check. For instance, the assertion changed fromassert isinstance(conn, transport_type)toassert isinstance(muxed_conn.secured_conn, transport_type). This ensures theisinstancecheck is performed precisely on the underlying secure session, which is the actual component whose type the test aims to verify.By implementing these two changes, the
AssertionErroris resolved. The tests now accurately confirm the type of the established secure transport, maintaining the original intent of the test suite.To-Do
Cute Animal Picture