Skip to content

Commit

Permalink
Use gaia with pfm with configurable timeout and retries
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Sep 25, 2022
1 parent 79890ab commit 3aa78ce
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions examples/ibc/packet_forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestPacketForwardMiddleware(t *testing.T) {
ctx := context.Background()

cf := ibctest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*ibctest.ChainSpec{
{Name: "gaia", Version: "strangelove-packet-forward-middleware-no-retry-default-timeout"},
{Name: "gaia", Version: "strangelove-packet-forward-middleware-retry-refund"},
{Name: "osmosis", Version: "v11.0.1"},
{Name: "juno", Version: "v9.0.0"},
})
Expand Down Expand Up @@ -201,16 +201,9 @@ func TestPacketForwardMiddleware(t *testing.T) {
require.NoError(t, err)
require.Equal(t, int64(0), gaiaBal)

// Now restart all nodes with a version of gaia that has 2 retries and 1 second timeout
err = gaia.StopAllNodes(ctx)
require.NoError(t, err)
gaia.UpgradeVersion(ctx, client, "strangelove-packet-forward-middleware-two-retries-low-timeout")
err = gaia.StartAllNodes(ctx)
require.NoError(t, err)

// Send packet from Osmosis->Hub->Juno with the timeout so low that it can not make it from Hub to Juno, which should result in a refund from Hub to Osmosis after two retries.
// receiver format: {intermediate_refund_address}|{foward_port}/{forward_channel}:{final_destination_address}:{max_retries}:{timeout_duration}
receiver = fmt.Sprintf("%s|%s/%s:%s", gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaJunoChan.PortID, gaiaJunoChan.ChannelID, junoUser.Bech32Address(juno.Config().Bech32Prefix))
receiver = fmt.Sprintf("%s|%s/%s|%s|%d:%s", gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaJunoChan.PortID, gaiaJunoChan.ChannelID, "1s", 2, junoUser.Bech32Address(juno.Config().Bech32Prefix))
transfer = ibc.WalletAmount{
Address: receiver,
Denom: osmosis.Config().Denom,
Expand Down

0 comments on commit 3aa78ce

Please sign in to comment.