-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor(x/feegrant): remove Address.String() #19886
Conversation
WalkthroughThe changes involve updating the cosmos-sdk to enhance address handling by introducing Changes
Related issues
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 (
|
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: 1
Configuration used: .coderabbit.yml
Files selected for processing (4)
- x/feegrant/client/cli/tx_test.go (28 hunks)
- x/feegrant/simulation/genesis.go (3 hunks)
- x/gov/keeper/deposit.go (1 hunks)
- x/gov/keeper/proposal.go (1 hunks)
Additional comments: 7
x/feegrant/simulation/genesis.go (1)
- 17-30: The introduction of the
addressCodec
parameter in thegenFeeGrants
function and its usage for converting addresses usingBytesToString
method is a good practice for handling address conversions more flexibly. However, it's important to ensure that theaddressCodec
is properly instantiated and passed to this function wherever it's called to avoid runtime errors.x/gov/keeper/proposal.go (1)
- 159-159: Updating the attribute value for
types.AttributeKeyProposalProposer
to useproposerAddr
instead ofproposer.String()
is a positive change that aligns with the objective of removing direct calls to theString()
method. This enhances consistency in address handling.x/gov/keeper/deposit.go (1)
- 184-191: Converting the depositor address to a string using
addressCodec.BytesToString
before emitting an event in theAddDeposit
function is a good practice. It ensures that address data is handled consistently across the module. Just ensure thataddressCodec
is reliably provided to this function to avoid runtime issues.x/feegrant/client/cli/tx_test.go (4)
- 122-136: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [94-129]
Introducing the
addressCodec
parameter in thecreateGrant
function and using it for address conversions is a good practice that aligns with the broader refactor goals. This change ensures that address handling is consistent and flexible. Make sure that all calls tocreateGrant
are updated to pass theaddressCodec
correctly.
- 153-157: Using the
addressCodec
for converting addresses in test setup is consistent with the changes made in the main codebase. This ensures that tests remain aligned with the implementation they are meant to verify.- 446-456: The usage of
addressCodec
for address conversions in test scenarios is correctly applied, ensuring consistency with the main codebase's approach to address handling. This is crucial for maintaining the integrity and relevance of the tests.- 562-570: Applying the
addressCodec
for address conversions in theTestFilteredFeeAllowance
test case is in line with the refactor's objectives. It's important to ensure that such practices are consistently applied across all test cases for uniformity.
Co-authored-by: son trinh <trinhleson2000@gmail.com>
Description
ref:
#13140
#7448
Also removes a couple of calls I forgot to remove in gov.
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.
I have...
Summary by CodeRabbit
createGrant
function in the Fee Grant module to use a newaddressCodec
parameter for address encoding and decoding.addressCodec
parameter in thegenFeeGrants
function for address conversion, improving error handling.