-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat/ibc_core_channel_module_queries #318
Conversation
WalkthroughThe recent updates introduce a comprehensive suite of functionalities for querying IBC channels using asynchronous clients in the Injective Protocol network. Enhancements include new scripts for querying various IBC channel states, packet commitments, and acknowledgements, alongside significant additions to the Changes
Recent Review DetailsConfiguration used: .coderabbit.yaml Files selected for processing (20)
Additional comments not posted (25)
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Actionable comments outside the diff hunks (1)
tests/test_async_client_deprecation_warnings.py (1)
Line range hint
589-589
: The methodtest_stream_keepalive_deprecation_warning
is redefined, which could lead to unexpected behavior as the first definition will be ignored. Consider renaming or removing one of the definitions to resolve this issue.- async def test_stream_keepalive_deprecation_warning( + async def test_stream_keepalive_deprecation_warning_redefined(
async def fetch_ibc_channel(self, port_id: str, channel_id: str) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_channel(port_id=port_id, channel_id=channel_id) | ||
|
||
async def fetch_ibc_channels(self, pagination: Optional[PaginationOption] = None) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_channels(pagination=pagination) | ||
|
||
async def fetch_ibc_connection_channels( | ||
self, connection: str, pagination: Optional[PaginationOption] = None | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_connection_channels(connection=connection, pagination=pagination) | ||
|
||
async def fetch_ibc_channel_client_state(self, port_id: str, channel_id: str) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_channel_client_state(port_id=port_id, channel_id=channel_id) | ||
|
||
async def fetch_ibc_channel_consensus_state( | ||
self, | ||
port_id: str, | ||
channel_id: str, | ||
revision_number: int, | ||
revision_height: int, | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_channel_consensus_state( | ||
port_id=port_id, | ||
channel_id=channel_id, | ||
revision_number=revision_number, | ||
revision_height=revision_height, | ||
) | ||
|
||
async def fetch_ibc_packet_commitment(self, port_id: str, channel_id: str, sequence: int) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_packet_commitment( | ||
port_id=port_id, channel_id=channel_id, sequence=sequence | ||
) | ||
|
||
async def fetch_ibc_packet_commitments( | ||
self, port_id: str, channel_id: str, pagination: Optional[PaginationOption] = None | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_packet_commitments( | ||
port_id=port_id, channel_id=channel_id, pagination=pagination | ||
) | ||
|
||
async def fetch_ibc_packet_receipt(self, port_id: str, channel_id: str, sequence: int) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_packet_receipt( | ||
port_id=port_id, channel_id=channel_id, sequence=sequence | ||
) | ||
|
||
async def fetch_ibc_packet_acknowledgement(self, port_id: str, channel_id: str, sequence: int) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_packet_acknowledgement( | ||
port_id=port_id, channel_id=channel_id, sequence=sequence | ||
) | ||
|
||
async def fetch_ibc_packet_acknowledgements( | ||
self, | ||
port_id: str, | ||
channel_id: str, | ||
packet_commitment_sequences: Optional[List[int]] = None, | ||
pagination: Optional[PaginationOption] = None, | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_packet_acknowledgements( | ||
port_id=port_id, | ||
channel_id=channel_id, | ||
packet_commitment_sequences=packet_commitment_sequences, | ||
pagination=pagination, | ||
) | ||
|
||
async def fetch_ibc_unreceived_packets( | ||
self, port_id: str, channel_id: str, packet_commitment_sequences: Optional[List[int]] = None | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_unreceived_packets( | ||
port_id=port_id, channel_id=channel_id, packet_commitment_sequences=packet_commitment_sequences | ||
) | ||
|
||
async def fetch_ibc_unreceived_acks( | ||
self, port_id: str, channel_id: str, packet_ack_sequences: Optional[List[int]] = None | ||
) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_unreceived_acks( | ||
port_id=port_id, channel_id=channel_id, packet_ack_sequences=packet_ack_sequences | ||
) | ||
|
||
async def fetch_next_sequence_receive(self, port_id: str, channel_id: str) -> Dict[str, Any]: | ||
return await self.ibc_channel_api.fetch_next_sequence_receive(port_id=port_id, channel_id=channel_id) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The additional verification script searched for unit tests related to other IBC channel methods in async_client.py
. The output indicates the presence of a test named test_fetch_ibc_transfer_txs
within a file related to the gRPC explorer API. However, this test does not appear to be directly related to the newly added methods in async_client.py
that handle various IBC channel queries.
Given the results from both scripts, it seems that there are no specific unit tests for the newly added IBC channel methods in async_client.py
. This lack of tests could pose a risk to the stability and reliability of these methods, as comprehensive testing is crucial for ensuring that the methods handle different scenarios and error conditions effectively.
Therefore, it is recommended to implement unit tests for these new methods to ensure their functionality and robustness are thoroughly validated.
Analysis chain
The newly added methods for IBC channel queries are well-structured and follow the async pattern. Ensure comprehensive unit tests cover these methods to validate their functionality against a range of input scenarios and error conditions.
The verification script aimed to check for the presence of unit tests for the newly added IBC channel methods in async_client.py
by searching for the string "test_fetch_ibc_channel" within the ./tests/
directory. The script did not produce any output, indicating that no tests matching this description were found.
Given the absence of detected unit tests for these methods, it is crucial to ensure that comprehensive testing is implemented to verify the functionality and robustness of these new methods. This is especially important as these methods handle network operations and data fetching, which are critical components and prone to various edge cases and error conditions.
To further verify the presence of tests for other related methods or to ensure that no relevant tests were overlooked due to naming conventions or file locations, I will run an additional script to search for tests related to other IBC channel methods.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for the presence of unit tests for the new IBC channel methods in async_client.py
rg --type py "test_fetch_ibc_channel" ./tests/
Length of output: 46
Script:
#!/bin/bash
# Check for the presence of unit tests for other IBC channel methods in async_client.py
rg --type py "test_fetch_ibc_" ./tests/
Length of output: 144
Solves CHAIN-77
Summary by CodeRabbit