Closed aarmoa closed 7 months ago
This update significantly enhances the capabilities of the platform by integrating comprehensive support for IBC Transfer module queries, alongside the existing support for the 'tendermint' module. It streamlines the cookies management logic for gRPC calls and introduces a suite of functionalities for handling token transfers, querying denomination traces, hashes, and escrow information within the Injective Protocol environment.
File Path | Change Summary |
---|---|
CHANGELOG.md |
Added support for IBC Transfer module queries; refactored cookies management. |
examples/chain_client/ibc/transfer/1_MsgTransfer.py examples/chain_client/ibc/transfer/query/... |
Introduced scripts for token transfers and querying denomination traces, hashes, escrow addresses, and total escrow amounts in Injective Protocol. |
pyinjective/async_client.py pyinjective/composer.py pyinjective/core/tx/grpc/ibc_transfer_grpc_api.py |
Enhanced async client with IBC Transfer module functionalities; added methods for interacting with the IBCTransferGrpcApi . |
tests/core/tx/grpc/... tests/test_composer.py |
Added tests for IBC Transfer module functionalities, including denom traces, hashes, escrow addresses, and message creation. |
🐰✨
In the digital fields where data streams flow,
A rabbit hopped in, its eyes aglow.
With a flick and a hop, new paths it weaved,
Through IBC transfers, much was achieved.
"To the moon!" it cheered, with no delay,
As it bounded off, leading the way.
🚀🌕
examples/chain_client/ibc/transfer/query/5_TotalEscrowForDenom.py (1)
`3-3`: Consider removing the unused `symbol_database` import to clean up the code.examples/chain_client/ibc/transfer/query/4_EscrowAddress.py (1)
`3-3`: Consider removing the unused `symbol_database` import to clean up the code.examples/chain_client/ibc/transfer/query/3_DenomHash.py (1)
`3-3`: Consider removing the unused `symbol_database` import to clean up the code.examples/chain_client/ibc/transfer/query/2_DenomTraces.py (1)
`3-3`: Consider removing the unused `symbol_database` import to clean up the code.examples/chain_client/ibc/transfer/query/1_DenomTrace.py (1)
`3-3`: Consider removing the unused `symbol_database` import to clean up the code.tests/core/tx/grpc/configurable_ibc_transfer_query_servicer.py (1)
`1-37`: LGTM! The mock gRPC servicer implementation for IBC transfer queries is well-structured and serves its intended purpose effectively.examples/chain_client/ibc/transfer/1_MsgTransfer.py (1)
`1-61`: LGTM! The script for creating and broadcasting an IBC transfer message is well-structured and demonstrates the intended functionality effectively.pyinjective/core/tx/grpc/ibc_transfer_grpc_api.py (1)
`1-58`: LGTM! The `IBCTransferGrpcApi` class implementation is well-structured and provides a clean interface for interacting with the IBC Transfer module via gRPC.tests/core/tx/grpc/test_ibc_transfer_grpc_api.py (4)
`15-17`: Consider using a more descriptive name for the fixture. A more descriptive name for the `ibc_transfer_servicer` fixture could improve readability. For example, `mock_ibc_transfer_servicer` would immediately convey that this is a mock object used for testing. --- `44-70`: Validate input parameters in `test_fetch_denom_trace`. It's important to ensure that the `hash` parameter passed to `api.fetch_denom_trace` is validated or sanitized before use, especially since it interacts with external systems or libraries. Consider adding a check or a note to verify that this is handled appropriately upstream. --- `72-116`: Optimize pagination handling in `test_fetch_denom_traces`. The pagination handling in `test_fetch_denom_traces` could be optimized by abstracting the pagination logic into a utility function or class. This would improve code reuse and maintainability, especially if pagination is a common pattern in your tests or application logic. --- `138-156`: Review error handling in `test_fetch_escrow_address`. Ensure that the `test_fetch_escrow_address` method properly handles errors or exceptions that may arise from the `api.fetch_escrow_address` call. This is crucial for resilience and reliability, especially in network-related operations.CHANGELOG.md (2)
Line range hint `63-63`: Clarify the addition of logic for Client Order ID. The entry for version 1.0 mentions "Added logic to support use of Client Order ID (CID) new identifier in OrderInfo". It would be helpful to briefly explain why this addition is significant or how it improves the project, enhancing the changelog's informativeness. --- Line range hint `71-71`: Clarify the removal of `aiocron` dependency. The entry for version 1.0 mentions the removal of the `aiocron` dependency. Expanding on the reason for this removal and its impact on the project could provide valuable context to the readers of the changelog.tests/test_composer.py (1)
`1434-1472`: The new test method `test_msg_ibc_transfer` is correctly implemented and thoroughly tests the IBC transfer message creation.pyinjective/composer.py (1)
`2148-2175`: Consider adding a docstring to `msg_ibc_transfer`. The `msg_ibc_transfer` method lacks a docstring, which is crucial for understanding the purpose, parameters, and expected behavior of the method, especially for such a critical functionality as IBC transfers. Adding a comprehensive docstring would improve code maintainability and readability.pyinjective/async_client.py (1)
`3021-3036`: Consider adding error handling for IBC Transfer module methods. The newly added methods for interacting with the IBC Transfer module (`fetch_denom_trace`, `fetch_denom_traces`, `fetch_denom_hash`, `fetch_escrow_address`, `fetch_total_escrow_for_denom`) currently do not include explicit error handling. It's advisable to implement error handling to manage potential exceptions or errors that may arise during the execution of these methods, ensuring the robustness and reliability of the application.
Solves CHAIN-74
Summary by CodeRabbit
New Features
Refactor
Tests