-
Notifications
You must be signed in to change notification settings - Fork 586
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
Skip distribution if refund fails to send on channel closure #1523
Skip distribution if refund fails to send on channel closure #1523
Conversation
modules/apps/29-fee/keeper/escrow.go
Outdated
if k.bankKeeper.BlockedAddr(refundAddr) { | ||
continue | ||
} |
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 blocked check happens in SendCoinsFromModuleToAccount
now instead
} | ||
|
||
k.DeleteFeesInEscrow(cacheCtx, identifiedPacketFee.PacketId) | ||
if !failedToSendCoins { |
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.
it's possible an error occurred sending the coins, we don't want to remove them unless they were actually sent.
Codecov Report
@@ Coverage Diff @@
## main #1523 +/- ##
==========================================
+ Coverage 80.27% 80.29% +0.02%
==========================================
Files 166 166
Lines 12252 12252
==========================================
+ Hits 9835 9838 +3
+ Misses 1954 1952 -2
+ Partials 463 462 -1
|
…n-if-refund-fails-to-send-on-channel-closure' into cian/issue#1396-skip-distribution-if-refund-fails-to-send-on-channel-closure
modules/apps/29-fee/keeper/escrow.go
Outdated
@@ -214,21 +215,16 @@ func (k Keeper) RefundFeesOnChannelClosure(ctx sdk.Context, portID, channelID st | |||
return err |
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.
i think this error also still needs to be handled so improperly formatted refund addr doesnt stop channel closure?
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.
ah that's a good point, it's effectively the same situation. Nice catch!
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.
🤝
…fails-to-send-on-channel-closure
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.
lgtm! 🎉
…n-if-refund-fails-to-send-on-channel-closure' into cian/issue#1396-skip-distribution-if-refund-fails-to-send-on-channel-closure
"github.com/tendermint/tendermint/crypto/secp256k1" | ||
|
||
"github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" | ||
transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" | ||
channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" | ||
"github.com/tendermint/tendermint/crypto/secp256k1" |
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.
nit: group imports by type, see #382
import (
// standard library imports
"fmt"
"testing"
// external library imports
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
// ibc-go library imports
"github.com/cosmos/ibc-go/modules/core/23-commitment/types"
)
Description
closes: #1396
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes