-
Notifications
You must be signed in to change notification settings - Fork 26
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
Removed Rates module from Point ADO #761
Conversation
WalkthroughThe pull request introduces significant changes to the Andromeda Point contract, primarily focusing on simplifying the execution flow. The modifications involve removing rate and tax-related functionalities from the Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (7)
🔇 Additional comments (2)
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? 🪧 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 (
|
We can remove the rates feature from here: |
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
🧹 Nitpick comments (4)
contracts/math/andromeda-point/src/execute.rs (2)
24-29
: Avoid unnecessary cloning ofmsg
The
msg.clone()
in the match statement may be redundant. IfExecuteMsg
implements theCopy
trait or if ownership transfer is acceptable, consider removing the clone to improve efficiency.Apply this diff to eliminate the cloning:
-let res = match msg.clone() { +let res = match msg {
59-59
: Avoid unnecessary cloning ofpoint
when saving to storageCloning
point
before saving may be unnecessary. IfDATA.save
accepts a reference topoint
, you can avoid the clone to enhance performance.Apply this diff to remove the clone:
- DATA.save(ctx.deps.storage, &point.clone())?; + DATA.save(ctx.deps.storage, &point)?;contracts/math/andromeda-point/src/testing/mock.rs (1)
Line range hint
27-29
:
Consider passingpoint
by value to avoid cloningIn the
set_point
function, cloningpoint
may be unnecessary. Passingpoint
by value can eliminate the need for cloning and improve efficiency.Apply this diff to modify the function signature and usage:
-pub fn set_point( - deps: DepsMut<'_>, - point: &PointCoordinate, - sender: &str, -) -> Result<Response, ContractError> { - let msg = ExecuteMsg::SetPoint { - point: point.clone(), - }; +pub fn set_point( + deps: DepsMut<'_>, + point: PointCoordinate, + sender: &str, +) -> Result<Response, ContractError> { + let msg = ExecuteMsg::SetPoint { + point, + };contracts/os/andromeda-adodb/src/tests.rs (1)
721-725
: LGTM! Consider expanding test coverage.The test correctly verifies handling of multiple versions of the same ADO type. However, consider adding test cases for:
- Pre-release versions (e.g.,
0.1.0-alpha.1
)- Major version changes (e.g.,
1.0.0
)- Invalid version formats
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
contracts/math/andromeda-point/src/execute.rs
(3 hunks)contracts/math/andromeda-point/src/mock.rs
(0 hunks)contracts/math/andromeda-point/src/testing/mock.rs
(1 hunks)contracts/math/andromeda-point/src/testing/tests.rs
(1 hunks)contracts/os/andromeda-adodb/src/tests.rs
(1 hunks)contracts/os/andromeda-kernel/src/testing/test_handler.rs
(3 hunks)
💤 Files with no reviewable changes (1)
- contracts/math/andromeda-point/src/mock.rs
✅ Files skipped from review due to trivial changes (1)
- contracts/os/andromeda-kernel/src/testing/test_handler.rs
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Contracts
- GitHub Check: Summary
🔇 Additional comments (7)
contracts/math/andromeda-point/src/execute.rs (5)
4-4
: Imports ofcall_action
andExecuteContext
are appropriateThe addition of
call_action
andExecuteContext
to the imports aligns with their usage in the code and is necessary for the updated functionality.
7-7
: Importingensure
andResponse
fromcosmwasm_std
Including
ensure
andResponse
is essential for error handling and constructing responses.
16-22
: Proper invocation ofcall_action
functionThe
call_action
function is correctly called, and its response is stored inaction_response
. This integration ensures that actions are appropriately handled.
31-34
: Correctly appending action responses to the final resultThe response from
call_action
is properly merged into the finalResponse
using.add_submessages()
,.add_attributes()
, and.add_events()
.
53-65
: Function signature ofset_point
updated appropriatelyThe
set_point
function now accepts onlyctx
andpoint
, reflecting the removal of theaction
parameter and simplifying the function's usage.contracts/math/andromeda-point/src/testing/mock.rs (1)
11-11
: Imports are correctly updatedThe inclusion of additional types such as
Deps
,DepsMut
,MessageInfo
,OwnedDeps
, andResponse
is appropriate for the testing environment.contracts/math/andromeda-point/src/testing/tests.rs (1)
1-7
: Imports and test setup are updated correctlyThe updated imports and test configurations reflect the changes in the codebase, focusing on point management without rate or tax functionalities.
The Rates module is not needed, so I removed that from the contract.
Summary by CodeRabbit
Refactor
set_point
method signature.Tests
Chores
andromeda-std
.