[release] update master for v1.15#417
Conversation
[CHORE] sync dev with master
…0-alpha.3 and injective-indexer v1.19.41. Generated the MAINTAINERS.md file with documentation of the actions to execute when updating the SDK for a new chain version.
…final-release-for-v120-testnet [IC-1055] create-python-sdk-final-release-for-v120-testnet
[chore] prep for v1.20 injective-core release * New Features - Added StreamABCIEvents RPC for real-time ABCI event streaming. * Chores - Updated Indexer compatibility to v1.20.2. - Bumped internal dependency pins and promoted injective-core to v1.20.0. - Updated OFAC identifiers list. - Regenerated protocol definitions to reflect updated schemas. *Tests - Updated tests to expect new accountAddress and operationType fields.
📝 WalkthroughWalkthroughThis PR delivers SDK v1.15.0 with batch liquidation support for Injective exchange v2. It adds ChangesRelease Infrastructure & Documentation
Composer v2 Batch Liquidation and Type Resolution
Examples and Data
Protobuf Regeneration
Test Coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pyinjective/composer_v2.py (1)
331-341: 💤 Low valueConsider adding validation with clearer error messages.
The resolver methods rely on protobuf's
Value()to validate string inputs, which raisesKeyErrorfor invalid names. Consider wrapping the conversion with try/except to provide more helpful error messages.💡 Suggested enhancement
`@staticmethod` def _resolve_order_type(value: Union[str, int]) -> int: if isinstance(value, str): - return injective_order_v2_pb.OrderType.Value(value) + try: + return injective_order_v2_pb.OrderType.Value(value) + except KeyError: + valid_types = list(injective_order_v2_pb.OrderType.keys()) + raise ValueError(f"Invalid order_type: {value}. Valid options: {valid_types}") return int(value)Apply similar pattern to
_resolve_oracle_type.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyinjective/composer_v2.py` around lines 331 - 341, The _resolve_order_type and _resolve_oracle_type helpers currently call injective_order_v2_pb.OrderType.Value(value) and injective_oracle_pb.OracleType.Value(value) directly which raises KeyError for invalid names; wrap each conversion in try/except and raise a clear ValueError that includes the invalid input and the expected enum name(s) (you can retrieve allowed names from OrderType.keys() / OracleType.keys()), and similarly catch ValueError when casting ints to provide the same clear message; update both _resolve_order_type and _resolve_oracle_type accordingly.examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py (1)
80-83: 💤 Low valueConsider if post-broadcast gas price update is necessary for this example.
The gas price fetch and update (lines 80-83) duplicates the earlier logic (lines 26-28). Since this is a single-transaction example, the post-broadcast update may not be necessary.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py` around lines 80 - 83, The second gas price fetch/update is redundant for this single-transaction example: remove the duplicated block that re-assigns gas_price via client.current_chain_gas_price() and calls message_broadcaster.update_gas_price(gas_price=gas_price) (the variables and calls to gas_price, client.current_chain_gas_price(), and message_broadcaster.update_gas_price are the unique symbols to locate); instead rely on the initial fetch/update done earlier (lines with the first gas_price assignment) or, if you keep it, wrap it in a conditional that only runs for multi-TX flows so the post-broadcast update is not executed for this single TX example.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py`:
- Around line 80-83: The second gas price fetch/update is redundant for this
single-transaction example: remove the duplicated block that re-assigns
gas_price via client.current_chain_gas_price() and calls
message_broadcaster.update_gas_price(gas_price=gas_price) (the variables and
calls to gas_price, client.current_chain_gas_price(), and
message_broadcaster.update_gas_price are the unique symbols to locate); instead
rely on the initial fetch/update done earlier (lines with the first gas_price
assignment) or, if you keep it, wrap it in a conditional that only runs for
multi-TX flows so the post-broadcast update is not executed for this single TX
example.
In `@pyinjective/composer_v2.py`:
- Around line 331-341: The _resolve_order_type and _resolve_oracle_type helpers
currently call injective_order_v2_pb.OrderType.Value(value) and
injective_oracle_pb.OracleType.Value(value) directly which raises KeyError for
invalid names; wrap each conversion in try/except and raise a clear ValueError
that includes the invalid input and the expected enum name(s) (you can retrieve
allowed names from OrderType.keys() / OracleType.keys()), and similarly catch
ValueError when casting ints to provide the same clear message; update both
_resolve_order_type and _resolve_oracle_type accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 972022aa-ebf1-43e5-b19f-6becadf60335
📒 Files selected for processing (46)
CHANGELOG.mdMAINTAINERS.mdMakefileREADME.mdbuf.gen.yamlexamples/chain_client/exchange/25_MsgUpdateDerivativeMarket.pyexamples/chain_client/exchange/31_MsgBatchLiquidatePositions.pyexamples/chain_client/exchange/4_MsgInstantPerpetualMarketLaunch.pyexamples/chain_client/exchange/5_MsgInstantExpiryFuturesMarketLaunch.pypyinjective/composer_v2.pypyinjective/ofac.jsonpyinjective/proto/exchange/event_provider_api_pb2.pypyinjective/proto/exchange/event_provider_api_pb2_grpc.pypyinjective/proto/exchange/injective_accounts_rpc_pb2.pypyinjective/proto/exchange/injective_chart_rpc_pb2.pypyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.pypyinjective/proto/exchange/injective_rfq_gw_rpc_pb2.pypyinjective/proto/exchange/injective_rfq_gw_rpc_pb2_grpc.pypyinjective/proto/exchange/injective_rfq_rpc_pb2.pypyinjective/proto/exchange/injective_rfq_rpc_pb2_grpc.pypyinjective/proto/exchange/injective_tc_derivatives_rpc_pb2.pypyinjective/proto/injective/exchange/v1beta1/events_pb2.pypyinjective/proto/injective/exchange/v2/events_pb2.pypyinjective/proto/injective/exchange/v2/exchange_pb2.pypyinjective/proto/injective/exchange/v2/genesis_pb2.pypyinjective/proto/injective/exchange/v2/market_pb2.pypyinjective/proto/injective/exchange/v2/proposal_pb2.pypyinjective/proto/injective/exchange/v2/query_pb2.pypyinjective/proto/injective/exchange/v2/query_pb2_grpc.pypyinjective/proto/injective/exchange/v2/tx_pb2.pypyinjective/proto/injective/exchange/v2/tx_pb2_grpc.pypyinjective/proto/injective/oracle/v1beta1/events_pb2.pypyinjective/proto/injective/oracle/v1beta1/genesis_pb2.pypyinjective/proto/injective/oracle/v1beta1/oracle_pb2.pypyinjective/proto/injective/oracle/v1beta1/query_pb2.pypyinjective/proto/injective/oracle/v1beta1/query_pb2_grpc.pypyinjective/proto/injective/oracle/v1beta1/tx_pb2.pypyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.pypyinjective/proto/injective/peggy/v1/params_pb2.pypyinjective/proto/injective/stream/v2/query_pb2.pypyproject.tomltests/client/chain/grpc/test_chain_grpc_exchange_v2_api.pytests/client/chain/stream_grpc/test_chain_grpc_chain_stream.pytests/client/indexer/grpc/test_indexer_grpc_derivative_api.pytests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.pytests/test_composer_v2.py
💤 Files with no reviewable changes (1)
- pyinjective/proto/exchange/injective_rfq_rpc_pb2_grpc.py
Summary by CodeRabbit
Release Notes - v1.15.0
New Features
MsgBatchLiquidatePositionswith batch liquidation example scriptORDER_TYPE,ORACLE_TYPE,CROSS_MARGIN_ELIGIBILITYUpdates
Documentation