Skip to content

Commit

Permalink
refactor: remove processed key and handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
jtieri committed Sep 4, 2024
1 parent 0546261 commit 3602bb8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func (im IBCMiddleware) OnRecvPacket(
metadata := m.Forward

goCtx := ctx.Context()
processed := getBoolFromAny(goCtx.Value(types.ProcessedKey{}))
nonrefundable := getBoolFromAny(goCtx.Value(types.NonrefundableKey{}))
disableDenomComposition := getBoolFromAny(goCtx.Value(types.DisableDenomCompositionKey{}))

Expand All @@ -212,16 +211,6 @@ func (im IBCMiddleware) OnRecvPacket(
return newErrorAcknowledgement(fmt.Errorf("failed to construct override receiver: %w", err))
}

// if this packet has been handled by another middleware in the stack there may be no need to call into the
// underlying app, otherwise the transfer module's OnRecvPacket callback could be invoked more than once
// which would mint/burn vouchers more than once
if !processed {
if err := im.receiveFunds(ctx, packet, data, overrideReceiver, relayer); err != nil {
logger.Error("packetForwardMiddleware OnRecvPacket error receiving packet", "error", err)
return newErrorAcknowledgement(fmt.Errorf("error receiving packet: %w", err))
}
}

// if this packet's token denom is already the base denom for some native token on this chain,
// we do not need to do any further composition of the denom before forwarding the packet
denomOnThisChain := data.Denom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ const (
QuerierRoute = ModuleName
)

var ParamsKey = []byte{0x00}

type (
NonrefundableKey struct{}
DisableDenomCompositionKey struct{}
ProcessedKey struct{}
)

func RefundPacketKey(channelID, portID string, sequence uint64) []byte {
Expand Down

0 comments on commit 3602bb8

Please sign in to comment.