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: cleanup #1

Merged
merged 5 commits into from
Sep 3, 2024
Merged

refactor: cleanup #1

merged 5 commits into from
Sep 3, 2024

Conversation

mantricjavier
Copy link
Collaborator

@mantricjavier mantricjavier commented Sep 3, 2024

Description and Motivation

Fork cleanup before performing tweaks to the contracts.

Related Issues


Checklist:

  • My pull request has a sound title and description (not something vague like Update index.md)
  • All existing and new tests are passing.
  • I updated/added relevant documentation.
  • The code is formatted properly cargo fmt --all --.
  • Clippy doesn't report any issues cargo clippy -- -D warnings.
  • I have regenerated the schemas if needed with just schemas.

Summary by CodeRabbit

  • New Features

    • Updated the repository's CODEOWNERS to reflect new administrative oversight.
    • Introduced new environment files for the Mantra blockchain and its testnets, enabling streamlined deployment configurations.
    • Added a new GitHub Actions workflow for automated testing and linting of the project.
  • Bug Fixes

    • Simplified the build and deployment scripts to enhance usability and reduce complexity.
  • Documentation

    • Rebranded documentation to reflect the transition from "White Whale" to "MANTRA."
    • Updated URLs in the pull request template to direct contributors to the correct resources.
  • Chores

    • Removed outdated features and dependencies from various configuration files to streamline the project structure.

Copy link

coderabbitai bot commented Sep 3, 2024

Walkthrough

The repository underwent significant changes, including a rebranding from "White Whale" to "MANTRA," updates to the CODEOWNERS file, and the introduction of new GitHub Actions workflows for testing and linting. Several files were streamlined, removing conditional logic related to the "osmosis" feature and simplifying dependency management. Additionally, documentation files were reduced to placeholders, indicating a need for future updates.

Changes

