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

refactor!: remove counterparty connection interface #5775

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
}
Loading