Skip to content

Commit

Permalink
move max supported ibc reciever addr len to const
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Sep 17, 2024
1 parent b654088 commit 9a44936
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/ibc-rate-limit/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func ValidateReceiverAddress(packet exported.PacketI) error {
if err := json.Unmarshal(packet.GetData(), &receiverObj); err != nil {
return err
}
if len(receiverObj.Receiver) >= 4096 {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "IBC Receiver address too long. Max supported length is %d", 4096)
if len(receiverObj.Receiver) >= types.MaxSupportedIBCReceiverAddressLength {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "IBC Receiver address too long. Max supported length is %d", types.MaxSupportedIBCReceiverAddressLength)
}
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions x/ibc-rate-limit/types/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package types

const MaxSupportedIBCReceiverAddressLength = 4096

0 comments on commit 9a44936

Please sign in to comment.