-
Notifications
You must be signed in to change notification settings - Fork 59
feat: remove unused exchange client dependency #334
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughPublic constructors in client/chain/markets_assistant.go changed their exchange client parameter type from exchange.ExchangeClient to any, with deprecation comments added. Tests were updated to remove mock exchange usage and pass nil for the exchange client. No internal token initialization logic was modified. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant MA as NewMarketsAssistantWithAllTokens
participant CC as ChainClient / ChainClientV2
Caller->>MA: Call with (exchangeClient: any|nil, chainClient)
note over MA: exchangeClient parameter accepted but not required
MA->>CC: Fetch denoms/markets
CC-->>MA: Chain tokens/markets data
MA-->>Caller: MarketsAssistant instance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
5b762eb
to
9a43255
Compare
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
🧹 Nitpick comments (2)
client/chain/markets_assistant.go (2)
58-60
: Use standard Go deprecation format and improve migration guidance.The deprecation comment uses a non-standard format. Per Go conventions, use
// Deprecated:
(capital D, followed by colon). Additionally, consider clarifying what callers should pass (e.g., "pass nil") and when the parameter will be removed.Apply this diff:
-// NewMarketsAssistantWithAllTokens initializes a MarketsAssistant by first fetching all token metadata from the chain's bank module -// @deprecated removed exchangeClient -func NewMarketsAssistantWithAllTokens(ctx context.Context, exchangeClient any, chainClient ChainClient) (MarketsAssistant, error) { +// NewMarketsAssistantWithAllTokens initializes a MarketsAssistant by first fetching all token metadata from the chain's bank module +// +// Deprecated: The exchangeClient parameter is unused and will be removed in a future version. Pass nil for this parameter. +func NewMarketsAssistantWithAllTokens(ctx context.Context, exchangeClient any, chainClient ChainClient) (MarketsAssistant, error) {
68-70
: Use standard Go deprecation format and improve migration guidance.The deprecation comment uses a non-standard format. Per Go conventions, use
// Deprecated:
(capital D, followed by colon). Additionally, consider clarifying what callers should pass (e.g., "pass nil") and when the parameter will be removed.Apply this diff:
-// NewHumanReadableMarketsAssistantWithAllTokens initializes a MarketsAssistant by first fetching all token metadata from the chain's bank module -// @deprecated removed exchangeClient -func NewHumanReadableMarketsAssistantWithAllTokens(ctx context.Context, exchangeClient any, chainClient ChainClientV2) (MarketsAssistant, error) { +// NewHumanReadableMarketsAssistantWithAllTokens initializes a MarketsAssistant by first fetching all token metadata from the chain's bank module +// +// Deprecated: The exchangeClient parameter is unused and will be removed in a future version. Pass nil for this parameter. +func NewHumanReadableMarketsAssistantWithAllTokens(ctx context.Context, exchangeClient any, chainClient ChainClientV2) (MarketsAssistant, error) {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
client/chain/markets_assistant.go
(1 hunks)client/chain/markets_assistant_test.go
(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
client/chain/markets_assistant_test.go (1)
client/chain/markets_assistant.go (2)
NewMarketsAssistantWithAllTokens
(60-66)NewHumanReadableMarketsAssistantWithAllTokens
(70-76)
client/chain/markets_assistant.go (2)
client/chain/chain.go (1)
ChainClient
(74-332)client/chain/chain_v2.go (1)
ChainClientV2
(54-310)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: run-tests
- GitHub Check: lint
🔇 Additional comments (2)
client/chain/markets_assistant_test.go (2)
193-193
: LGTM!Correctly passes
nil
for the now-unused exchange client parameter, aligning with the updated constructor signature.
377-377
: LGTM!Correctly passes
nil
for the now-unused exchange client parameter, consistent with the signature change.
This PR removes an unused dependency between chain and exchange client, it prevents circular dependencies in the clients too.
Summary by CodeRabbit
Refactor
Tests