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

refactor: tests #301

Merged
merged 19 commits into from
Feb 5, 2024
Merged

refactor: tests #301

merged 19 commits into from
Feb 5, 2024

Conversation

cgilbe27
Copy link
Contributor

@cgilbe27 cgilbe27 commented Feb 3, 2024

Tests, partials, inflation, marketing(query and mutation) and featureflags

Uses make chaosnet

Summary by CodeRabbit

  • New Features

    • Introduced new ESLint and Prettier configurations for improved code quality and consistency.
    • Added GitHub Actions workflow for enhanced CI/CD processes.
    • Expanded GraphQL capabilities with new queries and mutations for marketing operations and network data (feature flags, inflation data, community pool data).
    • Enhanced SDK with updated transaction handling and query functionalities.
  • Refactor

    • Streamlined loading and testing mechanisms for GraphQL schema and code generation.
    • Reorganized and optimized imports across GraphQL and SDK modules for better maintainability.
    • Updated utility functions and tests for increased efficiency and coverage.
  • Bug Fixes

    • Adjusted export statements and import paths to ensure correct module referencing and functionality.
  • Chores

    • Removed unused functions and entities to clean up the codebase.

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

coderabbitai bot commented Feb 3, 2024

Warning

Rate Limit Exceeded

@cgilbe27 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 47 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 9832b72 and 2cc1ccd.

Walkthrough

These changes encompass a comprehensive overhaul of a TypeScript project, focusing on enhancing code quality, testing, and GraphQL capabilities. The updates include setting up ESLint and Prettier for code consistency, refining GitHub Actions workflows for testing and building, and expanding the GraphQL schema with new queries and mutations. Additionally, improvements to the SDK's transaction and query handling aim to streamline development processes and enhance code robustness.

Changes

File(s) Summary
.eslintrc.json, .prettierrc.json Configured ESLint for TypeScript, set Prettier settings for code styling.
.github/workflows/test-ts-sdk.yaml Updated GitHub Actions workflow for testing and build processes.
index.ts, src/gql/index.ts Updated export statements for improved module management.
jest.config.ts Enhanced Jest configuration for coverage and thresholds.
src/gql/.../codegen-loader.js, codegen.test.ts, codegen.ts Streamlined GraphQL schema loading and testing.
src/gql/heart-monitor/..., src/gql/query/*, src/gql/subscription/* Expanded GraphQL with new queries, mutations, and subscriptions.
src/sdk/..., src/gql/utils/* Improved SDK, utility file organization, and functionality.

"In the realm of code, where logic reigns supreme,
A rabbit hopped through, weaving a developer's dream.
🌟 With each line refined, and every test passed,
It left a trail of green, ensuring quality that would last."
   🐰💻✨

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: 15

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d6a053a and e1e09f1.
Files ignored due to path filters (3)
  • package.json is excluded by: !**/*.json
  • tsconfig.json is excluded by: !**/*.json
  • yarn.lock is excluded by: !**/*.lock
Files selected for processing (65)
  • .eslintrc.json (1 hunks)
  • .github/workflows/test-ts-sdk.yaml (1 hunks)
  • .prettierrc.json (1 hunks)
  • index.ts (1 hunks)
  • jest.config.ts (1 hunks)
  • src/gql/graphql-codegen/codegen-loader.js (1 hunks)
  • src/gql/graphql-codegen/codegen.test.ts (1 hunks)
  • src/gql/graphql-codegen/codegen.ts (1 hunks)
  • src/gql/heart-monitor/heart-monitor.test.ts (6 hunks)
  • src/gql/heart-monitor/heart-monitor.ts (4 hunks)
  • src/gql/query/communityPool.ts (1 hunks)
  • src/gql/query/delegations.ts (1 hunks)
  • src/gql/query/distributionCommissions.ts (1 hunks)
  • src/gql/query/featureFlags.ts (1 hunks)
  • src/gql/query/governance.ts (1 hunks)
  • src/gql/query/ibc.ts (3 hunks)
  • src/gql/query/index.ts (1 hunks)
  • src/gql/query/inflation.ts (1 hunks)
  • src/gql/query/markPriceCandles.ts (1 hunks)
  • src/gql/query/oracle.ts (1 hunks)
  • src/gql/query/perp.ts (2 hunks)
  • src/gql/query/redelegations.ts (1 hunks)
  • src/gql/query/spotLpPositions.ts (1 hunks)
  • src/gql/query/spotPoolCreated.ts (1 hunks)
  • src/gql/query/spotPoolExited.ts (1 hunks)
  • src/gql/query/spotPoolJoined.ts (1 hunks)
  • src/gql/query/spotPoolSwap.ts (1 hunks)
  • src/gql/query/spotPools.ts (1 hunks)
  • src/gql/query/stats.ts (2 hunks)
  • src/gql/query/unbondings.ts (1 hunks)
  • src/gql/query/users.ts (1 hunks)
  • src/gql/query/validators.ts (1 hunks)
  • src/gql/query/wasm.ts (1 hunks)
  • src/gql/subscription/markPriceCandlesSubscription.ts (2 hunks)
  • src/gql/subscription/oraclePricesSubscription.ts (1 hunks)
  • src/gql/subscription/perpMarketSubscription.ts (2 hunks)
  • src/gql/subscription/perpPositionsSubscription.ts (2 hunks)
  • src/gql/utils/consts.test.ts (2 hunks)
  • src/gql/utils/consts.ts (2 hunks)
  • src/gql/utils/defaultObjects.ts (5 hunks)
  • src/sdk/msg/encode-types.ts (1 hunks)
  • src/sdk/msg/perp.ts (1 hunks)
  • src/sdk/msg/spot.ts (1 hunks)
  • src/sdk/query/oracle.test.ts (1 hunks)
  • src/sdk/query/oracle.ts (1 hunks)
  • src/sdk/query/perp.ts (1 hunks)
  • src/sdk/query/query.test.ts (18 hunks)
  • src/sdk/query/query.ts (1 hunks)
  • src/sdk/query/spot.ts (1 hunks)
  • src/sdk/tx/event.test.ts (1 hunks)
  • src/sdk/tx/signer.test.ts (1 hunks)
  • src/sdk/tx/txClient.test.ts (6 hunks)
  • src/sdk/tx/txClient.ts (1 hunks)
  • src/sdk/utils/chain.test.ts (3 hunks)
  • src/sdk/utils/chain.ts (2 hunks)
  • src/sdk/utils/faucet.test.ts (5 hunks)
  • src/sdk/utils/faucet.ts (2 hunks)
  • src/sdk/utils/hash.test.ts (2 hunks)
  • src/sdk/utils/hash.ts (1 hunks)
  • src/sdk/utils/parse.test.ts (1 hunks)
  • src/sdk/utils/result.test.ts (1 hunks)
  • src/sdk/utils/result.ts (1 hunks)
  • src/sdk/utils/testutil.ts (1 hunks)
  • src/sdk/utils/types.test.ts (1 hunks)
  • src/sdk/utils/types.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • .prettierrc.json
  • index.ts
  • src/sdk/msg/encode-types.ts
  • src/sdk/query/query.ts
