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

chore: fix naming of parameters sourceID/destinationID #7448

Merged
merged 5 commits into from
Oct 14, 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
16 changes: 8 additions & 8 deletions modules/core/api/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ type IBCModule interface {
// for this specific application.
OnSendPacket(
ctx context.Context,
sourceID string,
destinationID string,
sourceChannel string,
destinationChannel string,
sequence uint64,
data channeltypesv2.PacketData,
signer sdk.AccAddress,
) error

OnRecvPacket(
ctx context.Context,
sourceID string,
destinationID string,
sourceChannel string,
destinationChannel string,
data channeltypesv2.PacketData,
relayer sdk.AccAddress,
) channeltypesv2.RecvPacketResult

// OnTimeoutPacket is executed when a packet has timed out on the receiving chain.
OnTimeoutPacket(
ctx context.Context,
sourceID string,
destinationID string,
sourceChannel string,
bznein marked this conversation as resolved.
Show resolved Hide resolved
destinationChannel string,
data channeltypesv2.PacketData,
relayer sdk.AccAddress,
) error

// OnAcknowledgementPacket is executed when a packet gets acknowledged
OnAcknowledgementPacket(
ctx context.Context,
sourceID string,
destinationID string,
sourceChannel string,
destinationChannel string,
data channeltypesv2.PacketData,
acknowledgement []byte,
relayer sdk.AccAddress,
Expand Down
8 changes: 4 additions & 4 deletions testing/mock/v2/ibc_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
)

type IBCApp struct {
OnSendPacket func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error
OnRecvPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult
OnTimeoutPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error
OnAcknowledgementPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error
OnSendPacket func(ctx context.Context, sourceChannel string, destinationChannel string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error
OnRecvPacket func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult
OnTimeoutPacket func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error
OnAcknowledgementPacket func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error
}
16 changes: 8 additions & 8 deletions testing/mock/v2/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@ func NewIBCModule() IBCModule {
}
}

func (im IBCModule) OnSendPacket(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error {
func (im IBCModule) OnSendPacket(ctx context.Context, sourceChannel string, destinationChannel string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error {
if im.IBCApp.OnSendPacket != nil {
return im.IBCApp.OnSendPacket(ctx, sourceID, destinationID, sequence, data, signer)
return im.IBCApp.OnSendPacket(ctx, sourceChannel, destinationChannel, sequence, data, signer)
}
return nil
}

func (im IBCModule) OnRecvPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult {
func (im IBCModule) OnRecvPacket(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult {
if im.IBCApp.OnRecvPacket != nil {
return im.IBCApp.OnRecvPacket(ctx, sourceID, destinationID, data, relayer)
return im.IBCApp.OnRecvPacket(ctx, sourceChannel, destinationChannel, data, relayer)
}
return channeltypesv2.RecvPacketResult{
Status: channeltypesv2.PacketStatus_Success,
Acknowledgement: mockv1.MockPacketData,
}
}

func (im IBCModule) OnAcknowledgementPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error {
func (im IBCModule) OnAcknowledgementPacket(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error {
if im.IBCApp.OnAcknowledgementPacket != nil {
return im.IBCApp.OnAcknowledgementPacket(ctx, sourceID, destinationID, data, acknowledgement, relayer)
return im.IBCApp.OnAcknowledgementPacket(ctx, sourceChannel, destinationChannel, data, acknowledgement, relayer)
}
return nil
}

func (im IBCModule) OnTimeoutPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error {
func (im IBCModule) OnTimeoutPacket(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error {
if im.IBCApp.OnTimeoutPacket != nil {
return im.IBCApp.OnTimeoutPacket(ctx, sourceID, destinationID, data, relayer)
return im.IBCApp.OnTimeoutPacket(ctx, sourceChannel, destinationChannel, data, relayer)
}
return nil
}
Loading