-
Notifications
You must be signed in to change notification settings - Fork 0
/
module_ibc.go
103 lines (93 loc) · 2.89 KB
/
module_ibc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package lscosmos
import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
)
// OnChanOpenInit implements the IBCModule interface
func (am AppModule) OnChanOpenInit(
ctx sdk.Context,
order channeltypes.Order,
connectionHops []string,
portID string,
channelID string,
chanCap *capabilitytypes.Capability,
counterparty channeltypes.Counterparty,
version string,
) (string, error) {
return am.keeper.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, chanCap, counterparty, version)
}
// OnChanOpenTry implements the IBCModule interface
func (am AppModule) OnChanOpenTry(
ctx sdk.Context,
order channeltypes.Order,
connectionHops []string,
portID,
channelID string,
chanCap *capabilitytypes.Capability,
counterparty channeltypes.Counterparty,
counterpartyVersion string,
) (string, error) {
return am.keeper.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, chanCap, counterparty, counterpartyVersion)
}
// OnChanOpenAck implements the IBCModule interface
func (am AppModule) OnChanOpenAck(
ctx sdk.Context,
portID,
channelID string,
counterpartyChannelID string,
counterpartyVersion string,
) error {
return am.keeper.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion)
}
// OnChanOpenConfirm implements the IBCModule interface
func (am AppModule) OnChanOpenConfirm(
ctx sdk.Context,
portID,
channelID string,
) error {
return am.keeper.OnChanOpenConfirm(ctx, portID, channelID)
}
// OnChanCloseInit implements the IBCModule interface
func (am AppModule) OnChanCloseInit(
ctx sdk.Context,
portID,
channelID string,
) error {
// Disallow user-initiated channel closing for channels
return am.keeper.OnChanCloseInit(ctx, portID, channelID)
}
// OnChanCloseConfirm implements the IBCModule interface
func (am AppModule) OnChanCloseConfirm(
ctx sdk.Context,
portID,
channelID string,
) error {
return am.keeper.OnChanCloseConfirm(ctx, portID, channelID)
}
// OnRecvPacket implements the IBCModule interface
func (am AppModule) OnRecvPacket(
ctx sdk.Context,
modulePacket channeltypes.Packet,
relayer sdk.AccAddress,
) ibcexported.Acknowledgement {
return am.keeper.OnRecvPacket(ctx, modulePacket, relayer)
}
// OnAcknowledgementPacket implements the IBCModule interface
func (am AppModule) OnAcknowledgementPacket(
ctx sdk.Context,
modulePacket channeltypes.Packet,
acknowledgement []byte,
relayer sdk.AccAddress,
) error {
return am.keeper.OnAcknowledgementPacket(ctx, modulePacket, acknowledgement, relayer)
}
// OnTimeoutPacket implements the IBCModule interface
func (am AppModule) OnTimeoutPacket(
ctx sdk.Context,
modulePacket channeltypes.Packet,
relayer sdk.AccAddress,
) error {
return am.keeper.OnTimeoutPacket(ctx, modulePacket, relayer)
}