Additional comments: 67
src/sdk/query/perp.ts (1)
  • 13-13: The import statement for fromSdkDec has been modified to import from ".." instead of a specific location. Ensure that the new import path correctly resolves to the intended module.
src/sdk/utils/hash.ts (1)
  • 1-1: The import statement for Result has been changed to import from ".". Verify that this new import path correctly resolves to the intended Result module.
src/gql/query/inflation.ts (1)
  • 1-12: Imports have been reorganized to import from "..". This change should be verified to ensure that all imported entities are correctly resolved from the new import path.
src/gql/query/governance.ts (1)
  • 2-2: The import for defaultGovernance has been moved, affecting the structure of imported entities. Verify that defaultGovernance is correctly resolved from the new import path.
.github/workflows/test-ts-sdk.yaml (2)
  • 53-58: Added a step to login to GitHub Container Registry. Ensure that the credentials used (nibibot and NIBIBOT_GIT_TOKEN) are correctly configured and have the necessary permissions.
  • 60-64: Modified the step to run the Nibiru network. Verify that the make chaosnet command correctly starts the network as intended and that there are no conflicts with other steps.
src/sdk/utils/hash.test.ts (1)
  • 62-70: Added new test cases for hexToBytes with empty and incorrect strings. Ensure these tests cover all expected behaviors and edge cases for the hexToBytes function.
src/sdk/tx/signer.test.ts (1)
  • 2-2: Modified the import statement for getRegistry, newRandomWallet, and newSignerFromMnemonic to import from ".". Verify that these functions are correctly resolved from the new import path.
src/sdk/utils/result.ts (1)
  • 38-38: Added a console.error statement to handle cases where both ok and err states are defined simultaneously. Ensure this error handling is consistent with the intended use cases of the Result class.
src/sdk/tx/txClient.ts (1)
  • 21-30: Added perpTypes and spotTypes imports directly in txClient.ts. Verify that these types are correctly utilized within the file and that the direct import does not introduce any redundancy.
src/gql/utils/consts.ts (1)
  • 130-132: > 📝 NOTE

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

Added a new test case for faucetUrlFromChain when the chain includes "cataclysm". Ensure this test case accurately reflects the expected behavior for chains with the "cataclysm" name.

src/gql/query/perp.ts (1)
  • 20-20: Reorganized imports by removing specific imports from ../utils and instead importing all from "..". Verify that all imported entities are correctly resolved from the new import path.
src/sdk/utils/parse.test.ts (1)
  • 1-1: Modified the import statement for fromSdkDec, toSdkDec, and toSdkInt to import from ".". Verify that these functions are correctly resolved from the new import path.
src/gql/query/stats.ts (3)
  • 27-27: The import statement consolidates multiple imports from a parent directory. Ensure that all necessary types and functions are correctly exported from the parent module to prevent any missing import errors.
  • 24-30: > 📝 NOTE

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

The GQLStatsQueryString function constructs a GraphQL query string dynamically based on the provided arguments. Verify that the use of gqlQuery function aligns with its expected input and output, especially in handling default values and partial objects. Also, ensure that the concatenation of query parts into a single string does not introduce any syntax errors in the final GraphQL query.

  • 6-14: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [117-125]

The stats function performs a GraphQL query using the constructed query string. Ensure that error handling is adequately implemented for the doGqlQuery call to manage any potential exceptions or failed queries gracefully.

src/sdk/utils/chain.test.ts (3)
  • 17-18: The import of Localnet and NibiruTxClient directly from the parent directory suggests a reorganization of the module structure. Confirm that these entities are correctly exported from the parent module and that their usage in tests aligns with their intended functionality.
  • 14-34: > 📝 NOTE

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

Each test case should independently verify a specific functionality or behavior. Ensure that the tests adequately cover the expected behaviors of Localnet, CustomChain, and other utilities under various conditions. Also, verify that assertions are correctly used to validate the outcomes of operations.

  • 14-34: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [114-115]

The update of endpoint URLs for Localnet configuration from port 443 to 5555 should be verified to ensure it matches the intended local network setup and does not impact connectivity or functionality in tests.

