From 1d42816b7d9aee4ad53ca2591fdfd31f29ae37ea Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Thu, 5 Oct 2023 17:31:00 -0500 Subject: [PATCH] use simapp for TestTimeoutOnForward --- .../e2e/forward_timeout_test.go | 25 +++++++++++--- .../packet-forward-middleware/e2e/setup.go | 33 +++++++++---------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/middleware/packet-forward-middleware/e2e/forward_timeout_test.go b/middleware/packet-forward-middleware/e2e/forward_timeout_test.go index d71ae64d..591b9aaa 100644 --- a/middleware/packet-forward-middleware/e2e/forward_timeout_test.go +++ b/middleware/packet-forward-middleware/e2e/forward_timeout_test.go @@ -32,14 +32,28 @@ func TestTimeoutOnForward(t *testing.T) { chainIdA, chainIdB, chainIdC, chainIdD := "chain-a", "chain-b", "chain-c", "chain-d" - fullNodes := 1 vals := 1 + fullNodes := 0 + + baseCfg := DefaultConfig + + baseCfg.ChainID = chainIdA + configA := baseCfg + + baseCfg.ChainID = chainIdB + configB := baseCfg + + baseCfg.ChainID = chainIdC + configC := baseCfg + + baseCfg.ChainID = chainIdD + configD := baseCfg cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - {Name: "gaia", Version: "v9.0.1", ChainConfig: ibc.ChainConfig{ChainID: chainIdA, GasPrices: "0.0uatom"}, NumFullNodes: &fullNodes, NumValidators: &vals}, - {Name: "gaia", Version: "v9.0.1", ChainConfig: ibc.ChainConfig{ChainID: chainIdB, GasPrices: "0.0uatom"}, NumFullNodes: &fullNodes, NumValidators: &vals}, - {Name: "gaia", Version: "v9.0.1", ChainConfig: ibc.ChainConfig{ChainID: chainIdC, GasPrices: "0.0uatom"}, NumFullNodes: &fullNodes, NumValidators: &vals}, - {Name: "gaia", Version: "v9.0.1", ChainConfig: ibc.ChainConfig{ChainID: chainIdD, GasPrices: "0.0uatom"}, NumFullNodes: &fullNodes, NumValidators: &vals}, + {Name: "pfm", ChainConfig: configA, NumFullNodes: &fullNodes, NumValidators: &vals}, + {Name: "pfm", ChainConfig: configB, NumFullNodes: &fullNodes, NumValidators: &vals}, + {Name: "pfm", ChainConfig: configC, NumFullNodes: &fullNodes, NumValidators: &vals}, + {Name: "pfm", ChainConfig: configD, NumFullNodes: &fullNodes, NumValidators: &vals}, }) chains, err := cf.Chains(t.Name()) @@ -208,6 +222,7 @@ func TestTimeoutOnForward(t *testing.T) { require.NoError(t, err) chainBHeight, err = chainB.Height(ctx) + require.NoError(t, err) // Poll for the MsgTimeout on chainB and the MsgAck on chainA _, err = cosmos.PollForMessage[*chantypes.MsgTimeout](ctx, chainB, cosmos.DefaultEncoding().InterfaceRegistry, chainBHeight, chainBHeight+20, nil) diff --git a/middleware/packet-forward-middleware/e2e/setup.go b/middleware/packet-forward-middleware/e2e/setup.go index b1114f0d..3e6754fa 100644 --- a/middleware/packet-forward-middleware/e2e/setup.go +++ b/middleware/packet-forward-middleware/e2e/setup.go @@ -23,25 +23,22 @@ var ( UidGid: "1025:1025", } - Denom = "token" - GenesisWalletAmount = int64(10_000_000) - + Denom = "token" DefaultConfig = ibc.ChainConfig{ - Type: "cosmos", - Name: "pfm", - ChainID: "pfm-1", - Images: []ibc.DockerImage{PFMImage}, - Bin: "simd", - Bech32Prefix: "cosmos", - Denom: Denom, - CoinType: "118", - GasPrices: fmt.Sprintf("0%s", Denom), - GasAdjustment: 2.0, - TrustingPeriod: "112h", - NoHostMount: false, - ConfigFileOverrides: nil, - EncodingConfig: encoding(), - UsingNewGenesisCommand: true, + Type: "cosmos", + Name: "pfm", + ChainID: "pfm-1", + Images: []ibc.DockerImage{PFMImage}, + Bin: "simd", + Bech32Prefix: "cosmos", + Denom: Denom, + CoinType: "118", + GasPrices: fmt.Sprintf("0%s", Denom), + GasAdjustment: 2.0, + TrustingPeriod: "112h", + NoHostMount: false, + ConfigFileOverrides: nil, + EncodingConfig: encoding(), } )