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

feat: generated bindings from v1.12.10-testnet for injective-std #219

Merged
merged 3 commits into from
May 3, 2024

Conversation

maxrobot
Copy link
Contributor

@maxrobot maxrobot commented May 2, 2024

Generated bindings from v1.12.10-testnet

Summary by CodeRabbit

  • New Features

    • Introduced new structures and messages related to fee allowances in the cosmos/feegrant module.
  • Documentation

    • Enhanced documentation clarity in injective-std README with updated commit hashes and specified shell types in code blocks.
  • Refactor

    • Reorganized module declarations in injective-protobuf for improved logical grouping.
    • Adjusted derive attributes across various structs to streamline serialization and deserialization processes.

Copy link

coderabbitai bot commented May 2, 2024

Walkthrough

The recent changes encompass restructuring derive attributes in Rust structures for enhanced serialization and messaging traits across various packages. Additionally, updates include version modifications, documentation enhancements for clarity, and reordering of module declarations, reflecting a significant refinement in code maintainability and documentation standards.

Changes

Files Summary
.../proto/mod.rs and similar Reordered module declarations.
.../Cargo.toml Version updated from "0.1.7" to "1.12.10-testnet".
.../README.md Updated commit hash and specified shell types in code blocks for clarity.
.../src/types/cosmos/... Adjusted derive attributes, removing serialization and schema traits for better structuring.
.../src/types/injective/insurance/v1beta1.rs Removed EventInsuranceWithdraw struct declaration from EventUnderwrite.

🐇✨
In the realm of code, where changes dance,
A rabbit weaves through files, enhancing the stance.
Traits refined, versions soar,
Documentation shines, like never before.
Celebrate the craft, meticulous and grand,
For in clean code, beauty finds its stand.
🌿🌕


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 172c613 and db25f6a.
Files selected for processing (3)
  • packages/injective-protobuf/src/proto/mod.rs (1 hunks)
  • packages/injective-std/src/types/cosmos/base/query/v1beta1.rs (2 hunks)
  • packages/injective-std/src/types/cosmos/base/v1beta1.rs (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • packages/injective-protobuf/src/proto/mod.rs
  • packages/injective-std/src/types/cosmos/base/query/v1beta1.rs
  • packages/injective-std/src/types/cosmos/base/v1beta1.rs

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
Member

@gorgos gorgos left a comment

Choose a reason for hiding this comment

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

looks good but something is weird

@@ -18,7 +18,7 @@ pub struct Coin {
/// signatures required by gogoproto.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoinDecCoin")]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoinDecCoinDecCoin")]
Copy link
Member

Choose a reason for hiding this comment

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

what is this?

packages/injective-std/Cargo.toml Show resolved Hide resolved
@@ -5,7 +5,7 @@ use osmosis_std_derive::CosmwasmExt;
/// signatures required by gogoproto.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoin")]
#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoinCoin")]
Copy link
Member

Choose a reason for hiding this comment

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

CoinCoinCoin ?

@gorgos gorgos changed the title self explanatory feat: generated bindings from v1.12.10-testnet for injective-std May 2, 2024
Copy link

@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: 30

Out of diff range and nitpick comments (41)
packages/injective-std/src/types/cosmos/bank/v1beta1.rs (41)

7-8: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


22-23: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


40-41: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


51-52: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


62-63: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


75-76: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


86-87: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


111-112: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


152-153: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


178-179: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


191-192: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


208-209: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


218-219: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


238-239: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


256-257: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


278-279: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


296-297: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


316-317: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


327-328: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


346-347: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


363-364: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


377-378: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


387-388: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


397-398: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


406-407: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


423-424: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


438-439: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


453-454: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


465-466: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


488-489: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


503-504: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


519-520: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


541-542: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


556-557: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


569-570: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


575-576: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


588-589: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


596-597: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


614-615: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


626-627: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].


646-647: Ensure consistency in attribute ordering for readability and maintainability.

Consider maintaining a consistent order of attributes across different structs for better readability and maintainability. For example, always placing #[derive(...)] before #[proto_message(...)].

Comment on lines 6 to 7
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in derive attribute usage.

The derive attributes for serialization traits (::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt) are separated from the core traits (Clone, PartialEq, Eq, ::prost::Message). Consider combining them into a single derive block for better readability and consistency, unless there's a specific reason for separation.

Comment on lines 24 to 25
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in derive attribute usage.

Similar to the previous comment, consider combining the derive attributes into a single block for the TextProposal struct to maintain consistency and improve readability.

Comment on lines 38 to 39
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in derive attribute usage.

For the Deposit struct, consider combining the derive attributes into a single block to maintain consistency across the file and improve code readability.

Comment on lines 59 to 60
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in derive attribute usage.

For the Proposal struct, consider combining the derive attributes into a single block to maintain consistency across the file and improve code readability.

Comment on lines 104 to 105
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in derive attribute usage.

For the TallyResult struct, consider combining the derive attributes into a single block to maintain consistency across the file and improve code readability.

Comment on lines 186 to 187
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Combine separate derive statements to enhance code maintainability.

- #[derive(Clone, PartialEq, Eq, ::prost::Message)]
- #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+ #[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]

This refactoring helps in keeping the code clean and easy to understand.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]

Comment on lines 233 to 234
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Merge derive attributes to simplify the code structure.

- #[derive(Clone, PartialEq, Eq, ::prost::Message)]
- #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+ #[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]

This change consolidates the attribute declarations, making the code more concise and easier to read.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]

Comment on lines 4 to 5
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Several files in the codebase still use the old function signature. The specific derive attributes (::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt) were not found in any of the checked files, suggesting that the changes are not consistently applied across all modules. It is recommended to review and ensure that the new derive attributes are correctly and uniformly implemented where necessary.

  • packages/injective-std/src/types/cosmos/auth/module/v1.rs
  • packages/injective-std/src/types/cosmos/authz/module/v1.rs
  • packages/injective-std/src/types/cosmos/bank/module/v1.rs
  • packages/injective-std/src/types/cosmos/distribution/module/v1.rs
  • packages/injective-std/src/types/cosmos/gov/module/v1.rs
  • packages/injective-std/src/types/cosmos/params/module/v1.rs
  • packages/injective-std/src/types/cosmos/feegrant/module/v1.rs
  • packages/injective-std/src/types/cosmwasm/wasm/v1.rs
  • packages/injective-std/src/types/injective/wasmx/v1.rs
Analysis chain

Identical changes to derive attributes as seen in other modules. This standardization enhances clarity and maintainability. Ensure consistency across all modules.


This script aims to list all Rust files in the specified directory and then check each file for the presence of the specific derive attributes, providing a count of occurrences. This approach ensures that no files are missed and gives a clear indication of where the attributes are used.


This script uses xargs to handle the output of find more robustly, ensuring that each file is properly checked for the presence of the specific derive attributes. This approach should avoid the file descriptor issue encountered in the previous script.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the changes to derive attributes in `module/v1.rs` are consistently applied across all modules in the project.

# Find all Rust files in the `types` directory and check for consistent application of the new derive attribute strategy.
rg --files-with-matches --type rust $'#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]' packages/injective-std/src/types/ | while read file; do
  # Test: Ensure that the new derive attribute strategy is applied consistently. Expect: Consistent application across all modules.
  rg '#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]' "$file"
done

Length of output: 174



Script:

#!/bin/bash
# Description: Re-verify the application of new derive attributes across all Rust files in the `types` directory.

# First, list all Rust files in the `types` directory.
find packages/injective-std/src/types/ -type f -name "*.rs" -print

# Then, for each Rust file, check if it contains the specific derive attributes.
while read file; do
  echo "Checking file: $file"
  rg --count '#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]' "$file"
done < <(find packages/injective-std/src/types/ -type f -name "*.rs")

Length of output: 3377



Script:

#!/bin/bash
# Description: Re-verify the application of new derive attributes across all Rust files in the `types` directory using a more robust file handling approach.

# List all Rust files in the `types` directory and check each for the specific derive attributes using xargs for better handling.
find packages/injective-std/src/types/ -type f -name "*.rs" | xargs -I {} sh -c 'echo "Checking file: {}"; rg --count "#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]" {}'

Length of output: 4200

Comment on lines 4 to 5
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Several files in the codebase still lack detailed documentation and tests for ConfigResponse:

  • packages/injective-std/src/types/cosmos/base/node/v1beta1.rs: The struct ConfigResponse is defined but lacks detailed documentation and specific tests for the field minimum_gas_price.
Analysis chain

Consistent changes to derive attributes as seen in other modules. Ensure that the specific fields in ConfigResponse are properly documented and tested.

Also applies to: 10-11

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the specific fields in `ConfigResponse` are properly documented and tested across the project.

# Find all Rust files that use `ConfigResponse` struct from `base/node` module and check for documentation and tests.
rg --files-with-matches --type rust $'use .*::ConfigResponse;' | while read file; do
  # Test: Ensure that the specific fields are documented and covered by tests. Expect: Proper documentation and test coverage.
  rg 'ConfigResponse::.*{minimum_gas_price}' "$file"
done

Length of output: 75



Script:

#!/bin/bash
# Description: Broaden the search to verify documentation and testing of `ConfigResponse` across the project.

# Find all Rust files that mention `ConfigResponse` and check for any associated documentation and tests.
rg --files-with-matches --type rust 'ConfigResponse' | while read file; do
  # Check for any comments or test annotations related to `ConfigResponse`.
  rg -C 3 'ConfigResponse' "$file"
done

Length of output: 1489

Comment on lines 4 to 5
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Several files in the codebase document the fields max_metadata_len and authority, but no specific tests were found for these fields. It is recommended to add targeted tests to ensure their functionality and reliability.

  • Documented in:
    • packages/injective-std/src/types/injective/tokenfactory/v1beta1.rs
    • packages/injective-std/src/types/injective/wasmx/v1.rs
    • packages/injective-std/src/types/injective/insurance/v1beta1.rs
    • packages/injective-std/src/types/injective/exchange/v1beta1.rs
    • packages/injective-std/src/types/injective/oracle/v1beta1.rs
    • packages/injective-std/src/types/injective/auction/v1beta1.rs
    • packages/injective-std/src/types/cosmwasm/wasm/v1.rs
    • packages/injective-std/src/types/cosmos/staking/v1beta1.rs
    • packages/injective-std/src/types/cosmos/distribution/v1beta1.rs
    • packages/injective-std/src/types/cosmos/gov/module/v1.rs
    • packages/injective-std/src/types/cosmos/distribution/module/v1.rs
    • packages/injective-std/src/types/cosmos/gov/v1.rs
    • packages/injective-std/src/types/cosmos/auth/v1beta1.rs
    • packages/injective-std/src/types/cosmos/auth/module/v1.rs
    • packages/injective-std/src/types/cosmos/bank/v1beta1.rs
    • packages/injective-std/src/types/cosmos/bank/module/v1.rs
Analysis chain

Consistent changes to derive attributes as seen in other modules. Specific fields enhance governance module configuration capabilities. Ensure these fields are properly documented and tested.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the specific fields in `Module` are properly documented and tested across the project.

# Find all Rust files that use `Module` struct from `gov` module and check for documentation and tests.
rg --files-with-matches --type rust $'use .*::Module;' | while read file; do
  # Test: Ensure that the specific fields are documented and covered by tests. Expect: Proper documentation and test coverage.
  rg 'Module::.*{max_metadata_len, authority}' "$file"
done

Length of output: 67



Script:

#!/bin/bash
# Description: Re-verify the presence and usage of the `Module` struct and its specific fields in the codebase.

# Step 1: Find all Rust files that define or use the `Module` struct.
rg --files-with-matches --type rust 'struct Module' -l

# Step 2: Check for the usage of the specific fields `max_metadata_len` and `authority` in these files.
rg --files-with-matches --type rust 'max_metadata_len|authority' -l

# Step 3: Verify documentation and tests for these fields.
rg --files-with-matches --type rust '///.*max_metadata_len|///.*authority' -l
rg --files-with-matches --type rust '#\[test\].*max_metadata_len|#[test].*authority' -l

Length of output: 2807

@maxrobot maxrobot requested a review from gorgos May 3, 2024 08:55
@gorgos gorgos merged commit aa8d4fe into dev May 3, 2024
4 checks passed
@gorgos gorgos deleted the f/v1.12.10-testnet branch May 3, 2024 09:08
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