Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reuse crates #101

Merged
merged 3 commits into from
Dec 10, 2024
Merged

chore: reuse crates #101

merged 3 commits into from
Dec 10, 2024

Conversation

mantricjavier
Copy link
Collaborator

@mantricjavier mantricjavier commented Dec 10, 2024

Description and Motivation

Remove the local packages amm, common-testing and utils and replace them with the public variants from cratesio mantra-dex-std, mantra-common-testing and mantra-utils.

Additionally, exposes the extra fee amount in the ReverseSwapSimulation.

Related Issues


Checklist:

  • I have read MANTRA's contribution guidelines.
  • 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

Release Notes

  • New Features

    • Enhanced deployment script to provide clearer output regarding pool configuration during creation.
    • Updated JSON schema for pool-manager to include extra_fees_amount in responses.
  • Bug Fixes

    • Adjusted various import paths to ensure compatibility with the new mantra_dex_std module.
  • Documentation

    • Improved descriptions in the pool-manager schema for better clarity on operational limits and fee structures.
  • Chores

    • Removed deprecated amm package and its associated files, transitioning to mantra_dex_std.

@mantricjavier mantricjavier merged commit f5ddd16 into main Dec 10, 2024
4 checks passed
@mantricjavier mantricjavier deleted the chore/reuse-crates branch December 10, 2024 10:50
Copy link

coderabbitai bot commented Dec 10, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces significant changes across multiple files, primarily involving the transition from the amm namespace to the mantra_dex_std namespace. This includes updates to Cargo.toml files for various packages, where dependencies have been modified to reflect the new structure. Additionally, numerous import statements have been updated to source types and functions from mantra_dex_std. The changes also include the removal of the amm package and its associated files, indicating a complete reorganization of the project's structure and dependencies.

Changes

