-
Notifications
You must be signed in to change notification settings - Fork 125
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(CometBFTService): minor InitChain cleanup #2035
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested reviewers
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2035 +/- ##
==========================================
+ Coverage 22.13% 22.15% +0.02%
==========================================
Files 357 357
Lines 16002 15987 -15
Branches 12 12
==========================================
Hits 3542 3542
+ Misses 12313 12298 -15
Partials 147 147
|
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.
Caution
Inline review comments failed to post
Actionable comments posted: 3
🧹 Outside diff range comments (1)
mod/node-api/backend/mocks/deposit_store.mock.go (1)
Line range hint
104-148
: LGTM with a minor suggestion:Prune
method,NewDepositStore
function, and helpers are well-implemented.The
Prune
method,NewDepositStore
function, and their associated helper types and methods are correctly implemented. ThePrune
method includes proper error handling, and theNewDepositStore
function correctly sets up the mock for testing.Consider adding a comment to the
NewDepositStore
function explaining that it returns a pointer to ensure that the mock can be modified in place during tests. For example:// NewDepositStore creates a new instance of DepositStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. // It returns a pointer to allow in-place modifications of the mock during tests. func NewDepositStore[DepositT any](t interface { mock.TestingT Cleanup(func()) }) *DepositStore[DepositT] { // ... (existing implementation) }This additional comment would provide clarity on the return type and its purpose.
🛑 Comments failed to post (3)
mod/node-core/pkg/services/registry/mocks/registry_option.mock.go (1)
1-1: 💡 Codebase verification
🔴 Unexpected Incomplete Function Signature Detected
The
NewRegistryOption
function appears to have an incomplete signature:
- Line 71:
func NewRegistryOption(t interface {
This may indicate a generation issue with the new mockery version.
🔗 Analysis chain
LGTM: Mockery version update.
The change from mockery v2.46.1 to v2.46.2 is a minor version update. This type of change typically doesn't introduce breaking changes or significant alterations to the generated code.
Let's verify that no unexpected changes were introduced:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any unexpected changes in the mock file structure or content. # Test 1: Verify the file structure hasn't changed significantly echo "Checking file structure..." grep -n "type RegistryOption struct {" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go grep -n "func (_m \*RegistryOption) Execute(_a0 \*service.Registry) error {" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go grep -n "func NewRegistryOption(t interface {" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go # Test 2: Check for any unexpected imports echo "Checking imports..." grep -n "^import (" -A 5 mod/node-core/pkg/services/registry/mocks/registry_option.mock.go # Test 3: Ensure no unexpected methods were added or removed echo "Checking methods..." grep -n "func (_m \*RegistryOption)" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go # Test 4: Verify the presence of key mock functionalities echo "Checking mock functionalities..." grep -n "mock.Mock" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go grep -n "EXPECT()" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go grep -n "AssertExpectations" mod/node-core/pkg/services/registry/mocks/registry_option.mock.goLength of output: 1736
mod/node-api/backend/mocks/withdrawal.mock.go (1)
1-1: 🧹 Nitpick (assertive)
LGTM: Minor version update in generated file.
The change updates the version of the mockery tool used to generate this file from v2.46.1 to v2.46.2. This is a minor version update and doesn't affect the functionality of the mock.
Remember that this is a generated file and should not be manually edited, as indicated by the "DO NOT EDIT" comment. Any changes to the mock should be made through the source that generates this file.
mod/storage/pkg/pruner/mocks/block_event.mock.go (1)
1-1: 🧹 Nitpick (assertive)
LGTM: Mockery version update.
The change updates the version of mockery used to generate this file from v2.46.1 to v2.46.2. This is a minor version update and doesn't affect the functionality of the mock.
As a general practice, it's good to keep generated files up-to-date with the latest stable versions of the tools used to generate them. However, it's worth noting that changes to generated files should be reviewed carefully to ensure they don't introduce unexpected modifications to the mocked behavior.
unlike cosmos SDK BaseApp,
initHeader
is not used across our codebase, so we can just remove it.This is safe because:
sdk.Context
attributes filled by header are used in our codebasesdk.Context
attributes filled by header are used in cometBFTIt is also weird that it is not reset by FinalizeBlock or Commit, and it is just set upon chain initialization.
Summary by CodeRabbit
DepositStore
type, including new methods for deposit management.