mock

package
v10.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleNameA is a name that can be used for the first mock application.
	ModuleNameA = ModuleName + "A"
	// ModuleNameB is a name that can be used for the second mock application.
	ModuleNameB = ModuleName + "B"
	// PortIDA is a port ID that can be used for the first mock application.
	PortIDA = ModuleNameA
	// PortIDB is a port ID that can be used for the second mock application.
	PortIDB = ModuleNameB
)
View Source
const (
	ModuleName = "mockv2"
)

Variables

View Source
var MockRecvPacketResult = channeltypesv2.RecvPacketResult{
	Status:          channeltypesv2.PacketStatus_Success,
	Acknowledgement: mockv1.MockAcknowledgement.Acknowledgement(),
}

Functions

func NewErrorMockPayload

func NewErrorMockPayload(sourcePort, destPort string) channeltypesv2.Payload

func NewMockPayload

func NewMockPayload(sourcePort, destPort string) channeltypesv2.Payload

Types

type IBCApp

type IBCApp struct {
	OnSendPacket            func(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, signer sdk.AccAddress) error
	OnRecvPacket            func(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult
	OnTimeoutPacket         func(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, relayer sdk.AccAddress) error
	OnAcknowledgementPacket func(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, acknowledgement []byte, relayer sdk.AccAddress) error
}

type IBCModule

type IBCModule struct {
	IBCApp *IBCApp
}

IBCModule is a mock implementation of the IBCModule interface. which delegates calls to the underlying IBCApp.

func NewIBCModule

func NewIBCModule() IBCModule

NewIBCModule creates a new IBCModule with an underlying mock IBC application.

func (IBCModule) OnAcknowledgementPacket

func (im IBCModule) OnAcknowledgementPacket(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, acknowledgement []byte, payload channeltypesv2.Payload, relayer sdk.AccAddress) error

func (IBCModule) OnRecvPacket

func (im IBCModule) OnRecvPacket(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult

func (IBCModule) OnSendPacket

func (im IBCModule) OnSendPacket(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, data channeltypesv2.Payload, signer sdk.AccAddress) error

func (IBCModule) OnTimeoutPacket

func (im IBCModule) OnTimeoutPacket(ctx sdk.Context, sourceChannel string, destinationChannel string, sequence uint64, payload channeltypesv2.Payload, relayer sdk.AccAddress) error

func (IBCModule) UnmarshalPacketData

func (IBCModule) UnmarshalPacketData(payload channeltypesv2.Payload) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