Skip to content

Commit

Permalink
Update interchaintest
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 committed Mar 27, 2024
1 parent ca8c730 commit 64cd0b5
Show file tree
Hide file tree
Showing 13 changed files with 447 additions and 389 deletions.
6 changes: 3 additions & 3 deletions tests/interchaintest/chain_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"testing"

"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/testreporter"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/interchaintest/feeabs/osmosis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"strconv"

"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
)

func CreatePool(c *cosmos.CosmosChain, ctx context.Context, keyName string, params cosmos.OsmosisPoolParams) (string, error) {
Expand Down
10 changes: 5 additions & 5 deletions tests/interchaintest/feeabs/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/cosmos/cosmos-sdk/types"
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
)

func getFullNode(c *cosmos.CosmosChain) *cosmos.ChainNode {
Expand Down Expand Up @@ -61,7 +61,7 @@ func CrossChainSwap(c *cosmos.CosmosChain, ctx context.Context, keyName string,
if err != nil {
return tx, fmt.Errorf("failed to get transaction %s: %w", txHash, err)
}
tx.Height = uint64(txResp.Height)
tx.Height = txResp.Height
tx.TxHash = txHash

tx.GasSpent = txResp.GasWanted
Expand Down Expand Up @@ -209,7 +209,7 @@ func txProposal(c *cosmos.CosmosChain, txHash string) (tx cosmos.TxProposal, _ e
if err != nil {
return tx, fmt.Errorf("failed to get transaction %s: %w", txHash, err)
}
tx.Height = uint64(txResp.Height)
tx.Height = txResp.Height
tx.TxHash = txHash
// In cosmos, user is charged for entire gas requested, not the actual gas used.
tx.GasSpent = txResp.GasWanted
Expand Down
2 changes: 1 addition & 1 deletion tests/interchaintest/feeabs/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"

"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"

feeabstypes "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/interchaintest/feeabs/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package feeabs
import (
"context"

"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
)

func QueryOsmosisTWAP(c *cosmos.CosmosChain, ctx context.Context, keyName string) (string, error) {
Expand Down
17 changes: 11 additions & 6 deletions tests/interchaintest/feeabs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import (
"fmt"
"os"
"path"
"strconv"
"testing"

"cosmossdk.io/math"
sdktypes "github.com/cosmos/cosmos-sdk/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"

feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
Expand Down Expand Up @@ -184,7 +186,10 @@ func TestFeeAbs(t *testing.T) {
height, err := feeabs.Height(ctx)
require.NoError(t, err)

_, err = cosmos.PollForProposalStatus(ctx, feeabs, height, height+10, paramTx.ProposalID, cosmos.ProposalStatusPassed)
proposalID, err := strconv.ParseUint(paramTx.ProposalID, 10, 64)
require.NoError(t, err, "parse proposal id failed")

_, err = cosmos.PollForProposalStatus(ctx, feeabs, height, height+10, proposalID, govv1beta1.StatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

_, err = feeabsCli.AddHostZoneProposal(feeabs, ctx, feeabsUser.KeyName(), "./proposal/add_host_zone.json")
Expand All @@ -196,7 +201,7 @@ func TestFeeAbs(t *testing.T) {
height, err = feeabs.Height(ctx)
require.NoError(t, err)

_, err = cosmos.PollForProposalStatus(ctx, feeabs, height, height+10, paramTx.ProposalID, cosmos.ProposalStatusPassed)
_, err = cosmos.PollForProposalStatus(ctx, feeabs, height, height+10, 2, govv1beta1.StatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

// wait for next 5 blocks
Expand Down
Loading

0 comments on commit 64cd0b5

Please sign in to comment.