Skip to content

Commit

Permalink
refactor!: remove counterparty connection interface (cosmos#5775)
Browse files Browse the repository at this point in the history
* refactor: remove counterparty connection interface

* Update docs/docs/05-migrations/13-v8-to-v9.md

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
  • Loading branch information
colin-axner and DimitrisJim authored Jan 31, 2024
1 parent 24fdc81 commit bc4ef0c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 25 deletions.
4 changes: 2 additions & 2 deletions docs/docs/05-migrations/13-v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ There are four sections based on the four potential user groups of this document

### API removals

The `exported.ChannelI` and `exported.CounterpartyChannelI` interfaces has been removed. Please use the concrete types.
The `exported.ConnectionI` interface has been removed. Please use the concrete types.
The `exported.ChannelI` and `exported.CounterpartyChannelI` interfaces have been removed. Please use the concrete types.
The `exported.ConnectionI` and `exported.CounterpartyConnectionI` interfaces have 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.
Expand Down
7 changes: 0 additions & 7 deletions modules/core/03-connection/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"

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

// RegisterInterfaces register the ibc interfaces submodule implementations to protobuf
// Any.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterInterface(
"ibc.core.connection.v1.CounterpartyConnectionI",
(*exported.CounterpartyConnectionI)(nil),
&Counterparty{},
)
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgConnectionOpenInit{},
Expand Down
5 changes: 0 additions & 5 deletions modules/core/03-connection/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: MsgConnectionOpenInit",
sdk.MsgTypeURL(&types.MsgConnectionOpenInit{}),
Expand Down
4 changes: 1 addition & 3 deletions modules/core/03-connection/types/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c ConnectionEnd) GetClientID() string {
}

// GetCounterparty implements the Connection interface
func (c ConnectionEnd) GetCounterparty() exported.CounterpartyConnectionI {
func (c ConnectionEnd) GetCounterparty() Counterparty {
return c.Counterparty
}

Expand Down Expand Up @@ -58,8 +58,6 @@ func (c ConnectionEnd) ValidateBasic() error {
return c.Counterparty.ValidateBasic()
}

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

// NewCounterparty creates a new Counterparty instance.
func NewCounterparty(clientID, connectionID string, prefix commitmenttypes.MerklePrefix) Counterparty {
return Counterparty{
Expand Down
8 changes: 0 additions & 8 deletions modules/core/exported/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@ package exported

// LocalhostConnectionID is the sentinel connection ID for the localhost connection.
const LocalhostConnectionID string = "connection-localhost"

// CounterpartyConnectionI describes the required methods for a counterparty connection.
type CounterpartyConnectionI interface {
GetClientID() string
GetConnectionID() string
GetPrefix() Prefix
ValidateBasic() error
}

0 comments on commit bc4ef0c

Please sign in to comment.