diff --git a/tests/interchaintest/chain_start_test.go b/tests/interchaintest/chain_start_test.go index 5651b07..7bee2ae 100644 --- a/tests/interchaintest/chain_start_test.go +++ b/tests/interchaintest/chain_start_test.go @@ -16,6 +16,8 @@ func TestStartFeeabs(t *testing.T) { t.Skip() } + t.Parallel() + numVals := 1 numFullNodes := 1 diff --git a/tests/interchaintest/host_zone_proposal_test.go b/tests/interchaintest/host_zone_proposal_test.go index 8452032..1b3b7cd 100644 --- a/tests/interchaintest/host_zone_proposal_test.go +++ b/tests/interchaintest/host_zone_proposal_test.go @@ -4,8 +4,10 @@ import ( "context" "testing" + "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" feeabsCli "github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/feeabs" ) @@ -14,18 +16,45 @@ func TestHostZoneProposal(t *testing.T) { if testing.Short() { t.Skip("skipping in short mode") } - ctx := context.Background() - chains, users, channels := SetupChain(t, ctx) - feeabs, _, osmosis := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain), chains[2].(*cosmos.CosmosChain) - channFeeabsOsmosis, _, channFeeabsOsmosisICQ := channels[0], channels[1], channels[6] + t.Parallel() + + numVals := 1 + numFullNodes := 1 - feeabsUser, _, _ := users[0], users[1], users[2] - osmoOnFeeabs := GetOsmoOnFeeabs(channFeeabsOsmosis, osmosis.Config().Denom) + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + { + Name: "feeabs", + ChainConfig: feeabsConfig, + NumValidators: &numVals, + NumFullNodes: &numFullNodes, + }, + }) - ParamChangeProposal(t, ctx, feeabs, feeabsUser, &channFeeabsOsmosis, &channFeeabsOsmosisICQ, osmoOnFeeabs) + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + ctx := context.Background() + feeabs := chains[0].(*cosmos.CosmosChain) + ic := interchaintest.NewInterchain().AddChain(feeabs) + client, network := interchaintest.DockerSetup(t) + + require.NoError(t, ic.Build(ctx, nil, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + })) + t.Cleanup(func() { + _ = ic.Close() + }) + + users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), genesisWalletAmount, feeabs) + feeabsUser := users[0] + + ParamChangeProposal(t, ctx, feeabs, feeabsUser, "channel-0", "channel-1", fakeIBCDenom) AddHostZoneProposal(t, ctx, feeabs, feeabsUser) - _, err := feeabsCli.QueryHostZoneConfigWithDenom(feeabs, ctx, osmoOnFeeabs) + _, err = feeabsCli.QueryHostZoneConfigWithDenom(feeabs, ctx, fakeIBCDenom) require.NoError(t, err) } diff --git a/tests/interchaintest/ibc_transfer_customfee_test.go b/tests/interchaintest/ibc_transfer_customfee_test.go index b092379..4180411 100644 --- a/tests/interchaintest/ibc_transfer_customfee_test.go +++ b/tests/interchaintest/ibc_transfer_customfee_test.go @@ -131,7 +131,7 @@ func TestFeeabsGaiaIBCTransferWithIBCFee(t *testing.T) { // Setup feeabs module & add host zone via proposals //////////////////////////////////////////////////////////////////////////////////////// - ParamChangeProposal(t, ctx, feeabs, feeabsUser, &channFeeabsOsmosis, &channFeeabsOsmosisICQ, stakeOnOsmosis) + ParamChangeProposal(t, ctx, feeabs, feeabsUser, channFeeabsOsmosis.ChannelID, channFeeabsOsmosisICQ.ChannelID, stakeOnOsmosis) AddHostZoneProposal(t, ctx, feeabs, feeabsUser) _, err = feeabsCli.QueryAllHostZoneConfig(feeabs, ctx) require.NoError(t, err) diff --git a/tests/interchaintest/packet_foward_test.go b/tests/interchaintest/packet_foward_test.go index 3afabd1..886ff09 100644 --- a/tests/interchaintest/packet_foward_test.go +++ b/tests/interchaintest/packet_foward_test.go @@ -18,6 +18,9 @@ func TestPacketForwardMiddleware(t *testing.T) { if testing.Short() { t.Skip("skipping in short mode") } + + t.Parallel() + // Set up chains, users and channels ctx := context.Background() chains, users, channels := SetupChain(t, ctx) diff --git a/tests/interchaintest/query_osmosis_twap_test.go b/tests/interchaintest/query_osmosis_twap_test.go index 0b062bc..08f777c 100644 --- a/tests/interchaintest/query_osmosis_twap_test.go +++ b/tests/interchaintest/query_osmosis_twap_test.go @@ -22,6 +22,9 @@ func TestQueryOsmosisTwap(t *testing.T) { if testing.Short() { t.Skip("skipping in short mode") } + + t.Parallel() + // Set up chains, users and channels ctx := context.Background() chains, users, channels := SetupChain(t, ctx) @@ -98,7 +101,7 @@ func TestQueryOsmosisTwap(t *testing.T) { err = osmosis.QueryContract(ctx, registryContractAddress, queryMsg, &res) require.NoError(t, err) - ParamChangeProposal(t, ctx, feeabs, feeabsUser, &channFeeabsOsmosis, &channFeeabsOsmosisICQ, stakeOnOsmosis) + ParamChangeProposal(t, ctx, feeabs, feeabsUser, channFeeabsOsmosis.ChannelID, channFeeabsOsmosisICQ.ChannelID, stakeOnOsmosis) AddHostZoneProposal(t, ctx, feeabs, feeabsUser) // ensure that the host zone is added @@ -120,7 +123,14 @@ func TestQueryOsmosisTwap(t *testing.T) { require.NoError(t, err) } -func ParamChangeProposal(t *testing.T, ctx context.Context, feeabs *cosmos.CosmosChain, feeabsUser ibc.Wallet, channFeeabsOsmosis, channFeeabsOsmosisFeeabs *ibc.ChannelOutput, stakeOnOsmosis string) { +func ParamChangeProposal( + t *testing.T, + ctx context.Context, + feeabs *cosmos.CosmosChain, + feeabsUser ibc.Wallet, + channFeeabsOsmosis, channFeeabsOsmosisFeeabs string, + stakeOnOsmosis string, +) { t.Helper() govAddr, err := feeabs.AuthQueryModuleAddress(ctx, "gov") require.NoError(t, err) @@ -128,8 +138,8 @@ func ParamChangeProposal(t *testing.T, ctx context.Context, feeabs *cosmos.Cosmo updateParamMsg := feeabstypes.MsgUpdateParams{ Params: feeabstypes.Params{ OsmosisQueryTwapPath: "/osmosis.twap.v1beta1.Query/ArithmeticTwapToNow", - IbcTransferChannel: channFeeabsOsmosis.ChannelID, - IbcQueryIcqChannel: channFeeabsOsmosisFeeabs.ChannelID, + IbcTransferChannel: channFeeabsOsmosis, + IbcQueryIcqChannel: channFeeabsOsmosisFeeabs, NativeIbcedInOsmosis: stakeOnOsmosis, OsmosisCrosschainSwapAddress: "osmo17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgs5yczr8", ChainName: feeabs.Config().ChainID, @@ -170,7 +180,7 @@ func AddHostZoneProposal(t *testing.T, ctx context.Context, feeabs *cosmos.Cosmo addHostZoneMsg := feeabstypes.MsgAddHostZone{ HostChainConfig: &feeabstypes.HostChainFeeAbsConfig{ - IbcDenom: "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", + IbcDenom: fakeIBCDenom, OsmosisPoolTokenDenomIn: "uosmo", PoolId: 1, Status: 0, diff --git a/tests/interchaintest/setup.go b/tests/interchaintest/setup.go index b6dabf3..7acf6f1 100644 --- a/tests/interchaintest/setup.go +++ b/tests/interchaintest/setup.go @@ -86,6 +86,7 @@ var ( pathOsmosisGaia = "osmosis-gaia" genesisWalletAmount = math.NewInt(100_000_000_000) amountToSend = math.NewInt(1_000_000_000) + fakeIBCDenom = "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B" ) // feeabsEncoding registers the feeabs specific module codecs so that the associated types and msgs