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

Consolidate usage of NewErrorAcknowledgement #1565

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c264fa0
feat: include ABCI code in failed acknowledgement.
chatton Jun 14, 2022
1ad5de5
fix: removing transfertypes.NewErrorAcknowledgement and interchainacc…
chatton Jun 22, 2022
e49b35f
chore: added PR number to CHANGELOG.md
chatton Jun 22, 2022
8283fbe
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 22, 2022
2fd3b3a
chore: fixed imports
chatton Jun 22, 2022
38c89eb
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 22, 2022
2102783
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 23, 2022
a5d118e
chore: addressing PR feedback
chatton Jun 23, 2022
647d1e1
fix: displaying ack error message only if there is an error unmarshal…
chatton Jun 23, 2022
0cd0af3
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 23, 2022
ea311bd
chore: addressed PR feedback
chatton Jun 24, 2022
8e5eb6e
chore: fixing formatting, adding changes to migration doc.
chatton Jun 27, 2022
725ef86
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 27, 2022
52ede1a
Update modules/apps/27-interchain-accounts/controller/keeper/events.go
chatton Jun 27, 2022
e0a953f
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 27, 2022
c480718
Update docs/migrations/v3-to-v4.md
chatton Jun 27, 2022
d1089b9
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
seantking Jun 27, 2022
230a219
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 28, 2022
6c15291
Merge branch 'main' into cian/issue#819-add-a-generic-function-to-con…
chatton Jun 28, 2022
84d2d44
Update CHANGELOG.md
chatton Jun 28, 2022
d3e72ea
chore: wrapping errors using sdkerrors.Wrapf
chatton Jun 28, 2022
50dfd89
chore: fixing imports
chatton Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package controller

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
Expand Down Expand Up @@ -140,7 +138,7 @@ func (im IBCMiddleware) OnRecvPacket(
packet channeltypes.Packet,
_ sdk.AccAddress,
) ibcexported.Acknowledgement {
err := fmt.Errorf("cannot receive packet on controller chain")
err := sdkerrors.Wrapf(icatypes.ErrInvalidChannelFlow, "cannot receive packet on controller chain")
ack := channeltypes.NewErrorAcknowledgement(err)
keeper.EmitAcknowledgementEvent(ctx, packet, ack, err)
return ack
Expand Down
3 changes: 2 additions & 1 deletion modules/apps/transfer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package transfer

import (
"fmt"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting :)

"math"
"strings"

Expand Down Expand Up @@ -180,7 +181,7 @@ func (im IBCModule) OnRecvPacket(
var data types.FungibleTokenPacketData
var ackErr error
if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil {
ackErr = fmt.Errorf("cannot unmarshal ICS-20 transfer packet data")
ackErr = sdkerrors.Wrapf(icatypes.ErrInvalidChannelFlow, "cannot unmarshal ICS-20 transfer packet data")
ack = channeltypes.NewErrorAcknowledgement(ackErr)
}

Expand Down