-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix get_price interface #1
Conversation
WalkthroughThe pull request modifies the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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: 0
🧹 Outside diff range and nitpick comments (1)
src/interfaces/IConnectOracle.sol (1)
14-14
: Document the pair_id formatSince we're moving to a single
pair_id
parameter, it's important to document the expected format (e.g., "BTC/USD", "ETH-USDT", etc.) to ensure consistent usage.- function get_price(string memory pair_id) external returns (Price memory); + /// @notice Get the price for a given currency pair + /// @param pair_id The currency pair identifier (e.g., "BTC/USD") + /// @return Price struct containing price data and metadata + function get_price(string memory pair_id) external returns (Price memory);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/interfaces/IConnectOracle.sol
(1 hunks)
🔇 Additional comments (2)
src/interfaces/IConnectOracle.sol (2)
14-14
:
Breaking Change: Verify all implementations and callers
The signature change from (string base, string quote)
to (string pair_id)
is a breaking change that requires updates to all implementations and callers.
✅ Verification successful
Let me gather more context about the changes by checking the git history and the implementation details.
Based on the gathered information, I can now generate the final response:
Breaking change is properly synchronized
The change from get_price(string base, string quote)
to get_price(string pair_id)
is already synchronized with its only implementation in ConnectOracle.sol
. The interface is not used in any other contracts, and there are no test files affected by this change. The modification aligns with the batch operation get_prices
which already uses the pair_id format.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Find all implementations and usages of the interface
echo "Checking implementations of IConnectOracle..."
ast-grep --pattern 'contract $_ is IConnectOracle {
$$$
}'
echo "Checking usages of get_price..."
rg -A 2 'get_price\('
Length of output: 715
Script:
#!/bin/bash
# Check the git diff to understand the changes
git diff HEAD^1 -- src/interfaces/IConnectOracle.sol src/ConnectOracle.sol
# Check if there are any other files that might be using the interface
rg -l "IConnectOracle"
# Look for any tests that might be affected
fd "test" --type f --exec rg -l "get_price" {}
Length of output: 808
14-16
: Consider consistency between single and batch operations
The interface provides both single (get_price
) and batch (get_prices
) operations. The parameter naming is consistent (pair_id
/pair_ids
), which is good. However, verify that both functions handle errors consistently.
get_price
interface betweenIConnectOracle.sol
andConnectOracle.sol
Summary by CodeRabbit
New Features
get_price
function to accept a single parameter for currency pairs.Bug Fixes
get_price
function.