Skip to content

Commit

Permalink
fix(statemachine)!: allow overwriting of 29-fee payee to relayer addr…
Browse files Browse the repository at this point in the history
…ess (backport #5441) (#5499)

* fix(statemachine)!: allow overwriting of 29-fee payee to relayer address (#5441)

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 9c77534)

* add changelog

---------

Co-authored-by: chandiniv1 <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2024
1 parent cf0ba51 commit 7ebb9a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* (apps/27-interchain-accounts) [\#5343](https://github.com/cosmos/ibc-go/pull/5343) Add check if controller is enabled in `sendTx` before sending packet to host.
* (apps/29-fee) [\#5441](https://github.com/cosmos/ibc-go/pull/5441) Allow setting the relayer address as payee.

## [v8.0.0](https://github.com/cosmos/ibc-go/releases/tag/v8.0.0) - 2023-11-10

Expand Down
4 changes: 0 additions & 4 deletions modules/apps/29-fee/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ func (msg MsgRegisterPayee) ValidateBasic() error {
return err
}

if msg.Relayer == msg.Payee {
return errorsmod.Wrap(ibcerrors.ErrInvalidRequest, "relayer address and payee must not be equal")
}

_, err := sdk.AccAddressFromBech32(msg.Relayer)
if err != nil {
return errorsmod.Wrap(err, "failed to create sdk.AccAddress from relayer address")
Expand Down
16 changes: 8 additions & 8 deletions modules/apps/29-fee/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ func TestMsgRegisterPayeeValidation(t *testing.T) {
true,
},
{
"invalid portID",
"success: relayer and payee are equal",
func() {
msg.PortId = ""
msg.Relayer = defaultAccAddress
msg.Payee = defaultAccAddress
},
false,
true,
},
{
"invalid channelID",
"invalid portID",
func() {
msg.ChannelId = ""
msg.PortId = ""
},
false,
},
{
"invalid request relayer and payee are equal",
"invalid channelID",
func() {
msg.Relayer = defaultAccAddress
msg.Payee = defaultAccAddress
msg.ChannelId = ""
},
false,
},
Expand Down

0 comments on commit 7ebb9a8

Please sign in to comment.