Skip to content

Commit

Permalink
Fix PFM tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ysv committed May 3, 2024
1 parent 5f3dfda commit ea479b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions integration-tests/ibc/pfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,33 @@ func TestPFMViaCoreum(t *testing.T) {
},
)

coreumToGaiaChannelID := coreumChain.AwaitForIBCChannelID(
ctx,
t,
ibctransfertypes.PortID,
gaiaChain.ChainSettings.ChainID,
)

gaiaToCoreumChannelID := gaiaChain.AwaitForIBCChannelID(
ctx,
t,
ibctransfertypes.PortID,
coreumChain.ChainSettings.ChainID,
)

coreumToOsmosiChannelID := coreumChain.AwaitForIBCChannelID(
ctx,
t,
ibctransfertypes.PortID,
osmosisChain.ChainSettings.ChainID,
)

sendToGaiaCoin := osmosisChain.NewCoin(sdkmath.NewInt(10_000_000))

// Forward metadata example:
// {
// "forward": {
// "receiver": "chain-c-bech32-address",
// "port": "transfer",
// "channel": "channel-123"
// "channel": "channel-123" // this is the chain C on chain B channel.
// }
//}
forwardMetadata := struct {
Expand All @@ -67,13 +73,14 @@ func TestPFMViaCoreum(t *testing.T) {
Forward: packetforwardtypes.ForwardMetadata{
Receiver: gaiaChain.MustConvertToBech32Address(gaiaReceiver),
Port: ibctransfertypes.PortID,
Channel: gaiaToCoreumChannelID,
Channel: coreumToGaiaChannelID,
},
}

pfmMemo, err := json.Marshal(forwardMetadata)
requireT.NoError(err)

sendToGaiaCoin := osmosisChain.NewCoin(sdkmath.NewInt(10_000_000))
_, err = osmosisChain.ExecuteIBCTransferWithMemo(
ctx,
t,
Expand Down
4 changes: 2 additions & 2 deletions testutil/integration/chain_ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ func (c ChainContext) ExecuteIBCTransferWithMemo(
t.Helper()

sender := c.MustConvertToBech32Address(senderAddress)
t.Logf("Sending IBC transfer sender: %s, receiver: %s, amount: %s, memo: %s.",
sender, recipientAddress, coin.String(), memo)

recipientChannelID := c.AwaitForIBCChannelID(
ctx,
Expand All @@ -78,6 +76,8 @@ func (c ChainContext) ExecuteIBCTransferWithMemo(
)
require.NoError(t, err)

t.Logf("Sending IBC transfer sender: %s, receiver: %s, amount: %s, memo: %s.",
sender, recipientAddress, coin.String(), memo)
ibcSend := ibctransfertypes.MsgTransfer{
SourcePort: ibctransfertypes.PortID,
SourceChannel: recipientChannelID,
Expand Down

0 comments on commit ea479b1

Please sign in to comment.