-
Notifications
You must be signed in to change notification settings - Fork 122
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
[TRA-530] When changing market pair name, validate that new pair exists in the market map #2151
[TRA-530] When changing market pair name, validate that new pair exists in the market map #2151
Conversation
WalkthroughThe changes enhance the Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional comments not posted (7)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- protocol/x/prices/keeper/market_param.go (1 hunks)
- protocol/x/prices/keeper/market_param_test.go (5 hunks)
Additional comments not posted (7)
protocol/x/prices/keeper/market_param.go (2)
53-57
: Ensure proper error handling for market pair conversion.The new validation step correctly checks if the market pair can be converted to a currency pair. However, ensure that the error handling provides sufficient context for debugging.
The code changes are approved.
58-60
: Ensure proper error handling for ticker existence check.The new validation step correctly checks if the ticker exists in the
MarketMap
. However, ensure that the error handling provides sufficient context for debugging.The code changes are approved.
protocol/x/prices/keeper/market_param_test.go (5)
80-90
: Ensure the new ticker is created in theMarketMap
.The new validation step correctly ensures that the new ticker is created in the
MarketMap
before updating theMarketParam
.The code changes are approved.
91-92
: Ensure proper error handling for market param modification.The new validation step correctly ensures that the market param modification is handled properly.
The code changes are approved.
109-112
: Ensure proper error handling for invalid update pair.The new test case correctly checks for failures when attempting to update a pair that does not exist in the
MarketMap
.The code changes are approved.
186-196
: Ensure proper error handling for missing ticker inMarketMap
.The new test case correctly checks for failures when the ticker is not found in the
MarketMap
.The code changes are approved.
9-9
: Ensure proper import ofmarketmapkeeper
.The new import statement correctly includes the
marketmapkeeper
package.The code changes are approved.
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: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- protocol/x/prices/keeper/market_param.go (2 hunks)
Additional comments not posted (1)
protocol/x/prices/keeper/market_param.go (1)
73-73
: Ensure cache consistency.Ensure that the cache update logic is consistent and handles edge cases, such as concurrent modifications to the market parameters.
Verify that the cache update logic is consistent and handles edge cases. Consider adding tests to cover these scenarios.
…xists in the market map Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
Signed-off-by: Harry Wray <[email protected]>
70f54af
to
e01f418
Compare
…ts in the market map (#2151)
Changelist
Test Plan
market_param_test.go
:Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Tests