Skip to content
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(all): Run make generate-check #2027

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Sep 28, 2024

Appeased CI by running make generate-check. Apparently github.com/vektra/mockery/v2 updated its latest version

Summary by CodeRabbit

  • New Features

    • Updated mock implementations to enhance type clarity by replacing interface{} with any across various mock types.
    • Improved type specificity for methods in the BLSSigner mock, enhancing cryptographic operations.
  • Bug Fixes

    • None.
  • Documentation

    • Updated version comments for mock generation tool from v2.46.0 to v2.46.1 across multiple files.
  • Refactor

    • Adjusted type parameters in multiple mock files to use any instead of interface{} for improved type flexibility.
  • Chores

    • General updates to mock files to reflect the new version of the mockery tool.

Copy link
Contributor

coderabbitai bot commented Sep 28, 2024

Walkthrough

The pull request introduces updates across multiple mock files, primarily focusing on changing the mockery tool version from v2.46.0 to v2.46.1. Additionally, several type parameters have been modified from interface{} to any in various mock implementations, enhancing type clarity and consistency. Specific method signatures have also been updated to reflect these changes, particularly in the context of cryptographic operations and other mock structures.

Changes

Files Change Summary
mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go, mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go, mod/node-api/backend/mocks/validator.mock.go, mod/node-core/pkg/services/registry/mocks/basic.mock.go, mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go, mod/node-core/pkg/services/registry/mocks/registry_option.mock.go, mod/storage/pkg/interfaces/mocks/db.mock.go, mod/storage/pkg/pruner/mocks/beacon_block.mock.go, mod/storage/pkg/pruner/mocks/block_event.mock.go, mod/storage/pkg/pruner/mocks/prunable.mock.go, mod/storage/pkg/pruner/mocks/pruner.mock.go Updated mockery version from v2.46.0 to v2.46.1; no other changes.
mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go, mod/node-api/backend/mocks/availability_store.mock.go, mod/node-api/backend/mocks/beacon_block_header.mock.go, mod/node-api/backend/mocks/beacon_state.mock.go, mod/node-api/backend/mocks/block_store.mock.go, mod/node-api/backend/mocks/deposit_store.mock.go, mod/node-api/backend/mocks/node.mock.go, mod/node-api/backend/mocks/state_processor.mock.go, mod/node-api/backend/mocks/storage_backend.mock.go, mod/node-api/backend/mocks/withdrawal.mock.go, mod/node-api/backend/mocks/withdrawal_credentials.mock.go Changed type parameters from interface{} to any for various structures and methods.
mod/primitives/pkg/crypto/mocks/bls_signer.mock.go Updated return types for PublicKey, Sign, and VerifySignature methods to use crypto.BLSPubkey and crypto.BLSSignature.

Sequence Diagram(s)

sequenceDiagram
    participant Mockery
    participant Developer
    participant Codebase

    Developer->>Mockery: Update mockery version to v2.46.1
    Mockery-->>Codebase: Generate updated mocks
    Developer->>Codebase: Review and merge changes
Loading