File Path Change Summary
Cargo.toml Updated workspace configuration, removed wildcard entry, added explicit contract directories, updated metadata fields, added dependencies.
contracts/epoch-manager/Cargo.toml Replaced amm.workspace dependency with mantra-dex-std.workspace.
contracts/epoch-manager/src/commands.rs Updated import for EpochConfig from amm to mantra_dex_std.
contracts/epoch-manager/src/contract.rs Updated import paths for epoch manager types from amm to mantra_dex_std.
contracts/epoch-manager/src/helpers.rs Updated import for DAY_IN_SECONDS from amm to mantra_dex_std.
contracts/epoch-manager/src/queries.rs Updated import paths for query types from amm to mantra_dex_std.
contracts/epoch-manager/src/state.rs Updated import for Config type from amm to mantra_dex_std.
contracts/epoch-manager/tests/common.rs Updated imports for EpochConfig and InstantiateMsg from amm to mantra_dex_std.
contracts/epoch-manager/tests/config.rs Updated imports for query and execute message types from amm to mantra_dex_std.
contracts/epoch-manager/tests/epoch.rs Updated imports for query message types from amm to mantra_dex_std.
contracts/epoch-manager/tests/instantiate.rs Updated imports for constants and message types from amm to mantra_dex_std.
contracts/farm-manager/Cargo.toml Replaced amm.workspace and common-testing.workspace dependencies with new ones.
contracts/farm-manager/src/contract.rs Updated import paths for farm manager types from amm to mantra_dex_std.
contracts/farm-manager/src/error.rs Updated import for EpochId from amm to mantra_dex_std.
contracts/farm-manager/src/farm/commands.rs Updated imports and function calls to reference mantra_dex_std.
contracts/farm-manager/src/farm/tests/rewards.rs Updated imports for Curve, Farm, and Position types from amm to mantra_dex_std.
contracts/farm-manager/src/helpers.rs Updated import paths for various farm management functions from amm to mantra_dex_std.
contracts/farm-manager/src/manager/commands.rs Updated import paths for farm management functions from amm to mantra_dex_std.
contracts/farm-manager/src/position/commands.rs Updated import paths for Position type and get_current_epoch function from amm to mantra_dex_std.
contracts/farm-manager/src/position/helpers.rs Updated import paths for Config, EpochId, Position, and RewardsResponse from amm to mantra_dex_std.
contracts/farm-manager/src/queries.rs Updated import paths for various query types from amm to mantra_dex_std.
contracts/farm-manager/src/state.rs Updated import paths for Config, PoolInfo, and SwapOperation from amm to mantra_dex_std.
contracts/farm-manager/src/swap/commands.rs Updated import paths for burn_coin_msg and validate_addr_or_default from amm to mantra_dex_std.
contracts/farm-manager/src/swap/perform_swap.rs Updated import path for PoolInfo from amm to mantra_dex_std.
contracts/farm-manager/src/tests/integration.rs Updated import paths for fee and pool manager types from amm to mantra_dex_std.
contracts/farm-manager/src/tests/suite.rs Updated import paths and message types to use mantra_dex_std.
contracts/fee-collector/Cargo.toml Replaced amm.workspace with mantra-dex-std.workspace.
contracts/fee-collector/src/bin/schema.rs Updated import paths for message types from amm to mantra_dex_std.
contracts/fee-collector/src/contract.rs Updated import paths for message types from amm to mantra_dex_std.
contracts/fee-collector/tests/integration.rs Updated import paths for message types from amm to mantra_dex_std.
contracts/pool-manager/Cargo.toml Updated version number and dependencies, replacing amm.workspace with mantra-dex-std.workspace.
contracts/pool-manager/schema/pool-manager.json Updated contract version and modified schema descriptions for clarity.
contracts/pool-manager/src/contract.rs Updated import paths for message types from amm to mantra_dex_std.
contracts/pool-manager/src/helpers.rs Updated import paths for various pool management functions from amm to mantra_dex_std.
contracts/pool-manager/src/manager/commands.rs Updated import paths for pool management functions from amm to mantra_dex_std.
contracts/pool-manager/src/queries.rs Updated import paths for pool manager types from amm to mantra_dex_std.
contracts/pool-manager/src/state.rs Updated import paths for Config, PoolInfo, and SwapOperation from amm to mantra_dex_std.
contracts/pool-manager/src/tests/integration_tests.rs Updated import paths for fee and pool manager types from amm to mantra_dex_std.
contracts/pool-manager/src/tests/suite.rs Updated import paths for various pool manager functions to use mantra_dex_std.
packages/amm/Cargo.toml Deleted configuration file for amm package.
packages/amm/src/coin.rs Deleted file containing functions related to factory tokens.
packages/amm/src/common.rs Deleted file containing address validation function.
packages/amm/src/constants.rs Deleted file containing time-related constants.
packages/amm/src/epoch_manager.rs Deleted file containing epoch management contract implementation.
packages/amm/src/farm_manager.rs Deleted file containing farm management contract implementation.
packages/amm/src/fee.rs Deleted file containing fee structures and functionalities.
packages/amm/src/fee_collector.rs Deleted file containing fee collector contract implementation.
packages/amm/src/lib.rs Deleted file containing module declarations for amm.
packages/amm/src/lp_common.rs Deleted file containing LP token management functions.
packages/amm/src/pool_manager.rs Deleted file containing liquidity pool management contract implementation.
packages/amm/src/tokenfactory/burn.rs Deleted file containing token burning functionality.
packages/amm/src/tokenfactory/common.rs Deleted file containing protocol and message type definitions.
packages/amm/src/tokenfactory/create_denom.rs Deleted file containing token denomination creation functionality.
packages/amm/src/tokenfactory/mint.rs Deleted file containing token minting functionality.
packages/amm/src/tokenfactory/mod.rs Deleted file containing module declarations for the token factory.
packages/amm/src/tokenfactory/responses.rs Deleted file containing response structures for token factory queries.
packages/amm/src/tokenfactory/utils.rs Deleted file containing utility function for retrieving fee.
packages/common-testing/Cargo.toml Deleted configuration file for common-testing package.
packages/common-testing/README.md Deleted README file for common-testing package.
packages/common-testing/src/lib.rs Deleted file containing module declarations for common-testing.
packages/utils/Cargo.toml Deleted configuration file for mantra-utils package.
packages/utils/src/lib.rs Deleted file containing module declarations for utils.
packages/utils/src/macros.rs Deleted file containing validation macro.
packages/utils/src/ownership.rs Deleted file containing ownership update function.
scripts/deployment/deploy_pool.sh Updated script to echo pool type during creation.
xtask/Cargo.toml Updated dependencies to replace amm.workspace with mantra-dex-std.workspace.
xtask/src/main.rs Updated imports to use mantra_dex_std for schema generation.

Poem

In the fields where contracts play,
A rabbit hops, brightening the day.
With mantra_dex_std now in sight,
Dependencies shift, oh what a delight!
From amm to new paths we bound,
In this code garden, joy is found! 🐇✨


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

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