From 53a85cd2da43647790556fdbb612f5d8d0165284 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 25 Jan 2024 17:33:33 -0800 Subject: [PATCH] chore: fix merge errors --- go.work.sum | 5 +++- interchaintest/chain_start_test.go | 4 +-- interchaintest/chain_upgrade_test.go | 37 +++++++++------------------- interchaintest/setup.go | 14 ++++------- 4 files changed, 22 insertions(+), 38 deletions(-) diff --git a/go.work.sum b/go.work.sum index e1b00374..3237715e 100644 --- a/go.work.sum +++ b/go.work.sum @@ -930,6 +930,7 @@ golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -985,6 +986,7 @@ golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1033,6 +1035,7 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= @@ -1088,4 +1091,4 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jC mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= \ No newline at end of file +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/interchaintest/chain_start_test.go b/interchaintest/chain_start_test.go index 4c88d8fa..a41021cf 100644 --- a/interchaintest/chain_start_test.go +++ b/interchaintest/chain_start_test.go @@ -3,11 +3,11 @@ package interchaintest import ( "testing" + "cosmossdk.io/math" + "github.com/sedaprotocol/seda-chain/interchaintest/conformance" "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/stretchr/testify/require" - - "github.com/sedaprotocol/seda-chain/interchaintest/conformance" ) func TestChainStart(t *testing.T) { diff --git a/interchaintest/chain_upgrade_test.go b/interchaintest/chain_upgrade_test.go index 3224abfe..a874da38 100644 --- a/interchaintest/chain_upgrade_test.go +++ b/interchaintest/chain_upgrade_test.go @@ -6,17 +6,16 @@ import ( "testing" "time" - upgradetypes "cosmossdk.io/x/upgrade/types" + "cosmossdk.io/math" "github.com/docker/docker/client" + "github.com/sedaprotocol/seda-chain/interchaintest/conformance" "github.com/strangelove-ventures/interchaintest/v8" "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" - cosmosproto "github.com/cosmos/gogoproto/proto" - - "github.com/sedaprotocol/seda-chain/interchaintest/conformance" + upgradetypes "cosmossdk.io/x/upgrade/types" ) const ( @@ -44,7 +43,6 @@ func TestChainUpgrade(t *testing.T) { } func BasicUpgradeTest(t *testing.T, upgradeVersion, upgradeRepo, upgradeName string) { - t.Helper() if testing.Short() { t.Skip("skipping in short mode") } @@ -86,7 +84,6 @@ func BasicUpgradeTest(t *testing.T, upgradeVersion, upgradeRepo, upgradeName str } func UpgradeNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, client *client.Client, haltHeight uint64, upgradeRepo, upgradeVersion string) { - t.Helper() stopNodes(t, ctx, chain) upgradeNodes(t, ctx, chain, client, upgradeRepo, upgradeVersion) startNodes(t, ctx, chain) @@ -95,8 +92,7 @@ func UpgradeNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, } func fundChainUser(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) ibc.Wallet { - t.Helper() - const userFunds = int64(10_000_000_000) + userFunds := math.NewInt(10_000_000_000) users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chain) return users[0] } @@ -119,7 +115,6 @@ func getTestGenesis() []cosmos.GenesisKV { } func stopNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) { - t.Helper() t.Log("stopping node(s)") err := chain.StopAllNodes(ctx) if err != nil { @@ -128,13 +123,11 @@ func stopNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) { } func upgradeNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, client *client.Client, upgradeRepo, upgradeVersion string) { - t.Helper() t.Log("upgrading node(s)") chain.UpgradeVersion(ctx, client, upgradeRepo, upgradeVersion) } func startNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) { - t.Helper() t.Log("starting node(s)") err := chain.StartAllNodes(ctx) if err != nil { @@ -143,7 +136,6 @@ func startNodes(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) { } func waitForBlocks(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) { - t.Helper() timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*60) defer timeoutCtxCancel() @@ -154,7 +146,6 @@ func waitForBlocks(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) } func checkHeight(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, haltHeight uint64) { - t.Helper() height, err := chain.Height(ctx) if err != nil { t.Fatalf("error fetching height after upgrade: %v", err) @@ -165,10 +156,7 @@ func checkHeight(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, h } } -//nolint:staticcheck // SA4009 disable static check here -func ValidatorVoting(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, proposalID string, currentHeight, haltHeight uint64) { - t.Helper() - +func ValidatorVoting(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, proposalID string, currentHeight uint64, haltHeight uint64) { err := chain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes) require.NoError(t, err, "failed to submit votes") @@ -197,23 +185,20 @@ func ValidatorVoting(t *testing.T, ctx context.Context, chain *cosmos.CosmosChai } func SubmitUpgradeProposal(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, upgradeName string) (uint64, string) { - t.Helper() currentHeight, err := chain.Height(ctx) require.NoError(t, err, "error fetching height before submit upgrade proposal") haltHeight := currentHeight + haltHeightDelta - upgradeMsg := []cosmosproto.Message{ - &upgradetypes.MsgSoftwareUpgrade{ - Authority: "seda10d07y265gmmuvt4z0w9aw880jnsr700jvvla4j", // gov module account; seda-chaind q auth module-account gov - Plan: upgradetypes.Plan{ - Name: upgradeName, - Height: int64(haltHeight), - }, + upgradeMsg := &upgradetypes.MsgSoftwareUpgrade{ + Authority: "seda10d07y265gmmuvt4z0w9aw880jnsr700jvvla4j", // gov module account; seda-chaind q auth module-account gov + Plan: upgradetypes.Plan{ + Name: upgradeName, + Height: int64(haltHeight), }, } - proposal, err := chain.BuildProposal(upgradeMsg, + proposal, err := chain.BuildProposal([]cosmos.ProtoMessage{upgradeMsg}, "Chain Upgrade 1", // title "Summary desc", // summary "ipfs://CID", // metadata diff --git a/interchaintest/setup.go b/interchaintest/setup.go index 1f36d3fb..44d1797a 100644 --- a/interchaintest/setup.go +++ b/interchaintest/setup.go @@ -5,19 +5,18 @@ import ( "fmt" "testing" + "cosmossdk.io/math" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/types/module/testutil" + ibclocalhost "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost" "github.com/docker/docker/client" + "github.com/sedaprotocol/seda-chain/interchaintest/types" "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" "github.com/strangelove-ventures/interchaintest/v8/testreporter" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" - - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/types/module/testutil" - ibclocalhost "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost" - - "github.com/sedaprotocol/seda-chain/interchaintest/types" ) var ( @@ -92,14 +91,12 @@ func sedaEncoding() *testutil.TestEncodingConfig { // CreateChains generates this branch's chain (ex: from the commit) func CreateChains(t *testing.T, numVals, numFullNodes int) []ibc.Chain { - t.Helper() cfg := SedaCfg cfg.Images = []ibc.DockerImage{dockerImage} return CreateChainsWithCustomConfig(t, numVals, numFullNodes, cfg) } func CreateChainsWithCustomConfig(t *testing.T, numVals, numFullNodes int, config ibc.ChainConfig) []ibc.Chain { - t.Helper() cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ { Name: SedaCfg.Name, @@ -120,7 +117,6 @@ func CreateChainsWithCustomConfig(t *testing.T, numVals, numFullNodes int, confi } func BuildAllChains(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, context.Context, *client.Client, string) { - t.Helper() ic := interchaintest.NewInterchain() for _, chain := range chains {