-
Notifications
You must be signed in to change notification settings - Fork 170
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: SDK 0.47 related cleanups #2334
Conversation
WalkthroughThe updates reflect a significant shift in the codebase, primarily affecting message handling and testing within a Go project. The changes remove deprecated methods like Changes
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- RELEASE_NOTES.md (1 hunks)
- x/leverage/types/tx.go (22 hunks)
- x/oracle/module.go (1 hunks)
Additional comments: 13
RELEASE_NOTES.md (1)
- 26-32: The release notes correctly highlight the requirement for validators to update to
umee/v2.3.0
or newer due to incompatibility with Cosmos SDK v0.47. This is a critical update that validators need to be aware of to ensure the continued smooth operation of the network. It is important to ensure that all validators are notified of this change and that they understand the necessity of the update to maintain compatibility with the new SDK version.x/leverage/types/tx.go (12)
28-30: The
Route
method has been modified to return an empty string, which may indicate a change in the message routing logic. Ensure that this change is intentional and that the new routing logic (if any) is correctly implemented elsewhere in the codebase. Additionally, theType
method now usessdk.MsgTypeURL(&msg)
which seems to be a new way of handling message types in Cosmos SDK v0.47. Verify that this change aligns with the new SDK requirements and that it does not break any existing functionality.51-53: Similar to the previous comment, the
Route
method forMsgWithdraw
is returning an empty string, and theType
method is usingsdk.MsgTypeURL(&msg)
. This pattern is consistent across all message types in the provided code. It is crucial to ensure that these changes are in line with the new Cosmos SDK version's expectations and that they do not introduce any regressions.74-76: For
MsgMaxWithdraw
, theRoute
method returns an empty string, and theType
method usessdk.MsgTypeURL(&msg)
. This change is consistent with the other message types and should be verified for correctness according to the new SDK's message handling mechanisms.97-99: The
Route
andType
methods forMsgCollateralize
have been updated similarly. It is important to confirm that the new message handling logic is correctly implemented and that these changes are compatible with the rest of the codebase.120-122: The
Route
andType
methods forMsgSupplyCollateral
are also returning empty strings and usingsdk.MsgTypeURL(&msg)
, respectively. As with the other message types, verify that these changes are correct and do not cause any issues with message processing.143-145: The
Route
andType
methods forMsgDecollateralize
follow the same pattern of changes. Ensure that these changes are part of the intended refactoring and that they are consistent with the new SDK's requirements.165-167: For
MsgBorrow
, theRoute
method returns an empty string, and theType
method usessdk.MsgTypeURL(&msg)
. This is part of the broader refactoring pattern observed in the codebase. Confirm that these changes are correct and that they do not negatively impact the application's functionality.187-189: The
Route
andType
methods forMsgMaxBorrow
have been updated in the same manner as the other message types. Verify that these changes are in accordance with the new SDK's guidelines and that they do not introduce any unintended behavior.209-211: For
MsgRepay
, theRoute
method returns an empty string, and theType
method usessdk.MsgTypeURL(&msg)
. This consistent change across all message types should be verified for correctness and compatibility with the new SDK version.240-242: The
Route
andType
methods forMsgLiquidate
are also returning empty strings and usingsdk.MsgTypeURL(&msg)
, respectively. As with the other message types, verify that these changes are correct and do not cause any issues with message processing.287-289: For
MsgLeveragedLiquidate
, theRoute
method returns an empty string, and theType
method usessdk.MsgTypeURL(&msg)
. This is part of the broader refactoring pattern observed in the codebase. Confirm that these changes are correct and that they do not negatively impact the application's functionality.294-296: The helper method
validateSenderAndAsset
is used to validate the sender's address and the asset. It is important to ensure that this method is being used consistently throughout the codebase wherever such validation is required. This will help maintain consistency and reduce the likelihood of errors.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- x/incentive/msgs_test.go (3 hunks)
- x/leverage/types/tx_test.go (3 hunks)
Additional comments: 7
x/incentive/msgs_test.go (3)
6-11: The addition of the
github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx
import is necessary for the updated tests that now uselegacytx.LegacyMsg
instead of the previoussdk.Msg
interface. This change aligns with the Cosmos SDK's migration patterns for handling legacy transactions.61-79: The test function
TestRoutes
has been renamed toTestLegacyMsg
, and the type ofmsgs
has been changed from[]sdk.Msg
to[]legacytx.LegacyMsg
. The assertions within the function have been updated accordingly. This reflects the changes in the Cosmos SDK and ensures that the tests are compatible with the new transaction processing system. However, the assertion on line 75 should also check for the correctness of theGetSignBytes
output, not just that it's non-zero.83-86: The
addV1ToType
function has been updated to replace "*incentive" with "incentive.v1". This change is likely related to versioning updates in the message types and ensures that the tests are checking against the correct message type strings. It's important to verify that this versioning pattern is consistent across the entire codebase.x/leverage/types/tx_test.go (4)
9-13: The import of
gotest.tools/v3/assert
is added, which suggests that the test suite is using this package for assertions. It's important to ensure that this package is included in the project's dependencies and that it is the preferred assertion library for consistency across the test suite.51-55: The test function
TestLegacyMsg
has been introduced, replacing the previousTestRoutes
function. This change reflects the update to uselegacytx.LegacyMsg
instead ofsdk.Msg
. It is important to ensure that all tests that previously relied onsdk.Msg
are updated to use the newlegacytx.LegacyMsg
type for compatibility with the Cosmos SDK v0.47.66-72: The loop is checking that
GetSignBytes()
returns a non-zero length byte slice, which is a good practice to ensure that the messages are correctly implementing the method required for signing. However, the call toaddV1ToType
and the comparison withtx.Type()
have been removed, which is likely due to the removal of theType
method from the message types. This change aligns with the Cosmos SDK's move away from usingType
for message identification.75-77: The
addV1ToType
function has been removed, which is consistent with the removal of theType
method from the message types. This function was previously used to manipulate the type string for testing purposes. Its removal should be verified to ensure that it is not used elsewhere in the codebase and that the tests no longer rely on theType
method for message identification.
Description
Summary by CodeRabbit
Documentation
umee/v2.3.0
or newer.Refactor
Route
andType
methods and addingGetSignBytes
methods.ProposalContents
function from the oracle module, indicating a change in governance proposal simulations.Tests
legacytx.LegacyMsg
type.TestLegacyMsg
and adjusted assertions accordingly.