🐇 "In the land of code, where changes bloom,
A hop of version, dispelling gloom.
With types now clear, and mocks in line,
The rabbit dances, feeling fine!
From interface{} to any, we cheer,
For clearer paths, let’s all draw near!" 🐇


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.38%. Comparing base (dc08b08) to head (69af02c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2027   +/-   ##
=======================================
  Coverage   22.38%   22.38%           
=======================================
  Files         358      358           
  Lines       16045    16045           
  Branches       12       12           
=======================================
  Hits         3591     3591           
  Misses      12305    12305           
  Partials      149      149           
Flag Coverage Δ
22.38% <ø> (ø)

@abi87 abi87 marked this pull request as ready for review September 28, 2024 16:50
@abi87 abi87 self-assigned this Sep 28, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between dc08b08 and 69af02c.

📒 Files selected for processing (23)
  • mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go (1 hunks)
  • mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go (7 hunks)
  • mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (1 hunks)
  • mod/node-api/backend/mocks/availability_store.mock.go (5 hunks)
  • mod/node-api/backend/mocks/beacon_block_header.mock.go (13 hunks)
  • mod/node-api/backend/mocks/beacon_state.mock.go (28 hunks)
  • mod/node-api/backend/mocks/block_store.mock.go (6 hunks)
  • mod/node-api/backend/mocks/deposit_store.mock.go (5 hunks)
  • mod/node-api/backend/mocks/node.mock.go (3 hunks)
  • mod/node-api/backend/mocks/state_processor.mock.go (4 hunks)
  • mod/node-api/backend/mocks/storage_backend.mock.go (7 hunks)
  • mod/node-api/backend/mocks/validator.mock.go (1 hunks)
  • mod/node-api/backend/mocks/withdrawal.mock.go (4 hunks)
  • mod/node-api/backend/mocks/withdrawal_credentials.mock.go (1 hunks)
  • mod/node-core/pkg/services/registry/mocks/basic.mock.go (1 hunks)
  • mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go (1 hunks)
  • mod/node-core/pkg/services/registry/mocks/registry_option.mock.go (1 hunks)
  • mod/primitives/pkg/crypto/mocks/bls_signer.mock.go (6 hunks)
  • mod/storage/pkg/interfaces/mocks/db.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/beacon_block.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/block_event.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/prunable.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/pruner.mock.go (1 hunks)
🔇 Additional comments (90)
mod/storage/pkg/pruner/mocks/beacon_block.mock.go (1)

1-1: LGTM: Mockery version update.

The change from v2.46.0 to v2.46.1 is a minor version update, which typically includes bug fixes and small improvements. This update is appropriate and helps keep the project dependencies current.

As a reminder, it's good practice to keep generated files up-to-date with the latest stable versions of the tools used to generate them. This ensures that any bug fixes or improvements in the generation process are incorporated into your project.

mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go (1)

1-1: LGTM: Mockery version update.

The change updates the mockery version from v2.46.0 to v2.46.1. This is a minor version update and doesn't affect the functionality of the mock.

Let's verify if this change is consistent across other mock files in the project:

✅ Verification successful

Verified: All mock files have been updated to mockery v2.46.1 consistently across the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files have been updated to mockery v2.46.1

# Test: Search for mockery version in all .go files
# Expect: All results should show v2.46.1
rg --type go "mockery v2\.46\." -g "**/*.mock.go"

Length of output: 2469

mod/storage/pkg/pruner/mocks/prunable.mock.go (1)

1-1: LGTM: Mockery version update.

The change updates the mockery version from v2.46.0 to v2.46.1. This is a minor version update and doesn't affect the functionality of the mock.

Let's verify if this change is consistent across other mock files in the repository:

✅ Verification successful

LGTM: All mock files consistently updated to mockery v2.46.1.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files have been updated to mockery v2.46.1

# Test: Search for mockery version in all mock files
rg --type go "mockery v2\." -g "*.mock.go"

Length of output: 2462

mod/node-core/pkg/services/registry/mocks/registry_option.mock.go (1)

1-1: Mockery tool version updated.

The mockery tool version has been updated from v2.46.0 to v2.46.1. This is a minor version update and should not introduce any breaking changes or affect the functionality of the generated mock.

To ensure no unintended changes were introduced, let's verify the file content:

If this command returns any output, it would indicate changes other than the version update, which would require further investigation.

✅ Verification successful

Mockery tool version update verified.

The mockery tool was successfully updated from v2.46.0 to v2.46.1 without introducing any unintended changes to the file content.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that only the mockery version number has changed in the file.

# Test: Check for any changes other than the version number
rg -v "mockery v2.46.1" mod/node-core/pkg/services/registry/mocks/registry_option.mock.go

Length of output: 2227

mod/node-api/backend/mocks/node.mock.go (5)

1-1: LGTM: Mockery version update

The update from mockery v2.46.0 to v2.46.1 is a good practice to keep dependencies current. This minor version update likely includes bug fixes and small improvements.


8-8: LGTM: Type parameter update to any

The change from interface{} to any for the Node type parameter is a good modernization. It improves code readability and aligns with current Go practices for generics, without changing the underlying functionality.


12-12: LGTM: Consistent type parameter update

The change from interface{} to any for the Node_Expecter type parameter maintains consistency with the Node type update. This ensures uniformity across the mock types.


49-49: LGTM: Consistent type parameter update

The change from interface{} to any for the Node_CreateQueryContext_Call type parameter is consistent with the updates made to other types in the file. This ensures uniformity across all mock types and methods.


Line range hint 79-83: LGTM: Consistent type parameter update and overall improvement

The change from interface{} to any for the NewNode function signature is consistent with the updates made to other types and functions in the file. This ensures uniformity across the entire mock implementation.

Overall, these changes:

  1. Update the mockery version to the latest minor release.
  2. Modernize the code by using any instead of interface{}.
  3. Improve code readability without altering functionality.
  4. Maintain consistency across all mock types and functions.

These updates align the code with current Go best practices for generics and mock implementations.

mod/node-api/backend/mocks/withdrawal.mock.go (4)

13-13: LGTM. Improved type constraint.

The change from interface{} to any for the type parameter constraint is a good modernization. It improves readability without changing the functionality.


17-17: LGTM. Consistent type constraint update.

The change from interface{} to any for the Withdrawal_Expecter type parameter is consistent with the previous change. This maintains uniformity across the mock implementation.


44-44: LGTM. Consistent type constraint update.

The change from interface{} to any for the Withdrawal_New_Call type parameter maintains consistency with the previous changes. This ensures uniformity across all related types in the mock implementation.


1-1: LGTM. Verify mockery version consistency.

The update to mockery v2.46.1 is a minor version change, which is generally safe. However, it's important to ensure consistency across the project.

Run the following script to check for any inconsistencies in mockery versions:

✅ Verification successful

Mockery version is consistent across all mock files.

All mock files now use mockery v2.46.1, ensuring consistency within the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for inconsistencies in mockery versions across the project.

# Test: Search for mockery version declarations. Expect: All files should use v2.46.1
rg --type go "mockery v2\." -g "*.go"

Length of output: 2457

mod/node-api/backend/mocks/withdrawal_credentials.mock.go (1)

1-1: LGTM: Mockery version update.

The change from v2.46.0 to v2.46.1 in the mockery version is appropriate. This update keeps the mocking tool current and is unlikely to introduce any breaking changes or issues.

As a reminder, this is an auto-generated file. Any manual changes to this file will be overwritten the next time the mocks are regenerated. If modifications are needed, they should be made to the source file that this mock is based on, followed by regenerating the mock.

mod/node-core/pkg/services/registry/mocks/basic.mock.go (1)

Line range hint 2-115: LGTM: No unintended changes detected.

I've reviewed the entire file, and there are no other changes besides the version update in the header comment. The generated mock implementation follows standard practices for Go mocks and appears to be correct.

mod/storage/pkg/pruner/mocks/pruner.mock.go (1)

1-1: LGTM: Mockery version update.

The update from mockery v2.46.0 to v2.46.1 is a minor version bump, which is likely to include bug fixes or small improvements. This change is appropriate and doesn't affect the functionality of the mock.

Let's verify if this change is consistent across other mock files in the project:

✅ Verification successful

Verified: Consistent Mockery Version Update

All mock files have been updated to mockery v2.46.1, ensuring consistency across the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files have been updated to mockery v2.46.1

# Test: Search for mockery version declarations in mock files
# Expect: All mock files should use v2.46.1
rg --type go "mockery v2\.46\.[0-9]" -g "**/mocks/*.go"

Length of output: 2475

mod/node-api/backend/mocks/state_processor.mock.go (6)

1-1: LGTM: Mockery version update

The update to mockery v2.46.1 is a minor version bump, which is good practice for keeping dependencies up-to-date. This change aligns with the PR objective of running "make generate-check".


13-13: Approved: Type parameter update to any

The change from interface{} to any for the StateProcessor type parameter is a good modernization of the code. any is an alias for interface{} introduced in Go 1.18, offering improved readability without changing the behavior. This update aligns with current Go best practices.


17-17: LGTM: Consistent type parameter update

The change from interface{} to any for the StateProcessor_Expecter type parameter maintains consistency with the earlier StateProcessor update. This ensures uniformity across the mock implementation.


56-56: Approved: Consistent type parameter update

The change from interface{} to any for the StateProcessor_ProcessSlots_Call type parameter maintains consistency with the earlier updates to StateProcessor and StateProcessor_Expecter. This ensures uniformity across all related types in the mock implementation.


86-89: LGTM: Consistent type parameter update in NewStateProcessor

The change from interface{} to any in the NewStateProcessor function signature completes the transition to using any throughout the mock implementation. This update maintains consistency with all previous changes in the file, ensuring a uniform approach to type parameters.


Line range hint 1-89: Summary: Successful modernization of mock implementation

The changes in this file consistently update type parameters from interface{} to any across all relevant types and functions. This modernization improves code readability and aligns with current Go best practices without altering the functionality. The updates are consistent with the PR objective of running "make generate-check" and appear to be automatically generated changes. Overall, these modifications enhance the quality and maintainability of the mock implementation.

mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go (1)

1-1: LGTM: Mockery version update.

The update from mockery v2.46.0 to v2.46.1 is a minor version bump, which is good practice for keeping dependencies up-to-date. This change doesn't affect the functionality of the mock and is approved.

To ensure consistency across the project, let's verify if this change has been applied to other mock files:

✅ Verification successful

LGTM: Mockery version updated consistently across all mock files.

All mock files have been successfully updated to mockery v2.46.1, ensuring consistency throughout the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files have been updated to mockery v2.46.1

# Test: Search for mockery version in all mock files
rg --type go "mockery v2\.46\." $(fd -e go mock)

# Explanation: This should return only v2.46.1 if all files have been updated consistently.
# If any v2.46.0 or other versions are found, it indicates inconsistent updates.

Length of output: 3713

mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (1)

1-1: LGTM: Mockery version update.

The update from mockery v2.46.0 to v2.46.1 is a minor version bump, which is good practice for keeping dependencies up-to-date. This change doesn't affect the functionality of the mock.

Let's verify if this update is consistent across other mock files:

✅ Verification successful

Verification Successful: All mock files are using mockery v2.46.1.
The mockery version update is consistent across all mock files, ensuring uniformity and up-to-date dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files are using the same mockery version

# Test: Search for mockery version in all .go files
# Expect: All files should show v2.46.1
rg --type go "mockery v2\.\d+\.\d+" -g "**/*.mock.go"

Length of output: 2473

mod/node-api/backend/mocks/availability_store.mock.go (6)

1-1: LGTM: Mockery version update

The update from mockery v2.46.0 to v2.46.1 is a good practice to keep dependencies current. This minor version update likely includes bug fixes or small improvements.


13-15: LGTM: Type parameter update to any

The change from interface{} to any for the AvailabilityStore struct's type parameters is correct. This update aligns with Go 1.18+ generics syntax, improving code readability while maintaining the same functionality.


17-19: LGTM: Consistent type parameter update

The change from interface{} to any for the AvailabilityStore_Expecter struct's type parameters is consistent with the previous update. This maintains consistency across the mock implementation and improves overall code clarity.


44-46: LGTM: Consistent type parameter update for IsDataAvailable

The change from interface{} to any for the AvailabilityStore_IsDataAvailable_Call struct's type parameters is consistent with the previous updates. This maintains consistency across the mock implementation for the IsDataAvailable method.


92-94: LGTM: Consistent type parameter update for Persist

The change from interface{} to any for the AvailabilityStore_Persist_Call struct's type parameters is consistent with the previous updates. This maintains consistency across the mock implementation for the Persist method.


Line range hint 122-131: LGTM: Consistent type parameter update for NewAvailabilityStore

The change from interface{} to any for the NewAvailabilityStore function's type parameters is consistent with the previous updates to the structs. This ensures that the factory function for creating new mock instances uses the updated type parameters.

Overall, these changes consistently update the use of interface{} to any throughout the mock implementation, which aligns with Go 1.18+ generics syntax. This improves code readability and maintains consistency across the entire mock file.

mod/primitives/pkg/crypto/mocks/bls_signer.mock.go (9)

1-1: LGTM: Mockery version update.

The update from v2.46.0 to v2.46.1 is a minor version change, which typically includes bug fixes or small improvements. Keeping dependencies up to date is good practice.


6-6: LGTM: New import for crypto package.

The addition of the crypto package import is necessary for the type changes made in the mock. This import correctly references a package within the same project (beacon-kit).


24-24: LGTM: PublicKey method return type update.

The return type change from bytes.B48 to crypto.BLSPubkey for the PublicKey method aligns the mock with the actual implementation, using a more specific and appropriate type. The change is consistently applied across the method definition and its internal logic.

Also applies to: 31-32, 35-35


58-58: LGTM: PublicKey expecter method updates.

The return type changes to crypto.BLSPubkey in the PublicKey expecter methods are consistent with the main PublicKey method changes. This ensures that mock expectations are set up correctly with the new type.

Also applies to: 63-63


69-69: LGTM: Sign method return type update.

The return type change from bytes.B96 to crypto.BLSSignature for the Sign method aligns the mock with the actual implementation, using a more specific and appropriate type. The change is consistently applied across the method definition and its internal logic.

Also applies to: 76-76, 78-78, 81-81, 84-84


114-114: LGTM: Sign expecter method updates.

The return type changes to crypto.BLSSignature in the Sign expecter methods are consistent with the main Sign method changes. This ensures that mock expectations are set up correctly with the new type.

Also applies to: 119-119


125-125: LGTM: VerifySignature method parameter type updates.

The parameter type changes for pubKey to crypto.BLSPubkey and signature to crypto.BLSSignature in the VerifySignature method align the mock with the actual implementation. These changes use more specific and appropriate types and are consistent with the updates made to the PublicKey and Sign methods.

Also applies to: 133-133


148-150: LGTM: VerifySignature expecter method updates.

The parameter type changes and comment updates in the VerifySignature expecter methods are consistent with the main VerifySignature method changes. This ensures that mock expectations are set up correctly with the new types, and the updated comments provide accurate documentation for the method signature.

Also applies to: 155-155, 157-157, 167-167


Line range hint 1-185: Summary: Improved type safety and alignment with actual implementation.

This update to the BLSSigner mock consistently replaces custom byte types (e.g., bytes.B48, bytes.B96) with more specific types from the crypto package (e.g., crypto.BLSPubkey, crypto.BLSSignature). These changes:

  1. Improve type safety by using more specific types.
  2. Better align the mock with the actual implementation.
  3. Are part of a larger refactoring effort to use the crypto package types.

No logical changes or new functionality has been introduced. The updates are consistent throughout the file and should make the mock more accurate and easier to use correctly.

mod/storage/pkg/interfaces/mocks/db.mock.go (1)

1-1: LGTM! Mockery version update.

The change from mockery v2.46.0 to v2.46.1 is appropriate. Keeping tools up-to-date is a good practice.

Let's verify if this change is consistent across other mock files:

✅ Verification successful

All Mockery Versions are Consistent.

Verified that all mock files are using mockery v2.46.1.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all mock files are using the same mockery version

# Test: Search for mockery version in all mock files
rg --type go "mockery v2\.\d+\.\d+" -g "**/*.mock.go"

Length of output: 2473

mod/node-api/backend/mocks/deposit_store.mock.go (8)

1-1: LGTM: Mockery version update

The update from mockery v2.46.0 to v2.46.1 is a minor version change, which typically includes bug fixes or small improvements. This change is consistent with the PR objectives of running "make generate-check".


8-10: Approved: Type parameter update improves readability

The change from interface{} to any in the DepositStore struct definition is a positive update. any is an alias for interface{} introduced in Go 1.18, which improves code readability without changing the behavior. This modernization aligns with current Go best practices.


12-14: Approved: Consistent type parameter update

The change from interface{} to any in the DepositStore_Expecter struct definition is consistent with the previous update to the DepositStore struct. This maintains consistency throughout the mock implementation, which is a good practice.


39-41: Approved: Consistent type parameter update

The change from interface{} to any in the DepositStore_EnqueueDeposits_Call struct definition continues the pattern of modernizing the type system usage in the mock. This consistency across the file is commendable.


97-99: Approved: Consistent type parameter update

The change from interface{} to any in the DepositStore_GetDepositsByIndex_Call struct definition maintains consistency with the previous updates in the file. This consistent approach to modernizing the mock's type system usage is crucial for maintaining code quality and readability.


144-146: Approved: Consistent type parameter update

The change from interface{} to any in the DepositStore_Prune_Call struct definition completes the pattern of modernizing the type system usage for all struct definitions in the mock. This consistency throughout the entire file is excellent and improves overall code quality.


Line range hint 174-182: Approved: Consistent type parameter update and summary

The change from interface{} to any in the NewDepositStore function signature completes the modernization of the type system usage for the entire mock implementation. This consistent update throughout the file improves code readability without altering the behavior of the mock.

Overall, these changes:

  1. Modernize the code to use Go 1.18+ type system features
  2. Improve code readability
  3. Maintain consistent type usage across the entire mock implementation

Great job on maintaining consistency and improving the code quality!


Line range hint 1-182: Summary: Successful modernization of mock implementation

This review has covered all changes in the deposit_store.mock.go file. The updates consistently replace interface{} with any as type parameters throughout the mock implementation. These changes:

  1. Align with modern Go practices (Go 1.18+)
  2. Improve code readability
  3. Maintain consistent type usage across the entire mock
  4. Do not alter the behavior of the mock implementation

The changes are in line with the PR objectives of running "make generate-check" and represent a successful modernization of the mock code. No issues or concerns were identified during this review.

mod/node-api/backend/mocks/validator.mock.go (1)

1-1: LGTM! Mockery version update.

The change from v2.46.0 to v2.46.1 in the mockery version is appropriate. This minor version update likely includes bug fixes or small improvements in the mock generation process.

To ensure consistency across the project, please run the following script to check if all mock files have been updated to use the same mockery version:

This will help identify any mock files that might have been missed during the update process.

✅ Verification successful

Mockery Version Consistently Updated Across All Mock Files.

All mock files have been updated to use mockery v2.46.1, ensuring consistency throughout the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify mockery version consistency across mock files

# Test: Search for mockery version declarations in mock files
rg --type go "mockery v2\.\d+\.\d+" -g "**/mocks/*.go"

Length of output: 2474

mod/node-api/backend/mocks/block_store.mock.go (7)

1-1: LGTM: Mockery version update.

The mockery version has been updated from v2.46.0 to v2.46.1. This minor version update is consistent with the PR objective and likely includes bug fixes or small improvements.


13-15: LGTM: Type parameter update to any.

The type parameter for BlockStore has been updated from interface{} to any. This change aligns with modern Go practices and improves code readability without altering functionality.


17-19: LGTM: Consistent type parameter update.

The type parameter for BlockStore_Expecter has been updated from interface{} to any, maintaining consistency with the BlockStore type update.


54-56: LGTM: Consistent type parameter update for GetSlotByBlockRoot_Call.

The type parameter for BlockStore_GetSlotByBlockRoot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates in this file.


110-112: LGTM: Consistent type parameter update for GetSlotByExecutionNumber_Call.

The type parameter for BlockStore_GetSlotByExecutionNumber_Call has been updated from interface{} to any, maintaining consistency with the previous type updates in this file.


166-168: LGTM: Consistent type parameter updates for GetSlotByStateRoot_Call and NewBlockStore.

The type parameter for BlockStore_GetSlotByStateRoot_Call and the NewBlockStore function signature have been updated from interface{} to any. These changes maintain consistency with the previous updates in this file and ensure that the type parameter change is applied throughout the mock implementation.

Also applies to: 195-204


Line range hint 1-204: Summary: Consistent type parameter updates throughout the file.

All changes in this file follow a consistent pattern of updating type parameters from interface{} to any. These updates:

  1. Improve code readability
  2. Align with modern Go practices
  3. Maintain consistency across all related types and functions in the mock implementation

The changes are in line with the PR objective of running "make generate-check" and do not introduce any functional changes or potential issues.

mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go (8)

1-1: LGTM: Mockery version update.

The mockery version has been updated from v2.46.0 to v2.46.1. This minor version update is consistent with the PR objectives and likely includes bug fixes and small improvements.


13-15: LGTM: Type parameter update to any.

The type parameter for BuiltExecutionPayloadEnv has been updated from interface{} to any. This change improves type safety and readability, aligning with modern Go practices introduced in Go 1.18+.


17-19: LGTM: Consistent type parameter update.

The type parameter for BuiltExecutionPayloadEnv_Expecter has been updated from interface{} to any, maintaining consistency with the previous struct and throughout the file.


46-48: LGTM: Consistent type parameter update.

The type parameter for BuiltExecutionPayloadEnv_GetBlobsBundle_Call has been updated from interface{} to any, maintaining consistency with the previous structs and throughout the file.


91-93: LGTM: Consistent type parameter update.

The type parameter for BuiltExecutionPayloadEnv_GetExecutionPayload_Call has been updated from interface{} to any, maintaining consistency with the previous structs and throughout the file.


138-140: LGTM: Consistent type parameter update.

The type parameter for BuiltExecutionPayloadEnv_GetValue_Call has been updated from interface{} to any, maintaining consistency with the previous structs and throughout the file.


183-185: LGTM: Consistent type parameter updates.

The type parameters for BuiltExecutionPayloadEnv_ShouldOverrideBuilder_Call and NewBuiltExecutionPayloadEnv function have been updated from interface{} to any. These changes maintain consistency throughout the file and ensure that the entire mock structure uses the updated type parameter.

Also applies to: 211-215


Line range hint 1-221: Summary: Mockery update and type parameter improvements.

This auto-generated mock file has been updated as part of running make generate-check. The changes include:

  1. Updating the mockery version from v2.46.0 to v2.46.1.
  2. Replacing all occurrences of interface{} with any in type parameters.

These changes improve type safety and readability while maintaining consistency throughout the file. They align with modern Go practices (Go 1.18+) and the PR objectives.

mod/node-api/backend/mocks/storage_backend.mock.go (7)

1-1: LGTM: Mockery version update

The mockery version has been updated from v2.46.0 to v2.46.1. This minor version update is consistent with the PR objective of running "make generate-check" and likely includes bug fixes and small improvements.


12-14: LGTM: Type parameter update to any

The type parameters for the StorageBackend struct have been updated from interface{} to any. This change improves code readability without altering functionality, as any is an alias for interface{} in Go 1.18+. The update is consistent with modern Go practices.


16-18: LGTM: Consistent type parameter update

The StorageBackend_Expecter struct has been updated to use any instead of interface{} for its type parameters, maintaining consistency with the StorageBackend struct update. This change enhances code readability while preserving the mock's functionality.


43-45: LGTM: Consistent type parameter update for AvailabilityStore

The StorageBackend_AvailabilityStore_Call struct has been updated to use any instead of interface{} for its type parameters. This change is consistent with the updates made to other structs in the file and maintains the mock implementation's consistency for the AvailabilityStore method.


88-90: LGTM: Consistent type parameter update for BlockStore

The StorageBackend_BlockStore_Call struct has been updated to use any instead of interface{} for its type parameters. This change aligns with the updates made to other structs in the file and ensures consistency in the mock implementation for the BlockStore method.


133-135: LGTM: Consistent type parameter update for DepositStore

The StorageBackend_DepositStore_Call struct has been updated to use any instead of interface{} for its type parameters. This change is in line with the updates made to other structs in the file and maintains consistency in the mock implementation for the DepositStore method.


Line range hint 207-214: LGTM: Consistent type parameter update and overall changes

The NewStorageBackend function signature has been updated to use any instead of interface{} for its type parameters. This change is consistent with the updates made to all structs in the file.

Overall, this file update demonstrates a systematic replacement of interface{} with any for all generic type parameters. These changes improve code readability and align with modern Go practices without altering the functionality of the mock implementation. The consistency of these changes across all relevant structures and functions in the file is commendable.

mod/node-api/backend/mocks/beacon_block_header.mock.go (13)

1-1: LGTM: Mockery version update

The mockery version has been updated from v2.46.0 to v2.46.1. This minor version update is consistent with the PR objectives and likely includes bug fixes and small improvements.


13-13: LGTM: Updated type parameter to any

The type parameter for BeaconBlockHeader has been updated from interface{} to any. This change improves code readability and aligns with modern Go practices without altering the behavior.


17-17: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_Expecter has been updated from interface{} to any, maintaining consistency with the BeaconBlockHeader type update.


46-46: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_GetBodyRoot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


93-93: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_GetParentBlockRoot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


138-138: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_GetProposerIndex_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


183-183: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_GetSlot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


230-230: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_GetStateRoot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


277-277: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_HashTreeRoot_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


334-334: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_MarshalSSZ_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


379-379: LGTM: Consistent type parameter update

The type parameter for BeaconBlockHeader_New_Call has been updated from interface{} to any, maintaining consistency with the previous type updates.


Line range hint 491-501: LGTM: Consistent type parameter update in function signature

The type parameter for the NewBeaconBlockHeader function has been updated from interface{} to any, maintaining consistency with the previous type updates. The function body remains unchanged, ensuring that the behavior is preserved.


Line range hint 1-501: Summary: Consistent updates improving code readability

This review covered all changes in the beacon_block_header.mock.go file. The primary modifications include:

  1. Updating the mockery version from v2.46.0 to v2.46.1.
  2. Consistently changing type parameters from interface{} to any across all related types and functions.

These changes improve code readability and align with modern Go practices without altering the behavior of the mock implementations. The updates are consistent and well-applied throughout the file.

mod/node-api/backend/mocks/beacon_state.mock.go (6)

1-1: Mockery version update looks good.

The update from v2.46.0 to v2.46.1 is a minor version change, which typically includes bug fixes or small improvements. Keeping dependencies up-to-date is a good practice.


9-10: New import for crypto package is appropriate.

The addition of the crypto package import is consistent with the upcoming changes in the ValidatorIndexByPubkey method signature. This import is necessary for using the crypto.BLSPubkey type.


17-17: Type parameter updates improve code modernity.

The change from interface{} to any for type parameters is a positive modernization of the Go code. any is an alias for interface{} introduced in Go 1.18, which simplifies generic code. This change doesn't affect functionality but improves readability and aligns with modern Go practices.

Also applies to: 21-21, 60-60, 115-115, 173-173, 229-229, 284-284, 339-339, 396-396, 451-451, 506-506, 561-561, 616-616, 673-673, 729-729, 785-785, 840-840, 896-896, 951-951, 1006-1006, 1063-1063, 1108-1108, 1166-1166, 1222-1222, 1278-1278, 1334-1334, 1363-1363


1339-1339: ValidatorIndexByPubkey mock implementation correctly updated.

The mock implementation for ValidatorIndexByPubkey has been correctly updated to use crypto.BLSPubkey, which is consistent with the method signature change. This ensures that the mock behaves correctly with the new type.

Also applies to: 1344-1344, 1346-1346, 1356-1356


Line range hint 1-1373: Overall, the changes improve code quality and type safety.

This update to the beacon_state.mock.go file includes several improvements:

  1. Updating the mockery version from v2.46.0 to v2.46.1.
  2. Modernizing the code by changing type parameters from interface{} to any.
  3. Improving type safety by updating the ValidatorIndexByPubkey method to use crypto.BLSPubkey instead of bytes.B48.

These changes align the code with modern Go practices and enhance type safety. The modifications are consistent throughout the file and should improve the overall quality and maintainability of the codebase.


1306-1306: ValidatorIndexByPubkey signature update improves type safety.

The change from bytes.B48 to crypto.BLSPubkey for the ValidatorIndexByPubkey method parameter improves type safety and clarity. This update likely reflects changes in the underlying types used for public keys in the system.

To ensure this change is consistent across the codebase, please run the following command:

This will help identify any other occurrences of bytes.B48 used for validator public keys that might need to be updated for consistency.

Also applies to: 1315-1315, 1318-1318, 1324-1324

Comment on lines +76 to 79
func NewWithdrawal[T any](t interface {
mock.TestingT
Cleanup(func())
}) *Withdrawal[T] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

LGTM. Consistent update completes the modernization.

The change from interface{} to any in the NewWithdrawal function signature is consistent with all previous changes. This completes the update of all generic type parameters to use any, resulting in a more modern and readable codebase.

Consider running a project-wide search and replace to update any remaining interface{} to any in similar contexts, ensuring consistency across the entire codebase.

@@ -1,4 +1,4 @@
// Code generated by mockery v2.46.0. DO NOT EDIT.
// Code generated by mockery v2.46.1. DO NOT EDIT.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Issue: Mockery version v2.46.1 is updated in generated mocks but not specified in project configuration.

While the generated mock files have been updated to use mockery version v2.46.1, the project's configuration files do not explicitly specify this version. This oversight can lead to inconsistencies when generating mocks across different environments or during automated processes.

  • Action Items:
    • Specify mockery version v2.46.1 in the project's configuration files (e.g., go.mod, Makefile, Dockerfile) to ensure consistency.
    • Verify that all development and CI/CD environments reference the specified mockery version.
🔗 Analysis chain

LGTM: Mockery version updated.

The mockery version has been updated from v2.46.0 to v2.46.1. This is a minor version update and should not introduce any breaking changes.

To ensure consistency across the project, please verify that the mockery tool version used in the project's build process matches this update. Run the following script to check the mockery version in the project configuration:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check mockery version in project configuration

# Test: Search for mockery version in project files
rg --type yaml --type json "mockery.*v2\.46\.1" .

Length of output: 51


Script:

#!/bin/bash
# Description: Broadly search for mockery version in all relevant project files

# Test: Search for mockery version across all files
rg "mockery.*v2\.46\.1" .

Length of output: 2491

@@ -1,4 +1,4 @@
// Code generated by mockery v2.46.0. DO NOT EDIT.
// Code generated by mockery v2.46.1. DO NOT EDIT.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

LGTM: Mockery version update.

The change updates the mockery version from v2.46.0 to v2.46.1 in the generated file header. This is a minor version update and doesn't introduce any visible changes to the generated code.

Ensure that all generated mock files are updated consistently across the project to maintain version uniformity. Consider adding a step in your CI/CD pipeline to verify the consistency of mockery versions used in generated files.

@itsdevbear itsdevbear merged commit b6c134d into main Sep 28, 2024
16 checks passed
@itsdevbear itsdevbear deleted the appease-generate-check branch September 28, 2024 17:13
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.

2 participants