Skip to content

Commit

Permalink
use simapp for TestTimeoutOnForward
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 5, 2023
1 parent 7985011 commit 1d42816
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
25 changes: 20 additions & 5 deletions middleware/packet-forward-middleware/e2e/forward_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down
33 changes: 15 additions & 18 deletions middleware/packet-forward-middleware/e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
)

Expand Down

0 comments on commit 1d42816

Please sign in to comment.