Skip to content

Commit

Permalink
refactor(api)!: remove exported.CounterpartyChannelI interface (cosmo…
Browse files Browse the repository at this point in the history
…s#5744)

* rm: channel.CounterpartyI

* docs: add migration doc entry

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
3 people committed Jan 29, 2024
1 parent 4727e2c commit 1504c46
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 35 deletions.
3 changes: 2 additions & 1 deletion docs/docs/05-migrations/13-v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ There are four sections based on the four potential user groups of this document

### API removals

The `exported.ChannelI` interface has been removed. Please use the concrete type.
The `exported.ChannelI` and `exported.CounterpartyChannelI` interfaces has been removed. Please use the concrete types.

The functions `GetState()`, `GetOrdering()`, `GetCounterparty()`, `GetConnectionHops()`, `GetVersion()` of the `Channel` type have been removed.
The functions `GetPortID()`, `GetChannelID()` of the `CounterpartyChannel` type have been removed.

### API deprecation notice

Expand Down
4 changes: 2 additions & 2 deletions modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func (k Keeper) sendTransfer(
return 0, errorsmod.Wrapf(channeltypes.ErrChannelNotFound, "port ID (%s) channel ID (%s)", sourcePort, sourceChannel)
}

destinationPort := channel.Counterparty.GetPortID()
destinationChannel := channel.Counterparty.GetChannelID()
destinationPort := channel.Counterparty.PortId
destinationChannel := channel.Counterparty.ChannelId

// begin createOutgoingPacket logic
// See spec for this logic: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#packet-relay
Expand Down
13 changes: 0 additions & 13 deletions modules/core/04-channel/types/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import (
errorsmod "cosmossdk.io/errors"

host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
)

var _ exported.CounterpartyChannelI = (*Counterparty)(nil)

// NewChannel creates a new Channel instance
func NewChannel(
state State, ordering Order, counterparty Counterparty,
Expand Down Expand Up @@ -55,16 +52,6 @@ func NewCounterparty(portID, channelID string) Counterparty {
}
}

// GetPortID implements CounterpartyChannelI interface
func (c Counterparty) GetPortID() string {
return c.PortId
}

// GetChannelID implements CounterpartyChannelI interface
func (c Counterparty) GetChannelID() string {
return c.ChannelId
}

// ValidateBasic performs a basic validation check of the identifiers
func (c Counterparty) ValidateBasic() error {
if err := host.PortIdentifierValidator(c.PortId); err != nil {
Expand Down
5 changes: 0 additions & 5 deletions modules/core/04-channel/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import (
// RegisterInterfaces register the ibc channel submodule interfaces to protobuf
// Any.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterInterface(
"ibc.core.channel.v1.CounterpartyChannelI",
(*exported.CounterpartyChannelI)(nil),
&Counterparty{},
)
registry.RegisterInterface(
"ibc.core.channel.v1.PacketI",
(*exported.PacketI)(nil),
Expand Down
5 changes: 0 additions & 5 deletions modules/core/04-channel/types/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ func TestCodecTypeRegistration(t *testing.T) {
typeURL string
expPass bool
}{
{
"success: Counterparty",
sdk.MsgTypeURL(&types.Counterparty{}),
true,
},
{
"success: Packet",
sdk.MsgTypeURL(&types.Packet{}),
Expand Down
9 changes: 0 additions & 9 deletions modules/core/exported/channel.go

This file was deleted.

0 comments on commit 1504c46

Please sign in to comment.