Skip to content
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(ante)!: allow refundable txs with more than a single message #1316

Merged
merged 9 commits into from
Feb 19, 2022

Conversation

cgorenflo
Copy link
Contributor

No description provided.

@cgorenflo cgorenflo linked an issue Feb 15, 2022 that may be closed by this pull request
if !ok {
return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx")
}
if err := d.qualifyForRefund(ctx, msgs); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will prevent unbond validators to submit txs

@milapsheth
Copy link
Member

One of the comments doesn't show up properly in the overview here.

if validator == nil || !validator.IsBonded() {
return false
}
func (d CheckRefundFeeDecorator) qualifyForRefund(ctx sdk.Context, msgs []sdk.Msg) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are going to allow refund if and only if all msgs are RefundMsgRequest and contain registered inner msg, correct? If so, can you add a comment to this function so it becomes clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's correct

if validator == nil || !validator.IsBonded() {
return false
}
func (d CheckRefundFeeDecorator) qualifyForRefund(ctx sdk.Context, msgs []sdk.Msg) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (d CheckRefundFeeDecorator) qualifyForRefund(ctx sdk.Context, msgs []sdk.Msg) error {
func (d CheckRefundFeeDecorator) validateRefundQualification(ctx sdk.Context, msgs []sdk.Msg) error {

@haiyizxx haiyizxx added the next release Required for the next release label Feb 18, 2022
Copy link
Contributor

@haiyizxx haiyizxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

x/ante/check_refund.go Show resolved Hide resolved
x/ante/check_refund.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release Required for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow refund of multiple refundable msgs in a tx
4 participants