-
Notifications
You must be signed in to change notification settings - Fork 597
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
chore: make all keeper testsuite vars pointer receivers #5961
Conversation
WalkthroughThe modifications involve updating test function receiver types from value to pointer across various test files in the IBC Go modules. This change enhances consistency and potentially improves test performance by ensuring the test suites use pointer receivers uniformly. Changes
Related issues
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (3)
- modules/core/02-client/keeper/keeper_test.go (5 hunks)
- modules/core/03-connection/keeper/keeper_test.go (2 hunks)
- modules/core/04-channel/keeper/keeper_test.go (3 hunks)
Additional comments: 8
modules/core/03-connection/keeper/keeper_test.go (2)
- 64-64: The conversion of the receiver type from value to pointer in
TestGetAllConnections
is consistent with the PR's objective to enhance efficiency and maintainability by using pointer receivers in test suite variables. This change allows for direct manipulation of theKeeperTestSuite
's state within the test, which can be beneficial for setting up or modifying the test environment in a more efficient manner.- 96-96: The conversion of the receiver type from value to pointer in
TestGetAllClientConnectionPaths
aligns with the goal of improving the test suite's performance and consistency. By using pointer receivers, the test functions can directly affect the suite's state, facilitating more dynamic and efficient test setups. This change is a good practice for test suites where the state is expected to change across different tests.modules/core/02-client/keeper/keeper_test.go (5)
- 232-232: The conversion of the receiver type from value to pointer in
TestGetAllGenesisClients
is in line with the PR's objectives. This change enhances the test suite by allowing direct manipulation of theKeeperTestSuite
's state, which can lead to more efficient and flexible test setups. Using pointer receivers in test functions is a good practice for improving test suite maintainability.- 255-255: The conversion of the receiver type from value to pointer in
TestGetAllGenesisMetadata
aligns with the PR's goal of improving the test suite's efficiency and consistency. This change enables the test functions to directly modify the suite's state, which is beneficial for setting up tests in a more dynamic manner. It's a positive step towards enhancing the maintainability of the test suite.- 311-311: The conversion of the receiver type from value to pointer in
TestGetConsensusState
is consistent with the PR's objective to enhance the test suite's performance and maintainability. By using pointer receivers, the test functions can directly affect the suite's state, facilitating more efficient test setups. This change is a good practice for test suites where the state is expected to change across different tests.- 339-339: The conversion of the receiver type from value to pointer in
TestGetAllConsensusStates
aligns with the goal of improving the test suite's efficiency and consistency. This change allows for direct manipulation of theKeeperTestSuite
's state within the test, which can be beneficial for setting up or modifying the test environment in a more efficient manner. It's a positive step towards enhancing the test suite's maintainability.- 388-388: The conversion of the receiver type from value to pointer in
TestIterateClientStates
is in line with the PR's objectives. This change enhances the test suite by allowing direct manipulation of theKeeperTestSuite
's state, which can lead to more efficient and flexible test setups. Using pointer receivers in test functions is a good practice for improving test suite maintainability.modules/core/04-channel/keeper/keeper_test.go (1)
- 170-176: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-500]
The conversion of receiver types from value receivers to pointer receivers in the test suite is a positive change that aligns with Go best practices for struct methods that modify the receiver's state or for efficiency reasons when the receiver is a large struct. This change should improve the performance of the test suite by avoiding unnecessary copying of the
KeeperTestSuite
struct. However, ensure that all methods onKeeperTestSuite
that were intended to modify the receiver's state are correctly updated to reflect this change. Additionally, review all usages ofKeeperTestSuite
to ensure that pointer semantics are correctly handled, especially in cases where the test suite is passed to functions or methods expecting a value receiver.
Description
Tech debt cleanup.
GetLatestHeight
fromClientState
interface and add it toLightClientModule
#5866 and brought forward tomain
.closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.Summary by CodeRabbit