C 533/add atomic order types to exchange precompile#27
C 533/add atomic order types to exchange precompile#27
Conversation
📝 WalkthroughWalkthroughDocumentation for orderType fields updated to include "buyAtomic" and "sellAtomic" values. Two new wrapper functions added to ExchangeTest that forward spot and derivative market orders to the exchange module while passing the test contract address. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Exchange.sol (1)
465-465: Minor formatting inconsistency and verify backend support.The documentation update correctly adds the new atomic order types. However:
- There's an extra space after the opening parenthesis:
( "buy"should be("buy"to match line 273's formatting.- Since this PR depends on injective-core PR #2576, verify that the backend precompile implementation actually supports these new "buyAtomic" and "sellAtomic" order types.
🔎 Proposed formatting fix
- /// order type ( "buy", "sell", "buyPostOnly", "sellPostOnly", "buyAtomic", or "sellAtomic") + /// order type ("buy", "sell", "buyPostOnly", "sellPostOnly", "buyAtomic", or "sellAtomic")To verify backend support, please confirm that injective-core PR #2576 has been merged and includes support for these order types, or run integration tests against the updated backend.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
lib/.DS_Storeis excluded by!**/.DS_Store
📒 Files selected for processing (2)
src/Exchange.solsrc/tests/ExchangeTest.sol
🔇 Additional comments (3)
src/Exchange.sol (1)
273-273: Documentation update looks good.The addition of "buyAtomic" and "sellAtomic" order types to the documentation aligns with the PR objectives.
src/tests/ExchangeTest.sol (2)
95-99: LGTM! Clean wrapper implementation.This helper function correctly wraps the exchange module's
createSpotMarketOrdermethod, passing the test contract as the sender. The use ofcalldatafor input andmemoryfor output is appropriate.
101-105: LGTM! Consistent with spot market order wrapper.This helper function correctly mirrors the structure of
createSpotMarketOrderfor derivative orders, maintaining consistency in the test contract.
goes with https://github.com/InjectiveLabs/injective-core/pull/2576
Summary by CodeRabbit
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.