Files Change Summary
.github/CODEOWNERS Updated repository administrator from @kerber0x to @mantricjavier and simplified code owners.
.github/PULL_REQUEST_TEMPLATE.md Changed URLs and branding from "White Whale Migaloo" to "MANTRA."
.github/workflows/*.yaml Introduced new workflows for CI/CD processes, including testing and linting for Rust projects.
Cargo.toml Removed several workspace members and switched to versioned dependencies.
contracts/liquidity_hub/* Refactored various contract files to remove "osmosis" specific logic and rebranded contract names.
docs/* Reduced content in CODE_OF_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md to placeholders.
justfile Simplified commands by removing feature flags and streamlining build and test processes.
packages/common-testing/* Renamed and restructured testing utilities, removing specific features.
scripts/* Modified deployment scripts to focus on new networks and simplified build processes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CI/CD
    participant Repository
    participant Testing

    User->>Repository: Create Pull Request
    Repository->>CI/CD: Trigger Workflows
    CI/CD->>Testing: Run Tests and Lint
    Testing-->>CI/CD: Return Results
    CI/CD-->>User: Notify Status
Loading

🐰 In the meadow, I hop with glee,
Changes abound, oh what a spree!
From White Whale to MANTRA bright,
New paths to explore, a joyful sight!
With tests and lints, our code will sing,
Hooray for the changes, let the fun begin! 🌼

Tip

We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@mantricjavier mantricjavier merged commit 0943ae9 into main Sep 3, 2024
@mantricjavier mantricjavier deleted the refactor/cleanup branch September 3, 2024 14:37
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: 3

Outside diff range, codebase verification and nitpick comments (1)
contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs (1)

Line range hint 228-228: Fix the typo in the function name.

The function name has a typo - it should be cant_recreate_existing_pool.

Apply this diff to fix the typo:

-fn cant_recreate_existing_poo() {
+fn cant_recreate_existing_pool() {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 239cbd1 and 58184d6.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (32)
  • .github/CODEOWNERS (1 hunks)
  • .github/PULL_REQUEST_TEMPLATE.md (3 hunks)
  • .github/workflows/ci-test-lints.yaml (1 hunks)
  • .github/workflows/pr-convcom-check.yaml (1 hunks)
  • .github/workflows/release-artifacts-on-tag.yaml (2 hunks)
  • Cargo.toml (3 hunks)
  • contracts/liquidity_hub/epoch-manager/Cargo.toml (2 hunks)
  • contracts/liquidity_hub/epoch-manager/src/contract.rs (2 hunks)
  • contracts/liquidity_hub/incentive-manager/Cargo.toml (2 hunks)
  • contracts/liquidity_hub/incentive-manager/src/contract.rs (2 hunks)
  • contracts/liquidity_hub/pool-manager/Cargo.toml (2 hunks)
  • contracts/liquidity_hub/pool-manager/src/contract.rs (6 hunks)
  • contracts/liquidity_hub/pool-manager/src/error.rs (2 hunks)
  • contracts/liquidity_hub/pool-manager/src/helpers.rs (10 hunks)
  • contracts/liquidity_hub/pool-manager/src/manager/commands.rs (5 hunks)
  • contracts/liquidity_hub/pool-manager/src/queries.rs (4 hunks)
  • contracts/liquidity_hub/pool-manager/src/swap/commands.rs (1 hunks)
  • contracts/liquidity_hub/pool-manager/src/swap/perform_swap.rs (3 hunks)
  • contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs (43 hunks)
  • docs/CODE_OF_CONDUCT.md (1 hunks)
  • docs/CONTRIBUTING.md (1 hunks)
  • docs/SECURITY.md (1 hunks)
  • justfile (4 hunks)
  • packages/common-testing/Cargo.toml (3 hunks)
  • packages/common-testing/src/lib.rs (1 hunks)
  • scripts/build_release.sh (2 hunks)
  • scripts/deployment/deploy_env/base_env.sh (1 hunks)
  • scripts/deployment/deploy_env/mainnets/mantra.env (1 hunks)
  • scripts/deployment/deploy_env/mantra_testnet.env (1 hunks)
  • scripts/deployment/deploy_env/testnets/mantra.env (1 hunks)
  • scripts/get_artifacts_versions.sh (1 hunks)
  • scripts/utils/crate_versions.sh (3 hunks)
Files skipped from review due to trivial changes (13)
  • .github/CODEOWNERS
  • .github/PULL_REQUEST_TEMPLATE.md
  • contracts/liquidity_hub/pool-manager/Cargo.toml
  • contracts/liquidity_hub/pool-manager/src/error.rs
  • contracts/liquidity_hub/pool-manager/src/manager/commands.rs
  • docs/CODE_OF_CONDUCT.md
  • docs/SECURITY.md
  • justfile
  • scripts/deployment/deploy_env/mainnets/mantra.env
  • scripts/deployment/deploy_env/mantra_testnet.env
  • scripts/deployment/deploy_env/testnets/mantra.env
  • scripts/get_artifacts_versions.sh
  • scripts/utils/crate_versions.sh
Additional context used
Shellcheck
scripts/deployment/deploy_env/base_env.sh

[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 16-16: Variable was used as an array but is now assigned a string.

(SC2178)

scripts/build_release.sh

[warning] 12-17: Use spaces, not commas, to separate array elements.

(SC2054)

actionlint
.github/workflows/ci-test-lints.yaml

18-18: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


21-21: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


39-39: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


42-42: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


50-50: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


56-56: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


62-62: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

Additional comments not posted (47)
packages/common-testing/src/lib.rs (1)

1-1: LGTM!

The code changes are approved.

docs/CONTRIBUTING.md (1)

1-3: Verify the plan to update the contributing guidelines.

The change suggests that a new version of the contributing guidelines is intended to be created. However, it is not clear when this will be done or what the new guidelines will include.

Please provide more information on the plan to update the contributing guidelines, including:

  • When will the new guidelines be added?
  • What will be the scope of the new guidelines?
  • Who will be responsible for updating the guidelines?
scripts/deployment/deploy_env/base_env.sh (1)

10-10: LGTM!

The code changes are approved.

packages/common-testing/Cargo.toml (3)

2-2: LGTM!

The package name change from "white-whale-testing" to "common-testing" is approved.


6-6: LGTM!

The package description change to remove the reference to "White Whale" is approved.


Line range hint 1-30: Verify the impact of the feature flag removal.

Ensure that the removal of the injective, token_factory, osmosis, and osmosis_token_factory feature flags does not break any existing functionality.

Run the following script to verify the impact of the feature flag removal:

Verification successful

No Conditional Compilation Found for Removed Feature Flags

The removed feature flags (injective, token_factory, osmosis, osmosis_token_factory) do not appear in any conditional compilation attributes in the codebase. This suggests that their removal from Cargo.toml is unlikely to impact the build or functionality directly. However, consider reviewing the context of their occurrences in the codebase to ensure no overlooked dependencies or documentation updates are needed.

  • Files with occurrences:
    • packages/common-testing/src/multi_test/stargate_mock.rs
    • contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the feature flag removal.

# Test 1: Search for the usage of the removed feature flags in the codebase.
# Expect: No occurrences of the removed feature flags.
rg --type rust $'injective|token_factory|osmosis|osmosis_token_factory'

# Test 2: Ensure that all existing tests are passing after the feature flag removal.
# Expect: All tests should pass.
cargo test

Length of output: 1920


Script:

#!/bin/bash
# Description: Search for conditional compilation attributes using the removed feature flags.

# Search for conditional compilation attributes using the removed feature flags.
rg --type rust '#\[cfg\(feature = "(injective|token_factory|osmosis|osmosis_token_factory)"\)\]'

Length of output: 98

.github/workflows/release-artifacts-on-tag.yaml (2)

18-18: LGTM!

The code change is approved.


29-29: LGTM!

The code change is approved.

scripts/build_release.sh (4)

9-9: LGTM!

The change to the display_usage function aligns with the goal of simplifying the script's usage by removing the need to specify a deployment chain using the -c flag.


19-25: LGTM!

The changes introduce architecture-specific handling of the optimizer Docker image, which is a good practice to ensure compatibility across different architectures. The version update of the Docker images likely indicates an upgrade to the underlying tools used for building.


36-36: LGTM!

The new comment provides clarity about the purpose of the script, which is to retrieve artifact versions. This change improves the script's readability and maintainability.


12-17: Skipping the Shellcheck warning.

The warning about using spaces instead of commas to separate array elements is a false positive. Using spaces to separate array elements is a valid syntax in Bash, and using commas is not required. It is a matter of personal preference or coding style.

Tools
Shellcheck

[warning] 12-17: Use spaces, not commas, to separate array elements.

(SC2054)

.github/workflows/pr-convcom-check.yaml (1)

19-19: LGTM!

Updating the toolchain version to 1.80.0 is a good practice to leverage the latest improvements and bug fixes. The toolchain version update aligns with the PR objective of cleaning up the codebase.

contracts/liquidity_hub/epoch-manager/Cargo.toml (8)

5-5: LGTM!

The code change is approved.


6-6: LGTM!

The code change is approved.


7-7: LGTM!

The code change is approved.


8-8: LGTM!

The code change is approved.


9-9: LGTM!

The code change is approved.


10-10: LGTM!

The code change is approved.


11-11: LGTM!

The code change is approved.


Line range hint 1-11: LGTM!

The removal of feature declarations is approved.

contracts/liquidity_hub/incentive-manager/Cargo.toml (1)

40-40: LGTM!

The dependency change from white-whale-testing to common-testing is approved.

.github/workflows/ci-test-lints.yaml (1)

1-12: LGTM!

The workflow structure looks good. It ensures that the test suite and lints are run on every pull request and push to the main branch.

Cargo.toml (2)

Line range hint 4-11: Verify the impact of removing entries from the members list.

Several entries have been removed from the members list, including "integration-tests" and various components under "contracts/liquidity_hub". This indicates a potential restructuring or removal of certain modules from the workspace.

Please ensure that:

  1. The removed modules are no longer needed in the project.
  2. The removal does not break any dependencies or functionality.
  3. The documentation is updated to reflect the changes in the project structure.

Run the following script to verify the usage of the removed modules:

Verification successful

Verification Successful: No Impact from Removed Modules

The removed modules from the members list in Cargo.toml are not used anywhere in the current codebase. This confirms that their removal does not impact any dependencies or functionality. Ensure that any related documentation is updated to reflect these changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the removed modules.

# Test: Search for the usage of the removed modules. Expect: No occurrences.
modules=(
  "integration-tests" 
  "contracts/liquidity_hub/pool-network/*"
  "contracts/liquidity_hub/fee_collector"
  "contracts/liquidity_hub/fee_distributor"
  "contracts/liquidity_hub/whale_lair"
  "contracts/liquidity_hub/vault-manager"
  "contracts/liquidity_hub/bonding-manager"
)

for module in "${modules[@]}"
do
  echo "Searching for usages of $module..."
  rg --type rust -i "$module" || echo "No usages found."
done

Length of output: 2125


39-40: Verify the impact of updating the dependencies and update references.

The paths for white-whale-std and white-whale-testing have been replaced with version specifications. This change suggests a move towards more stable and version-controlled dependencies, which could potentially improve the reliability and maintainability of the project.

Please ensure that:

  1. The version update for white-whale-std does not introduce any breaking changes.
  2. All references to white-whale-testing are updated to common-testing in the codebase.

Run the following script to verify the references to white-whale-testing:

If references are found, apply the necessary changes to update them to common-testing.

Verification successful

Verification successful: No references to white-whale-testing found.

The transition from white-whale-testing to common-testing has been completed successfully, with no remaining references to the old dependency name in the Rust codebase. The update to white-whale-std should also be verified for compatibility, but the reference update is confirmed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the references to `white-whale-testing`.

# Test: Search for the references to `white-whale-testing`. Expect: No occurrences.
rg --type rust -i "white-whale-testing" || echo "No references found."

Length of output: 90

contracts/liquidity_hub/pool-manager/src/swap/commands.rs (1)

Line range hint 1-92: Verify the removal of the Osmosis fee from the swap output.

The AI-generated summary indicates that the conditional compilation block related to the osmosis_fee_amount has been removed from the output. However, the provided code does not show the removed lines or old code.

To verify the changes, please provide the following:

  1. The removed lines or old code that included the osmosis_fee_amount in the output.
  2. The reason for removing the Osmosis fee from the swap output.
  3. Confirmation that the removal of the Osmosis fee does not affect the correctness of the swap operation.

Once the additional context is provided, I can proceed with a more thorough review of the changes.

contracts/liquidity_hub/pool-manager/src/swap/perform_swap.rs (1)

115-122: LGTM!

The code changes are approved. The removal of the osmosis_fee_asset field from the SwapResult struct simplifies the code and eliminates the need for conditional compilation based on the "osmosis" feature flag.

contracts/liquidity_hub/incentive-manager/src/contract.rs (2)

17-17: LGTM!

The change to the CONTRACT_NAME constant is approved.


Line range hint 173-173: Verify the impact of removing the conditional compilation attribute.

Ensure that including the migrate function in coverage reports does not have any unintended consequences.

Run the following script to verify the impact of the change:

Verification successful

Removal of Conditional Compilation Attribute Verified

The removal of the #[cfg(not(tarpaulin_include))] attribute from the migrate function in the incentive-manager module aligns with the pattern observed in other modules. This change ensures the function is included in coverage reports without affecting functionality. No unintended consequences are expected.

  • Location: contracts/liquidity_hub/incentive-manager/src/contract.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that including the `migrate` function in coverage reports does not have any unintended consequences.

# Test: Search for the `migrate` function implementation. Expect: Only one occurrence.
rg --type rust -A 5 $'pub fn migrate'

Length of output: 1920

contracts/liquidity_hub/pool-manager/src/contract.rs (5)

19-19: LGTM!

The code change is approved.


23-23: LGTM!

The code change is approved.


50-50: LGTM!

The code change is approved.


85-85: LGTM!

The code change is approved.


190-190: LGTM!

The code change is approved.

contracts/liquidity_hub/pool-manager/src/queries.rs (2)

70-77: LGTM!

The code changes are approved. The simplification of the SimulationResponse structure enhances code readability and maintainability by eliminating the conditional logic related to the "osmosis" feature and providing a uniform response structure.


105-111: LGTM!

The code changes are approved. The simplification of the ReverseSimulationResponse structure enhances code readability and maintainability by eliminating the conditional logic related to the "osmosis" feature and providing a uniform response structure.

Also applies to: 166-172

contracts/liquidity_hub/pool-manager/src/helpers.rs (2)

244-249: LGTM!

The code changes are approved. The function has been simplified by removing the conditional logic related to the "osmosis" feature.


258-287: LGTM!

The code changes are approved. The function has been simplified by removing the conditional logic related to the "osmosis" feature. The fees are now consistently subtracted from the return_amount, which simplifies the control flow and reduces code duplication.

contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs (9)

Line range hint 12-16: LGTM!

The code changes are approved.


Line range hint 20-138: LGTM!

The code changes are approved.


Line range hint 144-183: LGTM!

The code changes are approved.


Line range hint 186-226: LGTM!

The code changes are approved.


Line range hint 286-450: LGTM!

The code changes are approved.


Line range hint 453-526: LGTM!

The code changes are approved.


Line range hint 529-617: LGTM!

The code changes are approved.


Line range hint 620-812: LGTM!

The code changes are approved.


Line range hint 815-906: LGTM!

The code changes are approved.

Comment on lines +13 to +16
TXFLAG=(--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag)
else
# Using a string for TXFLAG
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 0.15$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
Copy link

Choose a reason for hiding this comment

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

Review the increased gas price and address Shellcheck warnings.

  1. The gas price for the new networks is set to 0.35$DENOM, which is an increase from the previous value of 0.15$DENOM used for other networks. Please ensure that this increase is intentional and consider its implications on transaction costs for these networks.

  2. Shellcheck has provided the following warnings:

    • Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. (SC2206)
    • Variable was used as an array but is now assigned a string. (SC2178)

To address these warnings and improve the script's robustness, consider applying the following changes:

-		TXFLAG=(--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag)
+		TXFLAG=(--node "$RPC" --chain-id "$CHAIN_ID" --gas-prices "0.35$DENOM" --gas auto --gas-adjustment 1.2 -y -b "$b_flag" --output "$output_flag")

-		TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
+		TXFLAG=(--node "$RPC" --chain-id "$CHAIN_ID" --gas-prices "0.35$DENOM" --gas auto --gas-adjustment 1.2 -y -b "$b_flag" --output "$output_flag")

These changes:

  • Quote the variables to prevent word splitting/globbing.
  • Consistently use an array for TXFLAG in both cases to avoid the variable usage warning.

Do you want me to open a GitHub issue to track these changes?

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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TXFLAG=(--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag)
else
# Using a string for TXFLAG
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 0.15$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 0.35$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
TXFLAG=(--node "$RPC" --chain-id "$CHAIN_ID" --gas-prices "0.35$DENOM" --gas auto --gas-adjustment 1.2 -y -b "$b_flag" --output "$output_flag")
else
# Using a string for TXFLAG
TXFLAG=(--node "$RPC" --chain-id "$CHAIN_ID" --gas-prices "0.35$DENOM" --gas auto --gas-adjustment 1.2 -y -b "$b_flag" --output "$output_flag")
Tools
Shellcheck

[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 13-13: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)


[warning] 16-16: Variable was used as an array but is now assigned a string.

(SC2178)

Comment on lines +13 to +33
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.80.0
target: wasm32-unknown-unknown
override: true

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.15.0"
args: '--locked -- --test-threads 4'

Copy link

Choose a reason for hiding this comment

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

Update the versions of the actions.

The "Test Suite" job looks good, but please update the versions of the actions to ensure compatibility and security.

-uses: actions/checkout@v2
+uses: actions/checkout@v3

-uses: actions-rs/toolchain@v1
+uses: actions-rs/toolchain@v2

-uses: actions-rs/tarpaulin@v0.1
+uses: actions-rs/tarpaulin@v0.2

Committable suggestion was skipped due to low confidence.

Tools
actionlint

18-18: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


21-21: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

Comment on lines +34 to +69
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.80.0
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Generate Schema
uses: actions-rs/cargo@v1
with:
command: schema
args: --locked

- name: Schema Changes
# fails if any changes not committed
run: git diff --exit-code schema
Copy link

Choose a reason for hiding this comment

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

Update the versions of the actions.

The "Lints" job looks good, but please update the versions of the actions to ensure compatibility and security.

-uses: actions/checkout@v2
+uses: actions/checkout@v3

-uses: actions-rs/toolchain@v1
+uses: actions-rs/toolchain@v2

-uses: actions-rs/cargo@v1
+uses: actions-rs/cargo@v2

Committable suggestion was skipped due to low confidence.

Tools
actionlint

39-39: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


42-42: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


50-50: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


56-56: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


62-62: the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

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.

1 participant