-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(tx): port simappv2 changes #20648
Conversation
Warning Rate limit exceeded@testinginprod has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 13 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent updates introduce new functionality and refinements to various components related to transaction decoding and handling within the system. Key changes comprise modifications to the Changes
Sequence Diagram(s)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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@testinginprod your pull request is missing a changelog! |
}) | ||
require.NoError(t, err) | ||
|
||
gogoproto.RegisterType(&bankv1beta1.MsgSend{}, string((&bankv1beta1.MsgSend{}).ProtoReflect().Descriptor().FullName())) |
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.
this is the test fix to make it work.
the alternative was a really hefty refactor
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.
brilliant 🙌
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- x/tx/decode/decode.go (6 hunks)
- x/tx/decode/decode_test.go (4 hunks)
- x/tx/decode/fuzz_test.go (3 hunks)
Additional context used
Path-based instructions (3)
x/tx/decode/fuzz_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"x/tx/decode/decode_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"x/tx/decode/decode.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (10)
x/tx/decode/fuzz_test.go (2)
21-25
: The implementation ofmockCodec.Unmarshal
directly delegates togogoproto.Unmarshal
. This is a straightforward wrapper, ensuring that themockCodec
adheres to thegogoProtoCodec
interface. This is a good use of interface abstraction to facilitate testing.
117-117
: The instantiation ofmockCodec
withinNewDecoder
is correctly done, ensuring that theProtoCodec
field is populated for the decoder. This is crucial for the decoder's functionality as it relies on this codec to unmarshal transaction bytes.x/tx/decode/decode_test.go (3)
25-29
: ThemockCodec
type and itsUnmarshal
method are correctly implemented to wrap thegogoproto.Unmarshal
function. This encapsulation is essential for isolating the unmarshalling logic, which can be swapped out or mocked in unit tests.
56-56
: Proper initialization ofmockCodec
inNewDecoder
ensures that theProtoCodec
field is correctly set, which is vital for the decoding process in the tests.
60-61
: Registration of message types usinggogoproto.RegisterType
is crucial for ensuring that these types are recognized during the decoding process. This setup is necessary for the tests to simulate realistic scenarios where these message types are decoded.x/tx/decode/decode.go (5)
23-24
: TheDecodedTx
struct now includesDynamicMessages
and changesMessages
to usegogoproto.Message
. This modification supports handling both dynamic and statically known protobuf messages, enhancing the flexibility of the transaction decoding process.
38-40
: Definition of thegogoProtoCodec
interface with anUnmarshal
method is a good practice. It abstracts the unmarshalling process, allowing for different implementations that can be injected into theDecoder
, facilitating easier testing and modularity.
45-45
: TheDecoder
struct now includes acodec
field of typegogoProtoCodec
, and theNewDecoder
function validates this field. This is a crucial update ensuring that the decoder is properly configured before use, enhancing robustness and error handling in the decoding process.Also applies to: 51-51, 59-64
Line range hint
122-172
: TheDecode
method has been significantly updated to handle unmarshalling into both dynamic and gogoproto messages. This update is substantial as it enhances the decoder's capability to handle different types of protobuf messages, thus supporting a broader range of transaction types. The method now also handles error propagation and validation more robustly, improving the reliability and maintainability of the code.
200-200
: TheGetMessages
method inDecodedTx
now has a simplified return statement, improving readability and maintainability. This change makes the method's behavior more straightforward to understand.
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- simapp/mint_fn.go (1 hunks)
- x/auth/tx/gogotx.go (1 hunks)
Additional context used
Path-based instructions (2)
simapp/mint_fn.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/auth/tx/gogotx.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (3)
simapp/mint_fn.go (2)
20-20
: RefactorSendCoinsFromModuleToModule
to use separate parameters for sender and recipient modules enhances clarity and reduces potential for misuse.Ensure the documentation is updated to reflect these parameter changes.
20-20
: Integration of the updatedSendCoinsFromModuleToModule
method inProvideExampleMintFn
is handled correctly.x/auth/tx/gogotx.go (1)
77-77
: Update to iterate overDynamicMessages
aligns with the newDecodedTx
structure.Consider adding error handling for
ProtoReflect
method calls in case of failure.
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/auth/tx/config.go (1 hunks)
Additional context used
Path-based instructions (1)
x/auth/tx/config.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (1)
x/auth/tx/config.go (1)
193-197
: The implementation of theNewDecoder
with the newProtoCodec
option is correctly integrated. Ensure that all dependent configurations are updated accordingly.
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/auth/tx/testutil/suite.go (1 hunks)
Additional context used
Path-based instructions (1)
x/auth/tx/testutil/suite.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (1)
x/auth/tx/testutil/suite.go (1)
325-332
: Changes inTestWrapTxBuilder
correctly ensure that the byte representations of transactions from differentTxBuilder
instances are equal. This is essential for verifying the functionality ofWrapTxBuilder
.
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- x/auth/ante/expected_keepers.go (1 hunks)
- x/auth/ante/testutil/expected_keepers_mocks.go (1 hunks)
Additional context used
Path-based instructions (2)
x/auth/ante/expected_keepers.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/auth/ante/testutil/expected_keepers_mocks.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (2)
x/auth/ante/expected_keepers.go (1)
33-33
: The addition ofGetCometInfo
method to theConsensusKeeper
interface is consistent with the existing interface design and uses appropriate Go conventions.x/auth/ante/testutil/expected_keepers_mocks.go (1)
198-211
: The mock implementation ofGetCometInfo
inMockConsensusKeeper
correctly follows the GoMock standards and accurately reflects the method signature in theConsensusKeeper
interface.
@testinginprod can you merge main and then we can merge this |
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/auth/ante/testutil/expected_keepers_mocks.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/auth/ante/testutil/expected_keepers_mocks.go
* main: feat(tx): port simappv2 changes (#20648) build(deps): Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#20682) chore(proto): fix comments (#20679) (serverv2/cometbft) Commands support both json and yaml output (#20670) fix(x/staking,x/auth): regenerate mock to fix test (#20684) docs: ADR 074: Msg v2 (#20618) fix: nested multisig signatures using CLI (#20438) chore: fix spelling errors (#20674) fix: align Dockerfile for build-push-action (#20672) fix: avoid build fail when make localnet-build-env (#20671) build(deps): Bump bufbuild/buf-setup-action from 1.32.2 to 1.33.0 (#20669) chore: make function comment match function names (#20666) chore(consensus): add cometInfo to consensus (#20615) chore: fix typos (#20662) fix: Properly parse json in the wait-tx command. (#20631) fix(sims): check before sending RotateConsPubKey (#20659) test(types/address): add unit tests for the file types/address.go (#20237)
Description
This PR ports the x/tx changes from simappv2 PR #20412 .
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
GetCometInfo
inConsensusKeeper
interface for querying Comet information.Bug Fixes
MintBankKeeper
interface for better module-to-module coin transfer handling.Tests
GetCometInfo
method inMockConsensusKeeper
.