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

IBC Router Middleware #373

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix build issues
  • Loading branch information
jackzampolin committed Sep 2, 2021
commit e0be747299d66a6dc6b0e6a647e16f6f7eac8f1c
10 changes: 5 additions & 5 deletions modules/apps/router/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t
denomTrace := transfertypes.ParseDenomTrace(prefixedDenom)

traceHash := denomTrace.Hash()
if !k.transferkeeper.HasDenomTrace(ctx, traceHash) {
k.transferkeeper.SetDenomTrace(ctx, denomTrace)
if !k.transferKeeper.HasDenomTrace(ctx, traceHash) {
k.transferKeeper.SetDenomTrace(ctx, denomTrace)
}

voucherDenom := denomTrace.IBCDenom()
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeDenomTrace,
sdk.NewAttribute(types.AttributeKeyTraceHash, traceHash.String()),
sdk.NewAttribute(types.AttributeKeyDenom, voucherDenom),
transfertypes.EventTypeDenomTrace,
sdk.NewAttribute(transfertypes.AttributeKeyTraceHash, traceHash.String()),
sdk.NewAttribute(transfertypes.AttributeKeyDenom, voucherDenom),
),
)

Expand Down
3 changes: 2 additions & 1 deletion modules/apps/router/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
"github.com/tendermint/tendermint/libs/bytes"
)
Expand All @@ -20,5 +21,5 @@ type TransferKeeper interface {
GetReceiveEnabled(ctx sdk.Context) bool
GetSendEnabled(ctx sdk.Context) bool
HasDenomTrace(ctx sdk.Context, traceHash bytes.HexBytes) bool
SetDenomTrace(ctx sdk.Context, traceHash bytes.HexBytes)
SetDenomTrace(ctx sdk.Context, denomTrace transfertypes.DenomTrace)
}