src/sdk/msg/perp.ts (3)
  • 12-12: The import of toSdkDec, toSdkInt, and TxMessage from a parent directory suggests a reorganization of the module structure. Confirm that these functions and types are correctly exported from the parent module and that their usage throughout the file aligns with their intended functionality.
  • 9-15: > 📝 NOTE

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

Review the usage of toSdkDec and toSdkInt in message construction functions such as openPosition to ensure that the conversion from numbers to blockchain-compatible formats is correctly applied. Also, verify that TxMessage is correctly utilized for constructing transaction messages.

  • 9-15: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [27-199]

Ensure that each message construction function in the PerpMsgFactory class correctly implements the logic for creating messages of the corresponding type. Verify that the use of fromPartial and the setting of message fields align with the expected message formats for the perp module.

src/sdk/query/oracle.ts (3)
  • 34-34: The import of fromSdkDec from a parent directory suggests a reorganization of the module structure. Confirm that fromSdkDec is correctly exported from the parent module and that its usage in the file aligns with its intended functionality for converting blockchain numbers to JavaScript numbers.
  • 34-34: Verify the usage of fromSdkDec in functions like exchangeRate and newExchangeRatesMap to ensure that the conversion from blockchain number formats to JavaScript numbers is correctly applied and does not introduce any inaccuracies in the conversion process.
  • 36-36: Review the setup of the OracleExtension and ensure that each query function correctly implements the logic for querying oracle data. Verify that the use of QueryClientImpl and the construction of query requests align with the expected functionality and data structures of the oracle module.
src/sdk/utils/chain.ts (3)
  • 2-2: The import of Result from the parent directory suggests a reorganization of the module structure. Confirm that Result is correctly exported from the parent module and that its usage in functions like queryChainIdWithRest aligns with its intended functionality for handling operation results.
  • 114-115: The update of endpoint URLs for Localnet configuration from port 443 to 5555 should be verified to ensure it matches the intended local network setup and does not impact connectivity or functionality in the utility functions.
  • 1-1: Review the overall structure and logic of the CustomChain class and other utility functions to ensure they correctly implement the functionality for managing chain configurations and querying chain data. Verify that the logic for constructing chain endpoints and parsing chain IDs is accurate and aligns with the expected formats.
src/sdk/tx/txClient.test.ts (3)
  • 11-25: The import of TxLog, TxMessage, PERP_MSG_TYPE_URLS, NibiruQuerier, and other entities from the parent directory suggests a reorganization of the module structure. Confirm that these entities are correctly exported from the parent module and that their usage in tests aligns with their intended functionality.
  • 29-29: Each test case should independently verify a specific functionality or behavior of the NibiruTxClient. Ensure that the tests adequately cover the expected behaviors of transaction creation, signing, and broadcasting under various conditions. Also, verify that assertions are correctly used to validate the outcomes of operations.
  • 29-29: The use of Localnet.endptTm in connecting to the transaction client and querier should be verified to ensure it matches the intended local network setup and does not impact the correctness or functionality of the tests.
src/sdk/query/spot.ts (3)
  • 39-39: The import of fromSdkDec from a parent directory suggests a reorganization of the module structure. Confirm that fromSdkDec is correctly exported from the parent module and that its usage in the file aligns with its intended functionality for converting blockchain numbers to JavaScript numbers.
  • 39-39: Verify the usage of fromSdkDec in functions like transformPoolParams and transformPool to ensure that the conversion from blockchain number formats to JavaScript numbers is correctly applied and does not introduce any inaccuracies in the conversion process.
  • 41-41: Review the setup of the SpotExtension and ensure that each query function correctly implements the logic for querying spot data. Verify that the use of QueryClientImpl and the construction of query requests align with the expected functionality and data structures of the spot module.
src/sdk/query/oracle.test.ts (1)
  • 4-4: The import path for setupOracleExtension has been updated. Verify that the new path correctly points to the intended module.
Verification successful

Given the lack of output from the previous script, it's possible that the file setupOracleExtension.ts does not exist, or the export statement for setupOracleExtension is not present in the expected format. This could mean that the import path update mentioned in the review might not correctly point to the intended module, or the module's location or its export statement could be different than anticipated.

To further investigate, a more comprehensive approach is needed to verify the existence and correct export of setupOracleExtension. This involves checking for any file that exports setupOracleExtension, regardless of its name, and ensuring that the export statement matches the expected pattern.


The script output confirms that setupOracleExtension is exported from src/sdk/query/oracle.ts. This information verifies that the import statement for setupOracleExtension in the file src/sdk/query/oracle.test.ts, which now points to ".." (indicating a higher-level directory import), should be correctly set up to import from the module where setupOracleExtension is defined, assuming the project's structure supports such imports.

Given this confirmation, the updated import path for setupOracleExtension as seen in the review comment appears to correctly point to the intended module, assuming the relative import path ".." correctly resolves to include src/sdk/query/oracle.ts based on the project's structure.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the new import path for setupOracleExtension
fd setupOracleExtension.ts --exec grep -H "export const setupOracleExtension" {}

Length of output: 84



Script:

#!/bin/bash
# Search for any file exporting setupOracleExtension
rg "export const setupOracleExtension" --type ts

Length of output: 152

src/sdk/query/query.test.ts (21)
  • 6-15: Updated imports and constants usage. Ensure that NibiruQuerier, Localnet, newSignerFromMnemonic, and NibiruTxClient are correctly imported from their new locations and that Localnet is correctly used throughout the tests.
  • 23-25: Usage of Localnet.endptTm in querier.getBlock(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint.
Verification successful

The Localnet object's endptTm property is defined as "http://127.0.0.1:26657" in the src/sdk/utils/chain.ts file. This endpoint is a standard address for a local Tendermint RPC server, typically used for local development and testing environments. Given this information, the usage of Localnet.endptTm in querier.getBlock() correctly points to a Tendermint endpoint, specifically for a local network setup.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the correctness of Localnet.endptTm endpoint
echo "Verify Localnet.endptTm points to the correct Tendermint endpoint."

Length of output: 142



Script:

#!/bin/bash
# Search for the definition of Localnet within the codebase
rg "Localnet" --multiline

Length of output: 3643



Script:

#!/bin/bash
# Display the contents of src/sdk/utils/chain.ts to examine the Localnet object
cat src/sdk/utils/chain.ts

Length of output: 6560

* 2-32: > 📝 **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [29-34]

Direct fetch call using Localnet.endptTm. Ensure that the endpoint and the expected block structure are correct.

Verification successful

The verification process has revealed that the Localnet.endptTm endpoint is consistently used across various test files in the SDK, indicating a standard practice for connecting to the local network's Tendermint endpoint. This widespread usage suggests that the endpoint is correctly implemented as per the SDK's design. Additionally, the BlockResp interface is defined with a structure that expects a result containing a block, which aligns with the expected block structure from a Tendermint endpoint. Given this context, the direct fetch call using Localnet.endptTm and the handling of the expected block structure in the provided code snippet appear to be correctly implemented according to the SDK's design and usage patterns.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the correctness of the endpoint and expected block structure
echo "Verify the endpoint and expected block structure in the direct fetch call."

Length of output: 158



Script:

#!/bin/bash
# Search for documentation or comments regarding Localnet.endptTm
echo "Searching for Localnet.endptTm references..."
rg "Localnet.endptTm" --context 5

# Locate the definition of BlockResp to understand the expected block structure
echo "Locating BlockResp definition..."
rg "interface BlockResp" --context 5

Length of output: 20734

* 36-42: > 📝 **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [39-48]

Usage of Localnet.endptTm in querier.getAllBalances(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that unibi is a valid denomination.

Verification successful

The provided script output does not offer any new information regarding the correctness of Localnet.endptTm or the validity of the denomination unibi. To verify the original review comment, we need to inspect the code to confirm that Localnet.endptTm points to the correct Tendermint endpoint and to check if unibi is indeed a valid denomination within the context of the application.

Given the limitations of the provided script output, we need to proceed with a different approach to gather the necessary information.


Based on the output from the executed scripts, we can observe the following:

  1. References to Localnet.endptTm: The variable Localnet.endptTm is widely used across various test files in the SDK, including faucet.test.ts, chain.test.ts, txClient.test.ts, and notably, multiple times within query.test.ts. This consistent usage across different parts of the test suite suggests that Localnet.endptTm is a standard way to reference the Tendermint endpoint within this project. However, without seeing the actual value assigned to Localnet.endptTm, we cannot definitively confirm its correctness, but its widespread use implies it is correctly pointing to the intended Tendermint endpoint.

  2. Occurrences of the denomination unibi: The denomination unibi is found in various files, including the README.md, QUERIES.md, and several test files (faucet.test.ts, txClient.test.ts, chain.test.ts, etc.), as well as in the SDK's utility and transaction client code. This indicates that unibi is a valid denomination used within the context of this project, both in documentation and code, especially for testing purposes.

Given this information, it can be concluded that Localnet.endptTm is indeed used as intended to point to the Tendermint endpoint within the project's tests and that unibi is a valid denomination used throughout the project's codebase and documentation.

Therefore, the original review comment concerning the verification of Localnet.endptTm pointing to the correct Tendermint endpoint and unibi being a valid denomination is supported by the evidence found in the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the correctness of Localnet.endptTm and the denomination 'unibi'
echo "Verify Localnet.endptTm points to the correct Tendermint endpoint and 'unibi' is a valid denomination."

Length of output: 220



Script:

#!/bin/bash
# Find references to Localnet.endptTm to confirm it points to the correct Tendermint endpoint
rg "Localnet.endptTm"

# Search for any instance of 'unibi' to confirm it as a valid denomination
rg "unibi"

Length of output: 4622

* 51-57: > 📝 **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [54-63]

Usage of Localnet.endptTm in querier.nibiruExtensions.spot.params(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the expected fields are present in the response.

  • 68-74: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.oracle.actives(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 80-86: Usage of Localnet.endptTm in querier.nibiruExtensions.oracle.params(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.
  • 77-91: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.oracle.exchangeRates(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 104-110: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.epochs.epochsInfo() and currentEpoch(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 122-128: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.staking.validators(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 133-139: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.distribution.params(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 151-157: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.gov.params(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 164-170: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.ibc.channel.allChannels() and allConnections(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 203-209: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.ibc.client.params() and transfer.params(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 223-229: > 📝 NOTE

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

Usage of Localnet.endptTm in querier.nibiruExtensions.ibc.verified.channel.channel(). Confirm that Localnet.endptTm correctly points to the Tendermint endpoint and that the response structure is as expected.

  • 253-259: > 📝 NOTE

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

Deployment of contract using Localnet.endptTm. Confirm that the deployment process, including wasmClient.upload and wasmClient.instantiate, works as expected with the provided endpoint and that the contract deployment is successful.

Verification successful

The provided script output does not offer any information regarding the actual execution or verification of the contract deployment process using wasmClient.upload and wasmClient.instantiate methods. It merely echoes the instruction without performing any actionable checks or validations against the codebase or deployment process. To properly verify the review comment, we would need to execute commands that can inspect the codebase for references to these methods and potentially validate their usage, configurations, or integration tests that might indicate their operational status. However, without access to a live blockchain environment or specific test scripts designed to simulate the deployment process, our verification capabilities are limited to codebase inspection.

Given the limitations, the next best step is to search the codebase for references to wasmClient.upload and wasmClient.instantiate to confirm their usage and potentially find related tests that might indicate how these methods are expected to work with the Localnet.endptTm endpoint. This approach will allow us to infer whether the deployment process is likely to be correctly implemented as per the review comment's concern.


The script output confirms the presence of wasmClient.upload and wasmClient.instantiate methods within the src/sdk/query/query.test.ts file, directly aligning with the code snippet provided in the review comment. This indicates that the deployment process involving these methods is indeed implemented in the codebase, specifically within a test file, which suggests that there is at least a framework for testing the deployment of contracts using the specified methods.

Given this information, it can be inferred that the deployment process, including wasmClient.upload and wasmClient.instantiate, is implemented and likely tested within the context of the provided endpoint Localnet.endptTm. However, without executing these tests in a live or simulated environment, we cannot definitively confirm the success of the contract deployment process. The presence of these methods in a test file strongly suggests that the process is designed to work as expected, pending actual execution results.

Therefore, based on the codebase inspection, the review comment concerning the verification of the contract deployment process using Localnet.endptTm is supported by the evidence found within the src/sdk/query/query.test.ts file.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the contract deployment process
echo "Verify the contract deployment process including wasmClient.upload and wasmClient.instantiate works as expected."

Length of output: 234



Script:

#!/bin/bash
# Search for references to wasmClient.upload and wasmClient.instantiate in the codebase
echo "Searching for references to wasmClient.upload and wasmClient.instantiate..."
rg "wasmClient\.upload" || echo "No references to wasmClient.upload found."
rg "wasmClient\.instantiate" || echo "No references to wasmClient.instantiate found."

Length of output: 392

* 321-321: Usage of `Localnet.endptTm` in `querier.nibiruExtensions.auth.account()`. Confirm that `Localnet.endptTm` correctly points to the Tendermint endpoint and that the account information retrieval is successful. * 329-335: Usage of `jest.useFakeTimers()` and `setTimeoutSpy` in `waitForHeight` test. Ensure that the use of fake timers and the spy on `setTimeout` are correctly implemented and necessary for the test. * 348-354: Testing of `getTxByHash` with a non-existent transaction hash. Ensure that the test correctly handles the case where a transaction does not exist and that the error handling is appropriate. * 358-362: Testing of `getTxByHash` with an incorrect hash format. Ensure that the test correctly handles the case of an incorrect hash format and that the error handling is appropriate. * 366-376: Testing of `getTxByHashBytes` with a specific hash. Ensure that the test correctly handles the retrieval process and that the error handling is appropriate for cases where the transaction does not exist.
Verification successful

The provided script output does not offer any information regarding the actual implementation or behavior of the getTxByHashBytes method within the NibiruQuerier class, nor does it provide insight into the error handling mechanisms in place for scenarios where a transaction does not exist. To verify the review comment, we need to examine the implementation of getTxByHashBytes and any associated error handling logic directly within the codebase.

Given the lack of direct information from the script output, the next step is to generate a new script that will help us inspect the implementation of getTxByHashBytes and its error handling. This involves searching the codebase for the method definition and any relevant tests that might illustrate how errors are managed.


The output from the executed scripts provides the necessary context to verify the review comment regarding the getTxByHashBytes method in the NibiruQuerier class and its associated test.

Observations from the Script Output

  1. Implementation of getTxByHashBytes: The method is designed to query a transaction using its SHA-256 hash in byte format. It uses Result.ofSafeExecAsync to execute the query asynchronously, which suggests that error handling is built into the method's execution flow. The method converts the byte array to a hex format for validation before making the request, indicating an upfront error handling mechanism for format validation.

  2. Test for getTxByHashBytes: The test case provided in the output attempts to query a transaction using a specific hash byte array. The expectation set in the test (expect(result.isErr()).toEqual(true)) checks for an error result, which implies that the test is specifically designed to handle scenarios where the transaction does not exist or another error occurs during the retrieval process.

Conclusion

Based on the provided context, the implementation of getTxByHashBytes includes upfront validation for the hash format and utilizes a safe execution pattern for asynchronous operations, which inherently supports error handling. The associated test case explicitly checks for an error result, demonstrating that the test is designed to verify both the retrieval process and the appropriate handling of errors, such as when a transaction does not exist.

Given this information, the review comment concerning the testing of getTxByHashBytes with a specific hash and ensuring that the test correctly handles the retrieval process and error handling for cases where the transaction does not exist is supported by the evidence from the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the retrieval process and error handling in getTxByHashBytes test
echo "Verify the retrieval process and error handling in getTxByHashBytes test is appropriate."

Length of output: 186



Script:

#!/bin/bash
# Search for the implementation of getTxByHashBytes in the NibiruQuerier class
rg "getTxByHashBytes" --context 5

# Additionally, search for any tests related to getTxByHashBytes to understand how error handling is tested
rg "getTxByHashBytes" -t ts --context 5

Length of output: 3349

src/gql/heart-monitor/heart-monitor.ts (7)
  • 85-187: > 📝 NOTE

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

Reorganized imports and added new entities. Ensure all imported entities are used within the file and that the new entities (GQLFeatureFlags, GQLInflationDistribution, GQLInflationInfo) are correctly integrated.

  • 114-114: The method communityPool uses partial types for arguments and fields. Confirm that this usage aligns with the intended flexibility and type safety of the method's implementation.
Verification successful

The usage of partial types in the communityPool method, as observed from the method's implementation and its call pattern, aligns with the intended flexibility and type safety of the method's design. This suggests that the method is designed to accept a subset of arguments based on varying requirements, justifying the use of Partial for its parameters. Without direct access to the GQLQueryGqlCommunityPoolArgs definition, the conclusion is based on the available context, which supports the use of partial types as intended for the method's functionality.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the usage of partial types in communityPool method
echo "Verify the usage of partial types in communityPool method aligns with intended flexibility and type safety."

Length of output: 224



Script:

#!/bin/bash
# Find and display the definition of GQLQueryGqlCommunityPoolArgs
echo "Definition of GQLQueryGqlCommunityPoolArgs:"
fd "GQLQueryGqlCommunityPoolArgs.ts" --exec cat {}

# Search for the implementation of the communityPool method
echo -e "\nImplementation of communityPool method:"
fd "heart-monitor.ts" --exec grep -A 10 -B 3 "communityPool(" {}

# Optionally, identify calls to communityPool to see how arguments are passed
echo -e "\nCalls to communityPool method:"
fd ".ts" --exec grep "communityPool(" {}

Length of output: 1091

* 128-130: Added `featureFlags` method without argument but with optional partial fields. Ensure that the implementation correctly handles the retrieval of feature flags without requiring arguments.
Verification successful

The provided script output reveals the implementation of the featureFlags method within the heart-monitor.ts file. The method signature indicates that it accepts an optional parameter fields of type Partial<GQLFeatureFlags>, and it returns a Promise<GqlOutFeatureFlags>. The implementation of the method shows that it indeed handles calls without arguments by making the fields parameter optional. This aligns with the review comment's concern about ensuring the method can retrieve feature flags without requiring arguments.

Based on the script output, the featureFlags method is designed to handle optional arguments correctly, as it is implemented with an optional fields parameter. This means the method can be called without any arguments, and the implementation will still proceed as intended, likely using default behavior or fetching all available feature flags when no specific fields are provided.

Given this information, it can be concluded that the implementation of the featureFlags method in the heart-monitor.ts file correctly handles the retrieval of feature flags without requiring arguments, as per the review comment's verification request.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the implementation of featureFlags method
echo "Verify the implementation of featureFlags method correctly handles retrieval without requiring arguments."

Length of output: 220



Script:

#!/bin/bash
# Search for the implementation of the `featureFlags` method in `heart-monitor.ts` and display its content
fd heart-monitor.ts --exec cat {} \; | grep -A 10 'featureFlags'

Length of output: 1051

* 142-145: Added `inflation` method with partial arguments and fields. Confirm that the implementation correctly handles the retrieval of inflation data with the flexibility provided by partial types. * 285-285: Usage of partial types in `communityPool` method. Confirm that the partial types are correctly applied and provide the intended flexibility for the method's arguments and fields. * 299-300: Implementation of `featureFlags` method. Ensure that the method correctly retrieves feature flags data without requiring arguments and handles optional partial fields appropriately.
Verification successful

The output from the scripts provides valuable insights into the implementation and testing of the featureFlags method within the heart-monitor.ts file and its corresponding test file heart-monitor.test.ts.

  1. Implementation in heart-monitor.ts: The method featureFlags is defined as an asynchronous function that optionally accepts an argument fields of type Partial<GQLFeatureFlags>. This aligns with the requirement for the method to handle optional partial fields appropriately. The method then calls another featureFlags function, passing this.gqlEndpt and the fields argument to it. This suggests that the method is designed to retrieve feature flags data, potentially from a GraphQL endpoint, and it is implemented to work correctly without requiring the fields argument, as it is optional.

  2. Usage in heart-monitor.test.ts: The test file contains a test for the featureFlags method, indicating that it is indeed tested with different scenarios. One test case explicitly calls heartMonitor.featureFlags(fields) with an argument, and the expectation is set to check for a property "featureFlags", suggesting that the method's functionality, including its handling of arguments, is covered by tests.

Given this information, it can be concluded that the featureFlags method in heart-monitor.ts is implemented to correctly retrieve feature flags data without requiring arguments and handles optional partial fields appropriately. The presence of tests in heart-monitor.test.ts further supports that the method's behavior aligns with the expectations outlined in the review comment.

Based on the evidence gathered from the codebase, the implementation of the featureFlags method meets the criteria mentioned in the review comment.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the correct retrieval of feature flags data in featureFlags method
echo "Verify the featureFlags method correctly retrieves data without requiring arguments and handles optional partial fields appropriately."

Length of output: 278



Script:

#!/bin/bash
# Search for the definition of the `featureFlags` method to understand its implementation
ast-grep --lang typescript --pattern $'class $_ {
  $$$
  featureFlags($_) {
    $$$
  }
  $$$  
}'

# Search for usage instances of the `featureFlags` method to see how it's called
rg "featureFlags\(" -A 2 -B 2

Length of output: 1152

* 310-311: Implementation of `inflation` method with partial arguments. Confirm that the method correctly handles the retrieval of inflation data with the flexibility provided by partial types.
Verification successful

The provided script output reveals the implementation of the inflation method within the heart-monitor.ts file. The method signature indicates that it accepts args as a Partial<QueryInflationArgs> and fields as an optional Partial<InflationFields>. The method then calls another function, inflation, passing args and fields along with this.gqlEndpt as arguments.

This implementation confirms that the inflation method is designed to handle partial arguments for retrieving inflation data, leveraging the flexibility provided by TypeScript's Partial type. The method's structure allows for optional parameters to be passed, accommodating various query needs without requiring a full set of arguments. This approach is consistent with GraphQL's flexibility and the description provided in the review comment.

Given the information extracted, it can be concluded that the inflation method correctly handles the retrieval of inflation data with the flexibility provided by partial types, as it is designed to accept partial arguments and pass them to another function that presumably handles the data fetching logic.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the correct retrieval of inflation data in inflation method
echo "Verify the inflation method correctly handles retrieval with the flexibility provided by partial types."

Length of output: 216



Script:

#!/bin/bash
# Search for the implementation of the `inflation` method in the `heart-monitor.ts` file
rg "inflation = async" src/gql/heart-monitor/heart-monitor.ts

Length of output: 85



Script:

#!/bin/bash
# Attempt to extract more context around the `inflation` method implementation
rg -C 20 "inflation = async" src/gql/heart-monitor/heart-monitor.ts

Length of output: 1482

src/gql/heart-monitor/heart-monitor.test.ts (4)
  • 311-322: Ensure that the testInflation function correctly handles cases where inflation data might be missing or incomplete. Consider adding null checks or default values to prevent runtime errors.
  • 264-275: For the testIbc function, verify that the conditional inclusion of "ibcChannels" in the checkFields call accurately reflects the expected behavior and data structure of the ibc response.
  • 189-204: The tests for featureFlags, ibc, and inflation are refactored. Ensure that these tests cover all relevant cases and edge conditions, especially considering the dynamic nature of feature flags and the complexity of IBC and inflation data.

Also applies to: 264-309, 311-341

  • 86-98: > 📝 NOTE

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

The import section is significantly expanded with new entities related to Inflation, QueryInflationArgs, GQLFeatureFlags, and their defaults. Ensure that all imported entities are used within the file to avoid unnecessary imports which can lead to increased bundle size and confusion.

Verification successful

The grep command output confirms that the newly imported entities related to Inflation, QueryInflationArgs, GQLFeatureFlags, and their defaults (defaultInflationInfo, defaultInflationDistribution, defaultFeatureFlags) are indeed utilized within the heart-monitor.test.ts file. This indicates that the imports are not unnecessary and serve a purpose within the file, addressing the concern raised in the review comment about potential unused imports leading to increased bundle size and confusion.

Based on this evidence, the review comment suggesting to verify the usage of newly imported entities has been addressed, and it is confirmed that these entities are used within the file.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all newly imported entities are utilized within the file.
grep -E 'InflationFields|QueryInflationArgs|defaultInflationInfo|defaultInflationDistribution|GQLFeatureFlags|defaultFeatureFlags' src/gql/heart-monitor/heart-monitor.test.ts

Length of output: 570

src/sdk/utils/types.test.ts Show resolved Hide resolved
src/sdk/utils/types.test.ts Show resolved Hide resolved
src/sdk/utils/types.test.ts Show resolved Hide resolved
src/gql/heart-monitor/heart-monitor.test.ts Show resolved Hide resolved
src/gql/heart-monitor/heart-monitor.test.ts Outdated Show resolved Hide resolved
src/gql/utils/defaultObjects.ts Show resolved Hide resolved
src/gql/utils/defaultObjects.ts Show resolved Hide resolved
src/gql/utils/defaultObjects.ts Show resolved Hide resolved
src/gql/utils/defaultObjects.ts Show resolved Hide resolved
src/sdk/query/query.test.ts Show resolved Hide resolved
@cgilbe27 cgilbe27 changed the title Chore/tests Chore: tests Feb 3, 2024
@cgilbe27 cgilbe27 changed the title Chore: tests refactor: tests Feb 3, 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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e1e09f1 and 966bc6d.
Files ignored due to path filters (1)
  • package.json is excluded by: !**/*.json
Files selected for processing (1)
  • src/gql/heart-monitor/heart-monitor.test.ts (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/gql/heart-monitor/heart-monitor.test.ts

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 966bc6d and 724edec.
Files selected for processing (1)
  • .github/workflows/test-ts-sdk.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test-ts-sdk.yaml

Copy link

github-actions bot commented Feb 3, 2024

Lines Statements Branches Functions
Coverage: 93%
94.62% (1197/1265) 87.82% (541/616) 88.03% (309/351)

@cgilbe27
Copy link
Contributor Author

cgilbe27 commented Feb 3, 2024

Only thing failing is quality gate

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 724edec and 3d8c8b1.
Files selected for processing (12)
  • src/gql/graphql-codegen/codegen-loader.js (1 hunks)
  • src/gql/heart-monitor/heart-monitor.test.ts (7 hunks)
  • src/gql/heart-monitor/heart-monitor.ts (4 hunks)
  • src/gql/index.ts (1 hunks)
  • src/gql/mutation/index.ts (1 hunks)
  • src/gql/mutation/marketing.ts (1 hunks)
  • src/gql/query/communityPool.ts (1 hunks)
  • src/gql/query/index.ts (1 hunks)
  • src/gql/query/marketing.ts (1 hunks)
  • src/gql/utils/consts.ts (4 hunks)
  • src/gql/utils/defaultObjects.ts (6 hunks)
  • src/sdk/tx/txClient.test.ts (5 hunks)
Files skipped from review as they are similar to previous changes (4)
  • src/gql/graphql-codegen/codegen-loader.js
  • src/gql/heart-monitor/heart-monitor.ts
  • src/gql/query/communityPool.ts
  • src/sdk/tx/txClient.test.ts
Additional comments: 27
src/gql/mutation/index.ts (1)
  • 1-1: Exporting from ./marketing is approved.
src/gql/index.ts (1)
  • 8-8: Exporting from ./mutation/index is approved.
src/gql/query/index.ts (1)
  • 8-12: Exporting new modules featureFlags, inflation, and marketing is approved.
src/gql/mutation/marketing.ts (5)
  • 1-9: Imports are correctly organized and relevant to the functionality provided in this file.
  • 11-13: Type definition for MutationMarketingArgs is correctly structured.
  • 15-17: Interface GqlOutMarketingMutation is correctly defined.
  • 19-32: Function marketingMutationString is correctly implemented, ensuring flexibility with partial types and proper conversion of objects to strings.
  • 34-39: Function marketingMutation is correctly implemented, making use of marketingMutationString for query construction.
src/gql/utils/consts.ts (2)
  • 100-101: Parameters excludeParentObject and isMutation in gqlQuery function are correctly utilized to construct the query string conditionally.
  • 119-119: The conditional inclusion of parentheses around query arguments based on their presence is correctly implemented.
src/gql/query/marketing.ts (6)
  • 1-19: Imports are correctly organized and relevant to the functionality provided in this file.
  • 21-26: Type definition for QueryMarketingArgs is correctly structured.
  • 28-30: Interface GqlOutMarketingQuery is correctly defined.
  • 32-38: Type definition for MarketingFields is correctly structured, allowing for partial specification of fields.
  • 40-153: Function marketingQueryString is correctly implemented, ensuring flexibility with partial types and proper conversion of objects to strings. The handling of default objects when specific fields are not provided is correctly done.
  • 155-165: Function marketingQuery is correctly implemented, making use of marketingQueryString for query construction.
src/gql/utils/defaultObjects.ts (7)
  • 5-5: SKIP: Past comment on missing import for GQLFeatureFlags is still valid.
  • 14-15: SKIP: Past comment on missing import for GQLInflationDistribution and GQLInflationInfo is still valid.
  • 77-77: SKIP: Past comment on incorrect enum value assignment for GQLValidatorStatus.GQLUnbonded is still valid.
  • 422-429: SKIP: Past comment on missing type annotations for properties in defaultInflationDistribution is still valid.
  • 431-436: SKIP: Past comment on missing type annotations for properties in defaultInflationInfo is still valid.
  • 438-444: SKIP: Past comment on missing type annotations for properties in defaultFeatureFlags is still valid.
  • 447-480: Definition of default objects for new entities such as GQLTwitterUser, GQLTweet, GQLRetweet, GQLLike, and GQLTask is approved. These objects are correctly structured and provide a comprehensive default state for their respective types.
src/gql/heart-monitor/heart-monitor.test.ts (4)
  • 89-102: The addition of new entities related to Inflation, QueryInflationArgs, GQLFeatureFlags, MarketingFields, and their defaults is acknowledged. Ensure corresponding tests cover these new entities adequately to validate their integration and functionality.
  • 196-212: The testFeatureFlags function correctly tests the feature flags functionality. However, ensure that the test coverage for defaultFeatureFlags is comprehensive, covering all possible flag states and their impacts on the system's behavior.
  • 318-348: The testInflation function implementation is correct. It's important to verify that the test cases for defaultInflationInfo and defaultInflationDistribution thoroughly assess the inflation functionality, including edge cases and error handling.
  • 470-532: The testMarketing function tests the marketing query functionality. Ensure that the tests for defaultTwitterUser, defaultTweet, defaultRetweet, defaultLike, and defaultTask are comprehensive, covering various scenarios and edge cases to validate the marketing features thoroughly.

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 3d8c8b1 and e1289af.
Files selected for processing (3)
  • src/gql/heart-monitor/heart-monitor.test.ts (7 hunks)
  • src/gql/index.ts (1 hunks)
  • src/gql/mutation/index.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • src/gql/heart-monitor/heart-monitor.test.ts
  • src/gql/index.ts
  • src/gql/mutation/index.ts

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 e1289af and 4d3ff3b.
Files selected for processing (1)
  • src/gql/heart-monitor/heart-monitor.test.ts (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/gql/heart-monitor/heart-monitor.test.ts

@cgilbe27
Copy link
Contributor Author

cgilbe27 commented Feb 4, 2024

GQL is failing, see test

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 4d3ff3b and 96c2dee.
Files selected for processing (1)
  • src/gql/heart-monitor/heart-monitor.test.ts (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/gql/heart-monitor/heart-monitor.test.ts

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 96c2dee and 5faa33d.
Files selected for processing (3)
  • src/gql/heart-monitor/heart-monitor.test.ts (9 hunks)
  • src/gql/heart-monitor/heart-monitor.ts (4 hunks)
  • src/gql/query/featureFlags.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • src/gql/heart-monitor/heart-monitor.test.ts
  • src/gql/heart-monitor/heart-monitor.ts
  • src/gql/query/featureFlags.ts

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 5faa33d and 9832b72.
Files selected for processing (3)
  • jest.config.ts (1 hunks)
  • src/gql/heart-monitor/heart-monitor.test.ts (9 hunks)
  • src/gql/query/marketing.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • jest.config.ts
  • src/gql/heart-monitor/heart-monitor.test.ts
  • src/gql/query/marketing.ts

@cgilbe27
Copy link
Contributor Author

cgilbe27 commented Feb 5, 2024

Failure is on sonarqube quality gate, but good to merge

@cgilbe27 cgilbe27 enabled auto-merge (squash) February 5, 2024 15:08
@cgilbe27 cgilbe27 merged commit e14b83b into develop Feb 5, 2024
2 of 3 checks passed
@cgilbe27 cgilbe27 deleted the chore/tests branch February 5, 2024 15:17
nibibot pushed a commit that referenced this pull request Feb 5, 2024
## [3.0.0](v2.0.1...v3.0.0) (2024-02-05)

### Bug Fixes

* fix merge ([4f93be8](4f93be8))
* gql where args ([#298](#298)) ([b57ef0a](b57ef0a))
* more file reorg ([#300](#300)) ([d6a053a](d6a053a))

### Miscellaneous Chores

* pr title lint workflow ([#293](#293)) ([b5dd050](b5dd050))

### Code Refactors

* tests ([#301](#301)) ([e14b83b](e14b83b))

 [skip ci]
@nibibot
Copy link

nibibot commented Feb 5, 2024

🎉 This PR is included in version 3.0.0 🎉

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.

3 participants