Skip to content

Commit

Permalink
filter channels by port id
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Zavgorodnii committed Dec 19, 2024
1 parent 66925ca commit 3c6f5d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (k Keeper) CreateModuleAccount(ctx sdk.Context) {
func (k Keeper) GetAllIBCEscrowAccounts(ctx sdk.Context) map[string]bool {
escrowAddresses := make(map[string]bool)

transferChannels := k.channelKeeper.GetAllChannels(ctx)
transferChannels := k.channelKeeper.GetAllChannelsWithPortPrefix(ctx, transfertypes.PortID)
for _, channel := range transferChannels {
escrowAddress := transfertypes.GetEscrowAddress(channel.PortId, channel.ChannelId)
escrowAddresses[escrowAddress.String()] = true
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type ContractKeeper interface {

// ChannelKeeper defines the expected IBC channel keeper
type ChannelKeeper interface {
GetAllChannels(ctx sdk.Context) (channels []channeltypes.IdentifiedChannel)
GetAllChannelsWithPortPrefix(ctx sdk.Context, portPrefix string) (channels []channeltypes.IdentifiedChannel)
}

0 comments on commit 3c6f5d6

Please sign in to comment.