-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added staking denom #245
Conversation
WalkthroughThe changes in this pull request include updates to the changelog, version number, and mock constants for the Changes
Possibly related PRs
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (4)
packages/injective-testing/src/mocks.rs (1)
12-12
: Summary: New staking denomination constants addedThe changes in this file introduce two new constants related to a staking denomination:
MOCK_STAKE_DECIMALS
: Set to 18, consistent with other decimal constants.MOCK_STAKE_DENOM
: Set to "hinj", representing a new denomination.These additions align with the PR title "feat: added staking denom". While the changes themselves look good, it would be beneficial to have more context on how these new constants will be used in the broader codebase. This will help ensure that the implementation is consistent with the project's requirements and conventions.
Consider adding a comment above these new constants to explain their purpose and intended usage, which would improve code readability and maintainability.
Also applies to: 18-18
packages/injective-testing/src/test_tube/exchange.rs (3)
557-557
: LGTM! Consider adding a comment for clarity.The addition of
MOCK_STAKE_DENOM
is consistent with the existing mock denominations. This change enhances the testing capabilities by including a stake denomination.Consider adding a brief comment explaining the purpose of
MOCK_STAKE_DENOM
to improve code readability:+ // Include mock stake denomination for staking-related tests str_coin("1000000", MOCK_STAKE_DENOM, MOCK_STAKE_DECIMALS),
641-641
: LGTM! Consider adding a comment for consistency.The addition of
MOCK_STAKE_DENOM
here is consistent with the change in theexecute_spot_limit_order
function. This ensures that both spot and derivative order executions include the mock stake denomination.For consistency with the previous suggestion, consider adding a similar comment here:
+ // Include mock stake denomination for staking-related tests str_coin("1000000", MOCK_STAKE_DENOM, MOCK_STAKE_DECIMALS),
557-557
: Summary: New mock stake denomination added successfully.The changes introduce
MOCK_STAKE_DENOM
to both spot and derivative order execution functions, enhancing the testing capabilities for staking-related scenarios. The modifications are consistent and well-integrated.Consider reviewing other parts of the codebase that might benefit from this new mock stake denomination. It may be useful to update relevant test cases or add new ones to ensure comprehensive coverage of staking-related functionality.
Also applies to: 641-641
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (4)
- packages/injective-testing/CHANGELOG.md (1 hunks)
- packages/injective-testing/Cargo.toml (1 hunks)
- packages/injective-testing/src/mocks.rs (1 hunks)
- packages/injective-testing/src/test_tube/exchange.rs (3 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/injective-testing/CHANGELOG.md
- packages/injective-testing/Cargo.toml
🔇 Additional comments (1)
packages/injective-testing/src/mocks.rs (1)
12-12
: LGTM: Consistent decimal places for stake denominationThe addition of
MOCK_STAKE_DECIMALS
with a value of 18 is consistent with other decimal constants in the file, such asMOCK_EXCHANGE_DECIMALS
andMOCK_BASE_DECIMALS
. This ensures uniformity in decimal precision across different denominations.
pub const MOCK_ATOM_DECIMALS: i32 = 8i32; | ||
pub const MOCK_QUOTE_DECIMALS: i32 = 6i32; | ||
|
||
pub const MOCK_ATOM_DENOM: &str = "atom"; | ||
pub const MOCK_BASE_DENOM: &str = "inj"; | ||
pub const MOCK_STAKE_DENOM: &str = "hinj"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
MOCK_STAKE_DENOM
is defined but not used anywhere in the codebase
The constant MOCK_STAKE_DENOM
with the value "hinj"
is currently not referenced in any part of the codebase. Please verify whether this constant is intended for future use or remove it if it's unnecessary to maintain a clean and efficient codebase.
🔗 Analysis chain
Please clarify the purpose and usage of MOCK_STAKE_DENOM
The addition of MOCK_STAKE_DENOM
with the value "hinj" is noted. However, the purpose and intended usage of this new denomination are not immediately clear from the context. Could you please provide more information on:
- What does the "h" prefix in "hinj" represent? (e.g., hashed INJ, staked INJ)
- How and where will this new denomination be used in the codebase?
- Are there any specific reasons for introducing this new denomination alongside the existing
MOCK_BASE_DENOM
("inj")?
This information will help ensure that the new constant aligns with the project's requirements and conventions.
To help understand the usage of this new denomination, let's search for its occurrences in the codebase:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for occurrences of "hinj" in the codebase
rg --type rust '"hinj"'
Length of output: 108
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/injective-cosmwasm/CHANGELOG.md (1)
8-12
: LGTM! Consider adding more detail to the change description.The changelog entry is correctly formatted and placed. The version number is appropriately incremented, and the date is in the correct format and chronological order.
Consider expanding the description to provide more context about the change. For example:
- Add min notional to markets to enforce minimum trade size requirements
This gives users a clearer understanding of why this change was made and its implications.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
- packages/injective-cosmwasm/CHANGELOG.md (1 hunks)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
- packages/injective-testing/Cargo.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/injective-cosmwasm/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/injective-testing/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary by CodeRabbit
New Features
Version Updates
injective-testing
.injective-cosmwasm
.Bug Fixes