-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pluming necessary for testing CreateChannel (#7406)
* chore: add pluming necessary for testings. * chore: docustring for event func. * chore: wire up call to emit in msg_server * chore: fix linter mess. * chore: review touch ups.
- Loading branch information
1 parent
6a19337
commit 9264b1c
Showing
7 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" | ||
) | ||
|
||
// EmitCreateChannelEvent emits a channel create event. | ||
func EmitCreateChannelEvent(ctx context.Context, channelID string) { | ||
sdkCtx := sdk.UnwrapSDKContext(ctx) | ||
|
||
sdkCtx.EventManager().EmitEvents(sdk.Events{ | ||
sdk.NewEvent( | ||
types.EventTypeCreateChannel, | ||
sdk.NewAttribute(types.AttributeKeyChannelID, channelID), | ||
), | ||
sdk.NewEvent( | ||
sdk.EventTypeMessage, | ||
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), | ||
), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
|
||
ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported" | ||
) | ||
|
||
// IBC channel events | ||
const ( | ||
AttributeKeyChannelID = "channel_id" | ||
) | ||
|
||
// IBC channel events vars | ||
var ( | ||
EventTypeCreateChannel = "create_channel" | ||
|
||
AttributeValueCategory = fmt.Sprintf("%s_%s", ibcexported.ModuleName, SubModuleName) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters