Skip to content

Comments

refactor(client): replace interface{} with any in chain client#351

Open
ahwlsqja wants to merge 1 commit intoInjectiveLabs:masterfrom
ahwlsqja:refactor/interface-to-any
Open

refactor(client): replace interface{} with any in chain client#351
ahwlsqja wants to merge 1 commit intoInjectiveLabs:masterfrom
ahwlsqja:refactor/interface-to-any

Conversation

@ahwlsqja
Copy link

@ahwlsqja ahwlsqja commented Feb 16, 2026

Summary

Modernize 8 occurrences of map[string]interface{} to map[string]any in ComputeOrderHashes for both ChainClient and ChainClientV2.

Motivation

Go 1.18+ provides any as a built-in alias for interface{}. This is a purely cosmetic change with zero behavioral impact, improving readability and aligning with modern Go idioms.

Related: #349

Changes

File Change
client/chain/chain.go map[string]interface{}map[string]any (4 occurrences)
client/chain/chain_v2.go map[string]interface{}map[string]any (4 occurrences)

Verification

  • go build ./client/...
  • go vet ./client/...
  • No test changes needed (zero behavioral change)

Summary by CodeRabbit

  • Refactor
    • Updated internal type declarations in order computation components for improved code quality and maintainability.

Modernize 8 occurrences of map[string]interface{} to map[string]any
in ComputeOrderHashes for both ChainClient and ChainClientV2.

Go 1.18+ provides `any` as a built-in alias for `interface{}`.
This is a purely cosmetic change with zero behavioral impact.
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Two Go source files in the chain package were updated to replace the interface{} type with Go's any type alias in map declarations within the ComputeOrderHashes function. Both SpotOrder and DerivativeOrder message construction paths were affected. No functional logic or control flow changes were introduced.

Changes

Cohort / File(s) Summary
Type Alias Modernization
client/chain/chain.go, client/chain/chain_v2.go
Replaced interface{} with any type alias in map value types within ComputeOrderHashes for SpotOrder and DerivativeOrder message construction. Purely syntactic update with no functional impact.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 From interface{} old to any brand new,
The code shines brighter, sleek and clean,
No logic bends, just types renewed,
The simplest refactor ever seen! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(client): replace interface{} with any in chain client' accurately describes the main change—a systematic replacement of interface{} with the any type alias across chain client files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant