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

fix: chore msg factories #323

Merged
merged 4 commits into from
Feb 22, 2024
Merged

fix: chore msg factories #323

merged 4 commits into from
Feb 22, 2024

Conversation

cgilbe27
Copy link
Contributor

@cgilbe27 cgilbe27 commented Feb 21, 2024

Closes #320
Adds all missing msg factories

Summary by CodeRabbit

  • New Features

    • Introduced new encoding and decoding functionality for transaction messages in the devgas, inflation, oracle, sudo, and tokenfactory modules.
    • Added new message types and factories for creating transaction messages related to fee shares, inflation parameters, oracle transactions, sudo operations, and token factory actions.
  • Refactor

    • Reordered exports in the GraphQL query index to optimize module accessibility.
    • Updated message factory in encode-types.ts to support new modules.
  • Tests

    • Modified test names and variables in epochs.test.ts to align with updated request and response naming conventions.
  • Documentation

    • Adjustments and clarifications in documentation to reflect new features and refactoring efforts.

@cgilbe27 cgilbe27 self-assigned this Feb 21, 2024
Copy link
Contributor

coderabbitai bot commented Feb 21, 2024

Walkthrough

The updates encompass enhancements and the introduction of new functionalities across various modules, primarily focusing on message encoding and decoding for specific operations like devgas, inflation, oracle, sudo, and tokenfactory. Additionally, there's a reorganization of exports and renaming in the query and message sectors to streamline operations and improve clarity in the SDK's structure.

Changes

Files Change Summary
src/gql/query/index.ts Reordered exports of modules.
src/sdk/msg/devgas.ts Introduced encoding/decoding for devgas operations.
src/sdk/msg/inflation.ts Added functionality for inflation parameter editing and toggling.
src/sdk/msg/oracle.ts New encoding/decoding for oracle transactions.
src/sdk/msg/sudo.ts Introduced sudo message encoding/handling.
src/sdk/msg/tokenfactory.ts Added token factory message encoding and transaction message creation.
src/sdk/msg/encode-types.ts,
src/sdk/msg/index.ts
Updated MsgFactory and added exports for new modules.
src/sdk/query/epochs.test.ts,
src/sdk/query/epochs.ts
Renamed QueryEpochsInfoRequest/Response to QueryEpochInfosRequest/Response.

🐇✨

In the realm of code, where changes abound,
A rabbit hopped in, making leaps and bounds.
With a flick and a hop, updates were sown,
In the fields of the SDK, new seeds grown.
Encoding messages, with a swift touch,
'Twas a task for many, but for this rabbit, not much.
🌟🐰

🥕🥕🥕

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9e7cadf and 56f4267.
Files selected for processing (10)
  • src/gql/query/index.ts (1 hunks)
  • src/sdk/msg/devgas.ts (1 hunks)
  • src/sdk/msg/encode-types.ts (1 hunks)
  • src/sdk/msg/index.ts (1 hunks)
  • src/sdk/msg/inflation.ts (1 hunks)
  • src/sdk/msg/oracle.ts (1 hunks)
  • src/sdk/msg/sudo.ts (1 hunks)
  • src/sdk/msg/tokenfactory.ts (1 hunks)
  • src/sdk/query/epochs.test.ts (1 hunks)
  • src/sdk/query/epochs.ts (2 hunks)
Additional comments: 4
src/sdk/msg/index.ts (1)
  • 5-12: The addition of exports for devgas, inflation, oracle, sudo, and tokenfactory modules aligns with the PR's objectives and follows TypeScript best practices for module exports. These changes enhance the project's messaging capabilities as intended.
src/gql/query/index.ts (1)
  • 13-22: The reordering of exports in src/gql/query/index.ts appears to be aimed at improving organization. While generally safe, it's recommended to verify that this change does not impact dependent modules, especially if there are any load order dependencies or implicit assumptions about the order of exports.
Verification successful

The verification process did not find direct imports of the reordered modules markPriceCandles and spotPoolSwap using the specific search pattern provided. This suggests that the reordering of exports in src/gql/query/index.ts is unlikely to impact dependent modules, assuming that imports are correctly specified elsewhere in the project. It's generally safe to reorder exports in TypeScript/JavaScript projects without affecting functionality. However, it's always good practice to perform thorough testing to ensure no unintended side effects occur.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify if the reordering affects any dependent modules explicitly relying on the previous order.
# This script is a placeholder and should be adjusted based on the project's specific verification needs.
echo "Manual verification recommended to ensure no impact on dependent modules."

Length of output: 156



Script:

#!/bin/bash
# Search for imports of the reordered modules across the project to verify if the reordering has any impact.

# List of reordered modules for reference
modules=("markPriceCandles" "spotPoolSwap")

# Loop through each module and search for imports across the project
for module in "${modules[@]}"; do
    echo "Searching for imports of $module..."
    rg --glob '!node_modules/*' "from './$module'"
    echo "----------------------------------------"
done

Length of output: 601

src/sdk/msg/encode-types.ts (1)
  • 2-23: The updates to MsgFactory in encode-types.ts, including the addition of new message factories for Devgas, Inflation, Oracle, Sudo, and Tokenfactory, align with the PR's objectives to enhance the project's messaging capabilities. Ensure that these new factories are correctly implemented and integrated within the project.
Verification successful

The verification process confirms the addition and correct implementation of new message factories (DevgasMsgFactory, InflationMsgFactory, OracleMsgFactory, SudoMsgFactory, TokenfactoryMsgFactory) in encode-types.ts, as well as their correct import and usage within the project. This aligns with the objectives mentioned in the review comment, enhancing the project's messaging capabilities.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Placeholder script for verifying the correct implementation and integration of new message factories.
echo "Manual verification recommended to ensure correct implementation and integration of new message factories."

Length of output: 222



Script:

#!/bin/bash
# Searching for class definitions of the new message factories to confirm their existence.
ast-grep --lang typescript --pattern $'class $_ extends $_ {
  $$$
}' | grep -E 'DevgasMsgFactory|InflationMsgFactory|OracleMsgFactory|SudoMsgFactory|TokenfactoryMsgFactory'

# Checking for import statements of these factories in `encode-types.ts` and possibly other references in the project.
rg 'DevgasMsgFactory|InflationMsgFactory|OracleMsgFactory|SudoMsgFactory|TokenfactoryMsgFactory' -tts

Length of output: 1133

src/sdk/query/epochs.ts (1)
  • 6-15: The renaming of QueryEpochsInfoRequest to QueryEpochInfosRequest and QueryEpochsInfoResponse to QueryEpochInfosResponse in epochs.ts improves naming clarity and consistency. Ensure that all references to these interfaces throughout the project have been updated to reflect the new names.
Verification successful

The renaming of QueryEpochsInfoRequest to QueryEpochInfosRequest and QueryEpochsInfoResponse to QueryEpochInfosResponse in epochs.ts has been successfully verified. No occurrences of the old interface names were found in the codebase, indicating that all references have been updated to reflect the new names.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Placeholder script for verifying that all references to the renamed interfaces have been updated.
echo "Manual verification recommended to ensure all references to the renamed interfaces have been updated."

Length of output: 212



Script:

#!/bin/bash
# Searching for occurrences of the old interface names to verify if they've been updated.
rg "QueryEpochsInfoRequest|QueryEpochsInfoResponse"

Length of output: 53

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 56f4267 and 17bfb09.
Files selected for processing (1)
  • .github/workflows/test-ts-sdk.yaml (2 hunks)
Additional comments: 2
.github/workflows/test-ts-sdk.yaml (2)
  • 32-32: The update of the reference branch from releases/v0.21.x to main for the nibiru repository checkout step is noted. Ensure that the main branch contains all necessary changes and is stable for use in this workflow. This change could affect the behavior of subsequent steps if the main branch is significantly different from the previously used branch. It's important to verify that all dependencies and configurations in the main branch are compatible with the ts-sdk project to avoid build or test failures.
  • 29-35: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [28-32]

Although the removal of a checkout step is mentioned in the summary, the provided code snippet still includes the checkout step for the nibiru repository. If the removal has indeed taken place elsewhere in the workflow, it's crucial to assess the impact of this change on the workflow's functionality. The checkout of the nibiru repository might be necessary for certain build or test steps, especially if they depend on artifacts or configurations from that repository. Verify that all necessary components are still accessible and that the workflow can function correctly without this step.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 17bfb09 and 9507e3e.
Files selected for processing (2)
  • scripts/build.sh (1 hunks)
  • scripts/protocgen.sh (1 hunks)
Additional comments: 2
scripts/build.sh (1)
  • 8-8: Switching the git branch from releases/v0.21.x to main in the build.sh script aligns the build process with the latest version of the codebase. Ensure to verify the impact of this change on any dependencies or specific version requirements that might have relied on the releases/v0.21.x branch.

Also applies to: 12-12

scripts/protocgen.sh (1)
  • 49-49: The updates to the protocgen.sh script, including the removal of specific directories and adjustments to exports, aim to streamline the project and manage dependencies more effectively. It's important to thoroughly test the generated TypeScript code to ensure that these changes have not inadvertently removed necessary functionality or broken existing dependencies.

Also applies to: 53-54, 57-58, 61-61

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9507e3e and 95bd83f.
Files selected for processing (1)
  • jest.config.ts (1 hunks)

jest.config.ts Show resolved Hide resolved
Copy link

Lines Statements Branches Functions
Coverage: 90%
92.22% (1258/1364) 86.28% (541/627) 79.84% (309/387)

@cgilbe27
Copy link
Contributor Author

Failure is sonarqube

@Unique-Divine
Copy link
Member

LGTM

@cgilbe27 cgilbe27 merged commit 64e028c into develop Feb 22, 2024
1 of 2 checks passed
@cgilbe27 cgilbe27 deleted the chore/msg-factory branch February 22, 2024 00:53
nibibot pushed a commit that referenced this pull request Feb 22, 2024
### [3.0.14](v3.0.13...v3.0.14) (2024-02-22)

### Bug Fixes

* chore msg factories ([#323](#323)) ([64e028c](64e028c))

### Miscellaneous Chores

* updating code owners ([9e7cadf](9e7cadf))

 [skip ci]
@nibibot
Copy link

nibibot commented Feb 22, 2024

🎉 This PR is included in version 3.0.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

epic(sdk): Queries for x/devgas and other modules
4 participants