Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nguy committed May 26, 2022
1 parent b1ba7e2 commit 5ccbf4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions x/cronos/middleware/conversion_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (im IBCConversionModule) OnAcknowledgementPacket(
return err
}
// Only in case it is not source chain, we need to convert the voucher
if !transferTypes.SenderChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) {
if !transferTypes.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) {
err = im.convertVouchers(ctx, data)
if err != nil {
return err
Expand All @@ -165,7 +165,7 @@ func (im IBCConversionModule) OnTimeoutPacket(
return err
}
// Only in case it is not source chain, we need to convert the voucher
if !transferTypes.SenderChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) {
if !transferTypes.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) {
err = im.convertVouchers(ctx, data)
if err != nil {
return err
Expand Down
12 changes: 1 addition & 11 deletions x/cronos/types/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ import (
context "context"
"math/big"

capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"

sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"
Expand Down Expand Up @@ -78,11 +75,4 @@ type EvmKeeper interface {
ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool,
) (sdk.Coins, error)
ChainID() *big.Int
}

// ICS4Wrapper defines the expected ICS4Wrapper for middleware
type ICS4Wrapper interface {
WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error
SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
}
}

0 comments on commit 5ccbf4c

Please sign in to comment.