From 6884194905204d549f3f77b1a3fdbb4aebc5b327 Mon Sep 17 00:00:00 2001 From: Tuan Tran Date: Mon, 27 May 2024 23:14:43 +0700 Subject: [PATCH] fix hostzone test --- tests/interchaintest/host_zone_proposal_test.go | 10 +++++----- tests/interchaintest/query_osmosis_twap_test.go | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/interchaintest/host_zone_proposal_test.go b/tests/interchaintest/host_zone_proposal_test.go index cdd02a51..3cab4aeb 100644 --- a/tests/interchaintest/host_zone_proposal_test.go +++ b/tests/interchaintest/host_zone_proposal_test.go @@ -17,15 +17,15 @@ func TestHostZoneProposal(t *testing.T) { ctx := context.Background() chains, users, channels := SetupChain(t, ctx) - feeabs, _, _ := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain), chains[2].(*cosmos.CosmosChain) - channFeeabsOsmosis, channOsmosisFeeabs, channFeeabsOsmosisICQ := channels[0], channels[1], channels[6] + feeabs, _, osmosis := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain), chains[2].(*cosmos.CosmosChain) + channFeeabsOsmosis, _, channFeeabsOsmosisICQ := channels[0], channels[1], channels[6] feeabsUser, _, _ := users[0], users[1], users[2] - stakeOnOsmosis := GetStakeOnOsmosis(channOsmosisFeeabs, feeabs.Config().Denom) + osmoOnFeeabs := GetOsmoOnFeeabs(channFeeabsOsmosis, osmosis.Config().Denom) - ParamChangeProposal(t, ctx, feeabs, feeabsUser, &channFeeabsOsmosis, &channFeeabsOsmosisICQ, stakeOnOsmosis) + ParamChangeProposal(t, ctx, feeabs, feeabsUser, &channFeeabsOsmosis, &channFeeabsOsmosisICQ, osmoOnFeeabs) AddHostZoneProposal(t, ctx, feeabs, feeabsUser) - _, err := feeabsCli.QueryHostZoneConfigWithDenom(feeabs, ctx, stakeOnOsmosis) + _, err := feeabsCli.QueryHostZoneConfigWithDenom(feeabs, ctx, osmoOnFeeabs) require.NoError(t, err) } diff --git a/tests/interchaintest/query_osmosis_twap_test.go b/tests/interchaintest/query_osmosis_twap_test.go index b3fbfb6b..86a4c091 100644 --- a/tests/interchaintest/query_osmosis_twap_test.go +++ b/tests/interchaintest/query_osmosis_twap_test.go @@ -178,3 +178,9 @@ func GetStakeOnOsmosis(channOsmosisFeeabs ibc.ChannelOutput, feeabsDenom string) stakeOnOsmosis := denomTrace.IBCDenom() return stakeOnOsmosis } + +func GetOsmoOnFeeabs(channFeeabsOsmosis ibc.ChannelOutput, osmosisDenom string) string { + denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom(channFeeabsOsmosis.PortID, channFeeabsOsmosis.ChannelID, osmosisDenom)) + osmoOnFeeabs := denomTrace.IBCDenom() + return osmoOnFeeabs +}