diff --git a/app/abci.go b/app/abci.go index c967ac8b0b..a34f867a0e 100644 --- a/app/abci.go +++ b/app/abci.go @@ -128,7 +128,7 @@ func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTxV2, tx sdk.T telemetry.SetGauge(float32(gInfo.GasUsed), "tx", "gas", "used") telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted") }() - gInfo, result, anteEvents, resCtx, err := legacyabci.DeliverTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum).WithVoteInfos(app.UnsafeGetVoteInfos()), tx, app.GetTxConfig(), &app.DeliverTxKeepers, checksum, func(ctx sdk.Context) (sdk.Context, sdk.CacheMultiStore) { + gInfo, result, anteEvents, resCtx, err := legacyabci.DeliverTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum), tx, app.GetTxConfig(), &app.DeliverTxKeepers, checksum, func(ctx sdk.Context) (sdk.Context, sdk.CacheMultiStore) { return app.CacheTxContext(ctx, checksum) }, app.RunMsgs, app.TracingInfo, app.AddCosmosEventsToEVMReceiptIfApplicable) if err != nil { diff --git a/app/antedecorators/authz_nested_message_test.go b/app/antedecorators/authz_nested_message_test.go index fa2e77ec61..4db47e7828 100644 --- a/app/antedecorators/authz_nested_message_test.go +++ b/app/antedecorators/authz_nested_message_test.go @@ -8,7 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/sei-protocol/sei-chain/app/antedecorators" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" "github.com/stretchr/testify/require" ) @@ -20,7 +19,7 @@ func TestAuthzNestedEvmMessage(t *testing.T) { anteDecorators := []sdk.AnteDecorator{ antedecorators.NewAuthzNestedMessageDecorator(), } - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) chainedHandler := sdk.ChainAnteDecorators(anteDecorators...) nestedEvmMessage := authz.NewMsgExec(addr1, []sdk.Msg{&evmtypes.MsgEVMTransaction{}}) diff --git a/app/antedecorators/gas_test.go b/app/antedecorators/gas_test.go index 80b168cfc8..71bc38c5a3 100644 --- a/app/antedecorators/gas_test.go +++ b/app/antedecorators/gas_test.go @@ -7,14 +7,13 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/antedecorators" - "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types" "github.com/stretchr/testify/require" ) func TestMultiplierGasSetter(t *testing.T) { testApp := app.Setup(t, false, false, false) - ctx := testApp.NewContext(false, types.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) testApp.ParamsKeeper.SetCosmosGasParams(ctx, *paramtypes.DefaultCosmosGasParams()) testApp.ParamsKeeper.SetFeesParams(ctx, paramtypes.DefaultGenesis().GetFeesParams()) testMsg := wasmtypes.MsgExecuteContract{ diff --git a/app/antedecorators/gasless_test.go b/app/antedecorators/gasless_test.go index 914c51bfa2..4c743d3c69 100644 --- a/app/antedecorators/gasless_test.go +++ b/app/antedecorators/gasless_test.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/sei-protocol/sei-chain/app/antedecorators" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" oraclekeeper "github.com/sei-protocol/sei-chain/x/oracle/keeper" oracletestutils "github.com/sei-protocol/sei-chain/x/oracle/keeper/testutils" @@ -137,7 +136,7 @@ func TestNonGaslessMsg(t *testing.T) { // this needs to be updated if its changed from constant true // reset gasless gasless = true - err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &oracletypes.MsgDelegateFeedConsent{}, oraclekeeper.Keeper{}, nil) + err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, sdk.Header{}, false, nil).WithIsCheckTx(true), &oracletypes.MsgDelegateFeedConsent{}, oraclekeeper.Keeper{}, nil) require.NoError(t, err) require.False(t, gasless) } diff --git a/app/antedecorators/priority_test.go b/app/antedecorators/priority_test.go index 47d197edca..e7943f47c7 100644 --- a/app/antedecorators/priority_test.go +++ b/app/antedecorators/priority_test.go @@ -12,7 +12,6 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/antedecorators" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" wasmkeeper "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/keeper" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/sei-protocol/sei-chain/x/oracle" @@ -24,7 +23,7 @@ func TestPriorityAnteDecorator(t *testing.T) { anteDecorators := []sdk.AnteDecorator{ antedecorators.NewPriorityDecorator(), } - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) chainedHandler := sdk.ChainAnteDecorators(anteDecorators...) // test with normal priority newCtx, err := chainedHandler( @@ -41,7 +40,7 @@ func TestPriorityAnteDecoratorTooHighPriority(t *testing.T) { anteDecorators := []sdk.AnteDecorator{ antedecorators.NewPriorityDecorator(), } - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) chainedHandler := sdk.ChainAnteDecorators(anteDecorators...) // test with too high priority, should be auto capped newCtx, err := chainedHandler( @@ -62,7 +61,7 @@ func TestPriorityAnteDecoratorOracleMsg(t *testing.T) { anteDecorators := []sdk.AnteDecorator{ antedecorators.NewPriorityDecorator(), } - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) chainedHandler := sdk.ChainAnteDecorators(anteDecorators...) // test with zero priority, should be bumped up to oracle priority newCtx, err := chainedHandler( @@ -90,7 +89,7 @@ func (d PriorityCaptureDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat func TestPriorityWithExactAnteChain_BankSend(t *testing.T) { testApp := app.Setup(t, false, false, false) - ctx := testApp.NewContext(false, tmproto.Header{ChainID: "sei-test"}).WithBlockHeight(2).WithIsCheckTx(true) + ctx := testApp.NewContext(false, sdk.Header{ChainID: "sei-test"}).WithBlockHeight(2).WithIsCheckTx(true) testApp.ParamsKeeper.SetCosmosGasParams(ctx, *paramtypes.DefaultCosmosGasParams()) testApp.ParamsKeeper.SetFeesParams(ctx, paramtypes.DefaultGenesis().GetFeesParams()) @@ -157,7 +156,7 @@ func (d PrioritySetterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate func TestPrioritySetterWithAnteHandlers(t *testing.T) { testApp := app.Setup(t, false, false, false) - ctx := testApp.NewContext(false, tmproto.Header{}).WithBlockHeight(2).WithIsCheckTx(true) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2).WithIsCheckTx(true) testApp.ParamsKeeper.SetCosmosGasParams(ctx, *paramtypes.DefaultCosmosGasParams()) testApp.ParamsKeeper.SetFeesParams(ctx, paramtypes.DefaultGenesis().GetFeesParams()) diff --git a/app/antedecorators/traced_test.go b/app/antedecorators/traced_test.go index f3a754d18c..2c1cccc04d 100644 --- a/app/antedecorators/traced_test.go +++ b/app/antedecorators/traced_test.go @@ -5,7 +5,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app/antedecorators" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/utils" "github.com/stretchr/testify/require" ) @@ -21,6 +20,6 @@ func TestTracedDecorator(t *testing.T) { return antedecorators.NewTracedAnteDecorator(d, nil) }) chainedHandler := sdk.ChainAnteDecorators(tracedDecorators...) - chainedHandler(sdk.NewContext(nil, tmproto.Header{}, false, nil), FakeTx{}, false) + chainedHandler(sdk.NewContext(nil, sdk.Header{}, false, nil), FakeTx{}, false) require.Equal(t, "onetwothree", output) } diff --git a/app/app.go b/app/app.go index e60522181c..dd310ce938 100644 --- a/app/app.go +++ b/app/app.go @@ -986,7 +986,7 @@ func New( tmos.Exit(err.Error()) } - ctx := app.NewUncachedContext(true, tmproto.Header{}) + ctx := app.NewUncachedContext(true, sdk.Header{}) if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) } diff --git a/app/app_test.go b/app/app_test.go index 04d12f55e3..70e79fea58 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -611,7 +611,7 @@ func isSwaggerRouteAdded(router *mux.Router) bool { func TestGaslessTransactionExtremeGasValue(t *testing.T) { sei := app.Setup(t, false, false, false) - ctx := sei.BaseApp.NewContext(false, types.Header{}) + ctx := sei.BaseApp.NewContext(false, sdk.Header{}) testAddr := sdk.AccAddress([]byte("test_address_1234567")) @@ -800,7 +800,7 @@ func TestProcessBlockUpgradePanicLogic(t *testing.T) { func TestDeliverTxWithNilTypedTxDoesNotPanic(t *testing.T) { sei := app.Setup(t, false, false, false) - ctx := sei.BaseApp.NewContext(false, types.Header{}) + ctx := sei.BaseApp.NewContext(false, sdk.Header{}) malformedTxBytes := []byte("invalid tx bytes that cannot be decoded") diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index ad4f3ff2b8..7edbb1f44e 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -19,7 +19,6 @@ import ( abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/suite" dbm "github.com/tendermint/tm-db" @@ -39,7 +38,7 @@ type KeeperTestHelper struct { // Setup sets up basic environment for suite (App, Ctx, and test accounts) func (s *KeeperTestHelper) Setup() { s.App = app.Setup(s.T(), false, false, false) - s.Ctx = s.App.NewContext(false, tmtypes.Header{Height: 1, ChainID: "sei-test", Time: time.Now().UTC()}) + s.Ctx = s.App.NewContext(false, sdk.Header{Height: 1, ChainID: "sei-test", Time: time.Now().UTC()}) s.QueryHelper = &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: s.App.GRPCQueryRouter(), Ctx: s.Ctx, @@ -55,7 +54,7 @@ func (s *KeeperTestHelper) CreateTestContext() sdk.Context { ms := rootmulti.NewStore(db, log.NewNopLogger()) - return sdk.NewContext(ms, tmtypes.Header{}, false, logger) + return sdk.NewContext(ms, sdk.Header{}, false, logger) } // CreateTestContext creates a test context. @@ -66,7 +65,7 @@ func (s *KeeperTestHelper) Commit() { if err != nil { panic(err) } - newHeader := tmtypes.Header{Height: oldHeight + 1, ChainID: oldHeader.ChainID, Time: time.Now().UTC()} + newHeader := sdk.Header{Height: oldHeight + 1, ChainID: oldHeader.ChainID, Time: time.Now().UTC()} legacyabci.BeginBlock(s.Ctx, newHeader.Height, []abci.VoteInfo{}, []abci.Misbehavior{}, s.App.BeginBlockKeepers) s.Ctx = s.App.GetBaseApp().NewContext(false, newHeader) } diff --git a/app/benchmark_test.go b/app/benchmark_test.go index 2689d819da..65ba0db871 100644 --- a/app/benchmark_test.go +++ b/app/benchmark_test.go @@ -10,7 +10,6 @@ import ( "github.com/sei-protocol/sei-chain/app/benchmark" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" ) @@ -19,7 +18,7 @@ func createTestContext() sdk.Context { db := dbm.NewMemDB() logger := log.NewNopLogger() ms := rootmulti.NewStore(db, log.NewNopLogger()) - return sdk.NewContext(ms, tmtypes.Header{}, false, logger) + return sdk.NewContext(ms, sdk.Header{}, false, logger) } func TestPrepareProposalBenchmarkHandler(t *testing.T) { diff --git a/app/export.go b/app/export.go index 90d59506b9..81632b730d 100644 --- a/app/export.go +++ b/app/export.go @@ -8,8 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/kv" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -23,7 +21,7 @@ func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, sdk.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -55,7 +53,7 @@ func (app *App) ExportAppToFileStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, file *os.File, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, sdk.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. diff --git a/app/optimistic_processing_test.go b/app/optimistic_processing_test.go index 9db0cd06a4..5adbd655df 100644 --- a/app/optimistic_processing_test.go +++ b/app/optimistic_processing_test.go @@ -8,7 +8,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" ) @@ -20,7 +19,7 @@ type OptimisticProcessingTestSuite struct { func (suite *OptimisticProcessingTestSuite) SetupTest() { suite.app = Setup(suite.T(), false, false, false) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + suite.ctx = suite.app.BaseApp.NewContext(false, sdk.Header{Height: 1}) } func TestOptimisticProcessingTestSuite(t *testing.T) { diff --git a/app/test_helpers.go b/app/test_helpers.go index 35c5e79d90..c7d6397c53 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -188,7 +188,7 @@ func newTestWrapper(tb testing.TB, tm time.Time, valPub cryptotypes.PubKey, enab } else { appPtr = Setup(tb, false, enableEVMCustomPrecompiles, false, baseAppOptions...) } - ctx := appPtr.NewContext(false, tmproto.Header{Height: 1, ChainID: "sei-test", Time: tm}) + ctx := appPtr.NewContext(false, sdk.Header{Height: 1, ChainID: "sei-test", Time: tm}) wrapper := &TestWrapper{ App: appPtr, Ctx: ctx, @@ -292,7 +292,7 @@ func (s *TestWrapper) BeginBlock() { newBlockTime := s.Ctx.BlockTime().Add(2 * time.Second) - header := tmproto.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime} + header := sdk.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime} newCtx := s.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(s.Ctx.BlockHeight() + 1) s.Ctx = newCtx lastCommitInfo := abci.LastCommitInfo{ @@ -914,7 +914,7 @@ func GenTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, ch } func SignCheckDeliver( - t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, + t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header sdk.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { @@ -992,7 +992,7 @@ func incrementAllSequenceNumbers(initSeqNums []uint64) { // CheckBalance checks the balance of an account. func CheckBalance(t *testing.T, app *App, addr sdk.AccAddress, balances sdk.Coins) { - ctxCheck := app.NewContext(true, tmproto.Header{}) + ctxCheck := app.NewContext(true, sdk.Header{}) require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr))) } diff --git a/app/upgrade_test.go b/app/upgrade_test.go index e731d66be8..49a8d1b13a 100644 --- a/app/upgrade_test.go +++ b/app/upgrade_test.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/sei-protocol/sei-chain/app" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" ) @@ -39,7 +38,7 @@ func TestSkipOptimisticProcessingOnUpgrade(t *testing.T) { testWrapper := app.NewTestWrapper(t, tm, valPub, false) // No optimistic processing with upgrade scheduled - testCtx := testWrapper.App.BaseApp.NewContext(false, tmproto.Header{Height: 3, ChainID: "sei-test", Time: tm}) + testCtx := testWrapper.App.BaseApp.NewContext(false, sdk.Header{Height: 3, ChainID: "sei-test", Time: tm}) testWrapper.App.UpgradeKeeper.ScheduleUpgrade(testWrapper.Ctx, types.Plan{ Name: "test-plan", @@ -60,7 +59,7 @@ func TestSkipOptimisticProcessingOnUpgrade(t *testing.T) { tm := time.Now().UTC() valPub := secp256k1.GenPrivKey().PubKey() testWrapper := app.NewTestWrapper(t, tm, valPub, false) - testCtx := testWrapper.App.BaseApp.NewContext(false, tmproto.Header{Height: 3, ChainID: "sei-test", Time: tm}) + testCtx := testWrapper.App.BaseApp.NewContext(false, sdk.Header{Height: 3, ChainID: "sei-test", Time: tm}) testWrapper.App.UpgradeKeeper.ScheduleUpgrade(testWrapper.Ctx, types.Plan{ Name: "test-plan", diff --git a/giga/deps/testutil/keeper/epoch.go b/giga/deps/testutil/keeper/epoch.go index 0adf9b751c..6bd0631de1 100644 --- a/giga/deps/testutil/keeper/epoch.go +++ b/giga/deps/testutil/keeper/epoch.go @@ -11,7 +11,6 @@ import ( typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/epoch/keeper" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" @@ -48,7 +47,7 @@ func EpochKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { paramsSubspace, ) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(stateStore, sdk.Header{}, false, log.NewNopLogger()) // Initialize params k.SetParams(ctx, types.DefaultParams()) diff --git a/giga/deps/xbank/keeper/keeper_test.go b/giga/deps/xbank/keeper/keeper_test.go index d68b31577d..d256fc995f 100644 --- a/giga/deps/xbank/keeper/keeper_test.go +++ b/giga/deps/xbank/keeper/keeper_test.go @@ -17,7 +17,6 @@ import ( "github.com/sei-protocol/sei-chain/giga/deps/xbank/keeper" "github.com/sei-protocol/sei-chain/giga/deps/xbank/types" "github.com/sei-protocol/sei-chain/occ_tests/utils" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/suite" ) @@ -95,7 +94,7 @@ func (suite *IntegrationTestSuite) SetupTest() { }) a := wrapper.App ctx := wrapper.Ctx - ctx = ctx.WithBlockHeader(tmproto.Header{ + ctx = ctx.WithBlockHeader(sdk.Header{ Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime, @@ -403,7 +402,7 @@ func (suite *IntegrationTestSuite) TestHasBalance() { func (suite *IntegrationTestSuite) TestSpendableCoins() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -434,7 +433,7 @@ func (suite *IntegrationTestSuite) TestSpendableCoins() { func (suite *IntegrationTestSuite) TestVestingAccountSend() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -462,7 +461,7 @@ func (suite *IntegrationTestSuite) TestVestingAccountSend() { func (suite *IntegrationTestSuite) TestPeriodicVestingAccountSend() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 50)) diff --git a/giga/tests/giga_test.go b/giga/tests/giga_test.go index ad349007fd..8d0f7e0a16 100644 --- a/giga/tests/giga_test.go +++ b/giga/tests/giga_test.go @@ -18,7 +18,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/occ_tests/utils" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/evm/config" "github.com/sei-protocol/sei-chain/x/evm/types" "github.com/sei-protocol/sei-chain/x/evm/types/ethtx" @@ -91,7 +90,7 @@ func NewGigaTestContext(t testing.TB, testAccts []utils.TestAcct, blockTime time } testApp := wrapper.App ctx := wrapper.Ctx - ctx = ctx.WithBlockHeader(tmproto.Header{ + ctx = ctx.WithBlockHeader(sdk.Header{ Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime, diff --git a/giga/tests/state_harness_test.go b/giga/tests/state_harness_test.go index f0885fd59c..83906de53c 100644 --- a/giga/tests/state_harness_test.go +++ b/giga/tests/state_harness_test.go @@ -17,7 +17,6 @@ import ( "github.com/sei-protocol/sei-chain/giga/tests/harness" "github.com/sei-protocol/sei-chain/occ_tests/utils" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/stretchr/testify/require" ) @@ -104,7 +103,7 @@ func NewStateTestContext(t testing.TB, blockTime time.Time, workers int, mode Ex } testApp := wrapper.App ctx := wrapper.Ctx - ctx = ctx.WithBlockHeader(tmproto.Header{ + ctx = ctx.WithBlockHeader(sdk.Header{ Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime, diff --git a/occ_tests/utils/utils.go b/occ_tests/utils/utils.go index f988337ae7..64208b4c83 100644 --- a/occ_tests/utils/utils.go +++ b/occ_tests/utils/utils.go @@ -25,7 +25,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" wasmkeeper "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/keeper" wasmxtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types" "github.com/stretchr/testify/require" @@ -165,7 +164,7 @@ func NewTestContext(tb testing.TB, testAccts []TestAcct, blockTime time.Time, wo }) testApp := wrapper.App ctx := wrapper.Ctx - ctx = ctx.WithBlockHeader(tmproto.Header{Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime}) + ctx = ctx.WithBlockHeader(sdk.Header{Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime}) amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(1000000000000000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000000000000))) bankkeeper := testApp.BankKeeper wasmKeeper := testApp.WasmKeeper diff --git a/precompiles/addr/addr_test.go b/precompiles/addr/addr_test.go index 68ad339939..80a452ca8a 100644 --- a/precompiles/addr/addr_test.go +++ b/precompiles/addr/addr_test.go @@ -6,11 +6,11 @@ import ( "math/big" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/sei-protocol/sei-chain/precompiles/addr" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/stretchr/testify/require" @@ -18,7 +18,7 @@ import ( func TestAssociatePubKey(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper pre, _ := addr.NewPrecompile(testApp.GetPrecompileKeepers()) @@ -180,7 +180,7 @@ func TestAssociatePubKey(t *testing.T) { func TestAssociate(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper pre, _ := addr.NewPrecompile(testApp.GetPrecompileKeepers()) @@ -371,7 +371,7 @@ func TestAssociate(t *testing.T) { func TestGetAddr(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper pre, _ := addr.NewPrecompile(testApp.GetPrecompileKeepers()) diff --git a/precompiles/bank/bank_test.go b/precompiles/bank/bank_test.go index a049cf6bb7..1ace9c906a 100644 --- a/precompiles/bank/bank_test.go +++ b/precompiles/bank/bank_test.go @@ -19,7 +19,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/sei-protocol/sei-chain/precompiles/bank" pcommon "github.com/sei-protocol/sei-chain/precompiles/common" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/keeper" @@ -46,7 +45,7 @@ func (tx mockTx) GetGasEstimate() uint64 { return 0 } func TestRun(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper upgradeKeeper := &testApp.UpgradeKeeper @@ -263,7 +262,7 @@ func TestRun(t *testing.T) { func TestSendForUnlinkedReceiver(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Setup sender addresses and environment diff --git a/precompiles/distribution/distribution_test.go b/precompiles/distribution/distribution_test.go index 33ba41f611..af332f8e29 100644 --- a/precompiles/distribution/distribution_test.go +++ b/precompiles/distribution/distribution_test.go @@ -28,7 +28,6 @@ import ( "github.com/sei-protocol/sei-chain/precompiles/distribution" "github.com/sei-protocol/sei-chain/precompiles/staking" "github.com/sei-protocol/sei-chain/precompiles/utils" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/keeper" @@ -45,7 +44,7 @@ var f embed.FS func TestWithdraw(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) distrParams := testApp.DistrKeeper.GetParams(ctx) distrParams.WithdrawAddrEnabled = true testApp.DistrKeeper.SetParams(ctx, distrParams) @@ -171,7 +170,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawMultipleDelegationRewards(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) distrParams := testApp.DistrKeeper.GetParams(ctx) distrParams.WithdrawAddrEnabled = true testApp.DistrKeeper.SetParams(ctx, distrParams) @@ -501,7 +500,7 @@ func TestPrecompile_RunAndCalculateGas_WithdrawDelegationRewards(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -662,7 +661,7 @@ func TestPrecompile_RunAndCalculateGas_WithdrawMultipleDelegationRewards(t *test for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -836,7 +835,7 @@ func TestPrecompile_RunAndCalculateGas_SetWithdrawAddress(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1141,7 +1140,7 @@ func TestPrecompile_RunAndCalculateGas_Rewards(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1177,7 +1176,7 @@ func TestPrecompile_RunAndCalculateGas_Rewards(t *testing.T) { func TestWithdrawValidatorCommission_noCommissionToWithdrawRightAfterDelegation(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) distrParams := testApp.DistrKeeper.GetParams(ctx) distrParams.WithdrawAddrEnabled = true testApp.DistrKeeper.SetParams(ctx, distrParams) @@ -1277,7 +1276,7 @@ func TestWithdrawValidatorCommission_noCommissionToWithdrawRightAfterDelegation( // 3. This unit test validates the happy path and ensures proper response formatting/unpacking func TestWithdrawValidatorCommission_UnitTest(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Set up caller @@ -1329,7 +1328,7 @@ func TestWithdrawValidatorCommission_UnitTest(t *testing.T) { // TestWithdrawValidatorCommission_InputValidation tests various input validation scenarios func TestWithdrawValidatorCommission_InputValidation(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Set up caller diff --git a/precompiles/gov/gov_test.go b/precompiles/gov/gov_test.go index dc3fa4504b..28134ad4df 100644 --- a/precompiles/gov/gov_test.go +++ b/precompiles/gov/gov_test.go @@ -11,7 +11,6 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" pcommon "github.com/sei-protocol/sei-chain/precompiles/common" @@ -28,7 +27,7 @@ var f embed.FS func TestGovPrecompile(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) content := govtypes.ContentFromProposalType("title", "description", govtypes.ProposalTypeText, false) proposal, err := testApp.GovKeeper.SubmitProposal(ctx, content) require.Nil(t, err) @@ -700,7 +699,7 @@ func TestPrecompileExecutor_submitProposal(t *testing.T) { // Create a fresh testApp instance for each test testApp := testkeeper.EVMTestApp // Create a fresh context for each test - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(3) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(3) // Dynamically determine the expected proposal ID for this test proposals := testApp.GovKeeper.GetProposals(ctx) diff --git a/precompiles/ibc/ibc_test.go b/precompiles/ibc/ibc_test.go index 8ae5df1eac..fe89af6096 100644 --- a/precompiles/ibc/ibc_test.go +++ b/precompiles/ibc/ibc_test.go @@ -17,7 +17,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer/types" clienttypes "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core/02-client/types" "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core/exported" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/stretchr/testify/require" @@ -311,7 +310,7 @@ func TestPrecompile_Run(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, senderSeiAddress, senderEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -500,7 +499,7 @@ func TestTransferWithDefaultTimeoutPrecompile_Run(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, senderSeiAddress, senderEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) diff --git a/precompiles/oracle/oracle_test.go b/precompiles/oracle/oracle_test.go index e496932cf9..e805412f89 100644 --- a/precompiles/oracle/oracle_test.go +++ b/precompiles/oracle/oracle_test.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" "github.com/sei-protocol/sei-chain/precompiles/oracle" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/sei-protocol/sei-chain/x/oracle/types" @@ -19,7 +18,7 @@ import ( func TestGetExchangeRate(t *testing.T) { testApp := testkeeper.EVMTestApp rate := sdk.NewDec(1700) - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) testApp.OracleKeeper.SetBaseExchangeRate(ctx, utils.MicroAtomDenom, rate) k := &testApp.EvmKeeper @@ -70,7 +69,7 @@ func TestGetExchangeRate(t *testing.T) { func TestGetOracleTwaps(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockTime(time.Unix(5400, 0)) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockTime(time.Unix(5400, 0)) priceSnapshots := types.PriceSnapshots{ types.NewPriceSnapshot(types.PriceSnapshotItems{ diff --git a/precompiles/staking/staking_events_test.go b/precompiles/staking/staking_events_test.go index 52d953e9e9..5337924aa3 100644 --- a/precompiles/staking/staking_events_test.go +++ b/precompiles/staking/staking_events_test.go @@ -15,7 +15,6 @@ import ( "github.com/sei-protocol/sei-chain/app" pcommon "github.com/sei-protocol/sei-chain/precompiles/common" "github.com/sei-protocol/sei-chain/precompiles/staking" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/ante" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" @@ -28,7 +27,7 @@ import ( func TestStakingPrecompileEventsEmission(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Setup validators - make them Bonded so they can accept delegations diff --git a/precompiles/staking/staking_test.go b/precompiles/staking/staking_test.go index 2ad7ec5ded..8ce35ac2db 100644 --- a/precompiles/staking/staking_test.go +++ b/precompiles/staking/staking_test.go @@ -29,7 +29,6 @@ import ( pcommon "github.com/sei-protocol/sei-chain/precompiles/common" "github.com/sei-protocol/sei-chain/precompiles/staking" "github.com/sei-protocol/sei-chain/precompiles/utils" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/keeper" @@ -45,7 +44,7 @@ var f embed.FS func TestStaking(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper valPub1 := ed25519.GenPrivKey().PubKey() valPub2 := ed25519.GenPrivKey().PubKey() @@ -155,7 +154,7 @@ func TestStaking(t *testing.T) { func TestStakingError(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper valPub1 := ed25519.GenPrivKey().PubKey() valPub2 := ed25519.GenPrivKey().PubKey() @@ -516,7 +515,7 @@ func TestPrecompile_Run_Delegation(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -663,7 +662,7 @@ func TestPrecompile_Run_Validators(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -790,7 +789,7 @@ func TestPrecompile_Run_Validator(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -899,7 +898,7 @@ func TestPrecompile_Run_ValidatorDelegations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1009,7 +1008,7 @@ func TestPrecompile_Run_ValidatorUnbondingDelegations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1112,7 +1111,7 @@ func TestPrecompile_Run_UnbondingDelegation(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1222,7 +1221,7 @@ func TestPrecompile_Run_DelegatorDelegations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1317,7 +1316,7 @@ func TestPrecompile_Run_DelegatorValidator(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1428,7 +1427,7 @@ func TestPrecompile_Run_DelegatorUnbondingDelegations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1552,7 +1551,7 @@ func TestPrecompile_Run_Redelegations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1653,7 +1652,7 @@ func TestPrecompile_Run_DelegatorValidators(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper k.SetAddressMapping(ctx, callerSeiAddress, callerEvmAddress) stateDb := state.NewDBImpl(ctx, k, true) @@ -1691,8 +1690,9 @@ func TestPrecompile_Run_HistoricalInfo(t *testing.T) { historicalInfoMethod, _ := pre.ABI.MethodById(pre.GetExecutor().(*staking.PrecompileExecutor).HistoricalInfoID) val := createTestValidator() + header := sdk.Header{Height: 100} historicalInfo := stakingtypes.HistoricalInfo{ - Header: tmtypes.Header{Height: 100}, + Header: header.ToProto(), Valset: []stakingtypes.Validator{val}, } @@ -1757,7 +1757,7 @@ func TestPrecompile_Run_HistoricalInfo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1842,7 +1842,7 @@ func TestPrecompile_Run_Pool(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1939,7 +1939,7 @@ func TestPrecompile_Run_Params(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper stateDb := state.NewDBImpl(ctx, k, true) evm := vm.EVM{ @@ -1987,7 +1987,7 @@ type createValidatorTestSetup struct { // setupCreateValidatorTest creates a common test setup for createValidator tests func setupCreateValidatorTest(t *testing.T) *createValidatorTestSetup { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper abi := pcommon.MustGetABI(f, "abi.json") @@ -2247,7 +2247,7 @@ func TestCreateValidator_UnassociatedAddress(t *testing.T) { func TestEditValidator_ErorrIfDoesNotExist(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper abi := pcommon.MustGetABI(f, "abi.json") @@ -2304,7 +2304,7 @@ func TestEditValidator_ErorrIfDoesNotExist(t *testing.T) { func TestEditValidator(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper abi := pcommon.MustGetABI(f, "abi.json") @@ -2418,7 +2418,7 @@ func TestEditValidator(t *testing.T) { func TestStakingPrecompileDelegateCallPrevention(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Setup staking precompile @@ -2500,7 +2500,7 @@ func TestStakingPrecompileDelegateCallPrevention(t *testing.T) { func TestStakingPrecompileStaticCallPrevention(t *testing.T) { testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper // Setup staking precompile diff --git a/sei-cosmos/baseapp/abci.go b/sei-cosmos/baseapp/abci.go index 96c90367df..17bde27f77 100644 --- a/sei-cosmos/baseapp/abci.go +++ b/sei-cosmos/baseapp/abci.go @@ -24,7 +24,6 @@ import ( "github.com/cosmos/cosmos-sdk/utils" "github.com/gogo/protobuf/proto" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" ) @@ -34,14 +33,14 @@ import ( func (app *BaseApp) InitChain(ctx context.Context, req *abci.RequestInitChain) (res *abci.ResponseInitChain, err error) { // On a new chain, we consider the init chain block height as 0, even though // req.InitialHeight is 1 by default. - initHeader := tmproto.Header{ChainID: req.ChainId, Time: req.Time} + initHeader := sdk.Header{ChainID: req.ChainId, Time: req.Time} app.ChainID = req.ChainId // If req.InitialHeight is > 1, then we set the initial version in the // stores. if req.InitialHeight > 1 { app.initialHeight = req.InitialHeight - initHeader = tmproto.Header{ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time} + initHeader = sdk.Header{ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time} err := app.cms.SetInitialVersion(req.InitialHeight) if err != nil { return nil, err @@ -207,7 +206,7 @@ func (app *BaseApp) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTxV2, tx s telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted") }() - gInfo, result, anteEvents, _, _, _, _, resCtx, err := app.runTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum).WithVoteInfos(app.voteInfos), runTxModeDeliver, tx, checksum) + gInfo, result, anteEvents, _, _, _, _, resCtx, err := app.runTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum), runTxModeDeliver, tx, checksum) if err != nil { resultStr = "failed" // if we have a result, use those events instead of just the anteEvents @@ -755,7 +754,7 @@ func (app *BaseApp) GetBlockRetentionHeight(commitHeight int64) int64 { } func (app *BaseApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) { - ctx := app.checkState.ctx.WithTxBytes(txBytes).WithVoteInfos(app.voteInfos).WithConsensusParams(app.GetConsensusParams(app.checkState.ctx)) + ctx := app.checkState.ctx.WithTxBytes(txBytes).WithConsensusParams(app.GetConsensusParams(app.checkState.ctx)) ctx, _ = ctx.CacheContext() tx, err := app.txDecoder(txBytes) if err != nil { @@ -920,7 +919,7 @@ func splitPath(requestPath string) (path []string) { func (app *BaseApp) PrepareProposal(ctx context.Context, req *abci.RequestPrepareProposal) (resp *abci.ResponsePrepareProposal, err error) { defer telemetry.MeasureSince(time.Now(), "abci", "prepare_proposal") - header := tmproto.Header{ + header := sdk.Header{ ChainID: app.ChainID, Height: req.Height, Time: req.Time, @@ -933,9 +932,9 @@ func (app *BaseApp) PrepareProposal(ctx context.Context, req *abci.RequestPrepar ValidatorsHash: req.ValidatorsHash, LastCommitHash: req.LastCommitHash, LastResultsHash: req.LastResultsHash, - LastBlockId: tmproto.BlockID{ + LastBlockId: sdk.BlockID{ Hash: req.LastBlockHash, - PartSetHeader: tmproto.PartSetHeader{ + PartSetHeader: sdk.PartSetHeader{ Total: uint32(req.LastBlockPartSetTotal), Hash: req.LastBlockPartSetHash, }, @@ -987,7 +986,7 @@ func (app *BaseApp) PrepareProposal(ctx context.Context, req *abci.RequestPrepar func (app *BaseApp) ProcessProposal(ctx context.Context, req *abci.RequestProcessProposal) (resp *abci.ResponseProcessProposal, err error) { defer telemetry.MeasureSince(time.Now(), "abci", "process_proposal") - header := tmproto.Header{ + header := sdk.Header{ ChainID: app.ChainID, Height: req.Height, Time: req.Time, @@ -1000,9 +999,9 @@ func (app *BaseApp) ProcessProposal(ctx context.Context, req *abci.RequestProces ValidatorsHash: req.ValidatorsHash, LastCommitHash: req.LastCommitHash, LastResultsHash: req.LastResultsHash, - LastBlockId: tmproto.BlockID{ + LastBlockId: sdk.BlockID{ Hash: req.LastBlockHash, - PartSetHeader: tmproto.PartSetHeader{ + PartSetHeader: sdk.PartSetHeader{ Total: uint32(req.LastBlockPartSetTotal), Hash: req.LastBlockPartSetHash, }, @@ -1062,7 +1061,7 @@ func (app *BaseApp) FinalizeBlock(ctx context.Context, req *abci.RequestFinalize // Initialize the DeliverTx state. If this is the first block, it should // already be initialized in InitChain. Otherwise app.deliverState will be // nil, since it is reset on Commit. - header := tmproto.Header{ + header := sdk.Header{ ChainID: app.ChainID, Height: req.Height, Time: req.Time, @@ -1075,9 +1074,9 @@ func (app *BaseApp) FinalizeBlock(ctx context.Context, req *abci.RequestFinalize ValidatorsHash: req.ValidatorsHash, LastCommitHash: req.LastCommitHash, LastResultsHash: req.LastResultsHash, - LastBlockId: tmproto.BlockID{ + LastBlockId: sdk.BlockID{ Hash: req.LastBlockHash, - PartSetHeader: tmproto.PartSetHeader{ + PartSetHeader: sdk.PartSetHeader{ Total: uint32(req.LastBlockPartSetTotal), Hash: req.LastBlockPartSetHash, }, @@ -1107,9 +1106,6 @@ func (app *BaseApp) FinalizeBlock(ctx context.Context, req *abci.RequestFinalize return nil, err } res.Events = sdk.MarkEventsToIndex(res.Events, app.IndexEvents) - // set the signed validators for addition to context in deliverTx - app.setVotesInfo(req.DecidedLastCommit.GetVotes()) - return res, nil } else { return nil, errors.New("finalize block handler not set") diff --git a/sei-cosmos/baseapp/baseapp.go b/sei-cosmos/baseapp/baseapp.go index 0944943a24..2aaa06226d 100644 --- a/sei-cosmos/baseapp/baseapp.go +++ b/sei-cosmos/baseapp/baseapp.go @@ -157,7 +157,6 @@ type BaseApp struct { ChainID string - votesInfoLock sync.RWMutex commitLock *sync.Mutex checkTxStateLock *sync.RWMutex @@ -197,9 +196,6 @@ type abciData struct { initChainer sdk.InitChainer // initialize state with validators and state blob midBlocker sdk.MidBlocker // logic to run after all txs, and to determine valset changes endBlocker sdk.EndBlocker // logic to run after all txs, and to determine valset changes - - // absent validators from begin block - voteInfos []abci.VoteInfo } type baseappVersions struct { @@ -458,7 +454,7 @@ func (app *BaseApp) LoadVersion(version int64) error { // specifically used by export genesis command. func (app *BaseApp) LoadVersionWithoutInit(version int64) error { err := app.cms.LoadVersion(version) - app.setCheckState(tmproto.Header{}) + app.setCheckState(sdk.Header{}) return err } @@ -478,7 +474,7 @@ func (app *BaseApp) init() error { } // needed for the export command which inits from store but never calls initchain - app.setCheckState(tmproto.Header{}) + app.setCheckState(sdk.Header{}) app.Seal() return nil @@ -544,7 +540,7 @@ func (app *BaseApp) IsSealed() bool { return app.sealed } // (i.e. a CacheMultiStore) and a new Context with the same multi-store branch, // provided header, and minimum gas prices set. It is set on InitChain and reset // on Commit. -func (app *BaseApp) setCheckState(header tmproto.Header) { +func (app *BaseApp) setCheckState(header sdk.Header) { ms := app.cms.CacheMultiStore() ctx := sdk.NewContext(ms, header, true, app.logger).WithMinGasPrices(app.minGasPrices) app.checkTxStateLock.Lock() @@ -565,7 +561,7 @@ func (app *BaseApp) setCheckState(header tmproto.Header) { // (i.e. a CacheMultiStore) and a new Context with the same multi-store branch, // and provided header. It is set on InitChain and BeginBlock and set to nil on // Commit. -func (app *BaseApp) setDeliverState(header tmproto.Header) { +func (app *BaseApp) setDeliverState(header sdk.Header) { ms := app.cms.CacheMultiStore() ctx := sdk.NewContext(ms, header, false, app.logger) if app.deliverState == nil { @@ -580,7 +576,7 @@ func (app *BaseApp) setDeliverState(header tmproto.Header) { app.deliverState.SetContext(ctx) } -func (app *BaseApp) setPrepareProposalState(header tmproto.Header) { +func (app *BaseApp) setPrepareProposalState(header sdk.Header) { ms := app.cms.CacheMultiStore() ctx := sdk.NewContext(ms, header, false, app.logger) if app.prepareProposalState == nil { @@ -595,7 +591,7 @@ func (app *BaseApp) setPrepareProposalState(header tmproto.Header) { app.prepareProposalState.SetContext(ctx) } -func (app *BaseApp) setProcessProposalState(header tmproto.Header) { +func (app *BaseApp) setProcessProposalState(header sdk.Header) { ms := app.cms.CacheMultiStore() ctx := sdk.NewContext(ms, header, false, app.logger) if app.processProposalState == nil { @@ -617,15 +613,15 @@ func (app *BaseApp) resetStatesExceptCheckState() { app.stateToCommit = nil } -func (app *BaseApp) setPrepareProposalHeader(header tmproto.Header) { +func (app *BaseApp) setPrepareProposalHeader(header sdk.Header) { app.prepareProposalState.SetContext(app.prepareProposalState.Context().WithBlockHeader(header)) } -func (app *BaseApp) setProcessProposalHeader(header tmproto.Header) { +func (app *BaseApp) setProcessProposalHeader(header sdk.Header) { app.processProposalState.SetContext(app.processProposalState.Context().WithBlockHeader(header)) } -func (app *BaseApp) setDeliverStateHeader(header tmproto.Header) { +func (app *BaseApp) setDeliverStateHeader(header sdk.Header) { app.deliverState.SetContext(app.deliverState.Context().WithBlockHeader(header).WithBlockHeight(header.Height)) } @@ -651,17 +647,6 @@ func (app *BaseApp) prepareDeliverState(headerHash []byte) { WithConsensusParams(app.GetConsensusParams(app.deliverState.Context()))) } -func (app *BaseApp) setVotesInfo(votes []abci.VoteInfo) { - app.votesInfoLock.Lock() - defer app.votesInfoLock.Unlock() - - app.voteInfos = votes -} - -func (app *BaseApp) UnsafeGetVoteInfos() []abci.VoteInfo { - return app.voteInfos -} - // GetConsensusParams returns the current consensus parameters from the BaseApp's // ParamStore. If the BaseApp has no ParamStore defined, nil is returned. func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams { @@ -804,11 +789,8 @@ func (app *BaseApp) getState(mode runTxMode) *state { // retrieve the context for the tx w/ txBytes and other memoized values. func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) sdk.Context { - app.votesInfoLock.RLock() - defer app.votesInfoLock.RUnlock() ctx := app.getState(mode).Context(). - WithTxBytes(txBytes). - WithVoteInfos(app.voteInfos) + WithTxBytes(txBytes) ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) @@ -824,15 +806,12 @@ func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) sdk.Context } func (app *BaseApp) GetCheckTxContext(txBytes []byte, recheck bool) sdk.Context { - app.votesInfoLock.RLock() - defer app.votesInfoLock.RUnlock() mode := runTxModeCheck if recheck { mode = runTxModeReCheck } ctx := app.getState(mode).Context(). - WithTxBytes(txBytes). - WithVoteInfos(app.voteInfos) + WithTxBytes(txBytes) return ctx.WithConsensusParams(app.GetConsensusParams(ctx)) } diff --git a/sei-cosmos/baseapp/baseapp_test.go b/sei-cosmos/baseapp/baseapp_test.go index 1c2cbc6b1c..0631967738 100644 --- a/sei-cosmos/baseapp/baseapp_test.go +++ b/sei-cosmos/baseapp/baseapp_test.go @@ -148,7 +148,7 @@ func TestSetOccEnabled(t *testing.T) { // func TestGetMaximumBlockGas(t *testing.T) { // app := setupBaseApp(t) // app.InitChain(context.Background(), &abci.RequestInitChain{}) -// ctx := app.NewContext(true, tmproto.Header{}) +// ctx := app.NewContext(true, sdk.Header{}) // app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: 0}}) // require.Equal(t, uint64(0), app.getMaximumBlockGas(ctx)) diff --git a/sei-cosmos/baseapp/deliver_tx_batch_test.go b/sei-cosmos/baseapp/deliver_tx_batch_test.go index aa0b10769a..8b57365606 100644 --- a/sei-cosmos/baseapp/deliver_tx_batch_test.go +++ b/sei-cosmos/baseapp/deliver_tx_batch_test.go @@ -6,7 +6,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -109,7 +108,7 @@ func TestDeliverTxBatch(t *testing.T) { txPerHeight := 5 for blockN := 0; blockN < nBlocks; blockN++ { - header := tmproto.Header{Height: int64(blockN) + 1} + header := sdk.Header{Height: int64(blockN) + 1} app.setDeliverState(header) var requests []*sdk.DeliverTxEntry @@ -166,7 +165,7 @@ func TestDeliverTxBatchEmpty(t *testing.T) { nBlocks := 3 for blockN := 0; blockN < nBlocks; blockN++ { - header := tmproto.Header{Height: int64(blockN) + 1} + header := sdk.Header{Height: int64(blockN) + 1} app.setDeliverState(header) var requests []*sdk.DeliverTxEntry diff --git a/sei-cosmos/baseapp/deliver_tx_test.go b/sei-cosmos/baseapp/deliver_tx_test.go index 754d786878..24205f1a17 100644 --- a/sei-cosmos/baseapp/deliver_tx_test.go +++ b/sei-cosmos/baseapp/deliver_tx_test.go @@ -214,7 +214,7 @@ func TestWithRouter(t *testing.T) { txPerHeight := 5 for blockN := 0; blockN < nBlocks; blockN++ { - header := tmproto.Header{Height: int64(blockN) + 1} + header := sdk.Header{Height: int64(blockN) + 1} app.setDeliverState(header) for i := 0; i < txPerHeight; i++ { @@ -262,7 +262,7 @@ func TestBaseApp_EndBlock(t *testing.T) { }) app.Seal() - app.setDeliverState(tmproto.Header{}) + app.setDeliverState(sdk.Header{}) res := app.EndBlock(app.deliverState.ctx, abci.RequestEndBlock{}) require.Len(t, res.GetValidatorUpdates(), 1) require.Equal(t, int64(100), res.GetValidatorUpdates()[0].Power) @@ -314,7 +314,7 @@ func TestQuery(t *testing.T) { require.Equal(t, 0, len(res.Value)) // query is still empty after a DeliverTx before we commit - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) _, resTx, err = app.Deliver(aminoTxEncoder(), tx) @@ -341,7 +341,7 @@ func TestGRPCQuery(t *testing.T) { app := setupBaseApp(t, grpcQueryOpt) app.InitChain(context.Background(), &abci.RequestInitChain{}) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) app.SetDeliverStateToCommit() app.Commit(context.Background()) @@ -421,7 +421,7 @@ func TestMultiMsgDeliverTx(t *testing.T) { // run a multi-msg tx // with all msgs the same route - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) tx := newTxCounter(0, 0, 1, 2) txBytes, err := codec.Marshal(tx) @@ -504,7 +504,7 @@ func TestSimulateTx(t *testing.T) { nBlocks := 3 for blockN := 0; blockN < nBlocks; blockN++ { count := int64(blockN + 1) - header := tmproto.Header{Height: count} + header := sdk.Header{Height: count} app.setDeliverState(header) tx := newTxCounter(count, count) @@ -561,7 +561,7 @@ func TestRunInvalidTransaction(t *testing.T) { app := setupBaseApp(t, anteOpt, routerOpt) - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) // transaction with no messages @@ -687,7 +687,7 @@ func TestTxGasLimits(t *testing.T) { app := setupBaseApp(t, anteOpt, routerOpt) - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) testCases := []struct { @@ -801,7 +801,7 @@ func TestTxGasLimits(t *testing.T) { // tx := tc.tx // // reset the block gas -// header := tmproto.Header{Height: app.LastBlockHeight() + 1} +// header := sdk.Header{Height: app.LastBlockHeight() + 1} // app.setDeliverState(header) // app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(sdk.NewGasMeter(app.getMaximumBlockGas(app.deliverState.ctx), 1, 1)) // app.BeginBlock(app.deliverState.ctx, abci.RequestBeginBlock{Header: header}) @@ -856,7 +856,7 @@ func TestCustomRunTxPanicHandler(t *testing.T) { app := setupBaseApp(t, anteOpt, routerOpt) - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) app.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error { @@ -905,7 +905,7 @@ func TestBaseAppAnteHandler(t *testing.T) { app.InitChain(context.Background(), &abci.RequestInitChain{}) registerTestCodec(cdc) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) // execute a tx that will fail ante handler execution @@ -993,7 +993,7 @@ func TestPrecommitHandlerPanic(t *testing.T) { app.InitChain(context.Background(), &abci.RequestInitChain{}) registerTestCodec(cdc) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) // execute a tx that will fail ante handler execution @@ -1109,7 +1109,7 @@ func TestGasConsumptionBadTx(t *testing.T) { app.InitChain(context.Background(), &abci.RequestInitChain{}) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) tx := newTxCounter(5, 0) @@ -1198,7 +1198,7 @@ func TestInitChainer(t *testing.T) { require.Equal(t, value, res.Value) // commit and ensure we can still query - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} app.setDeliverState(header) app.SetDeliverStateToCommit() app.Commit(context.Background()) @@ -1475,7 +1475,7 @@ func TestDeliverTx(t *testing.T) { txPerHeight := 5 for blockN := 0; blockN < nBlocks; blockN++ { - header := tmproto.Header{Height: int64(blockN) + 1} + header := sdk.Header{Height: int64(blockN) + 1} app.setDeliverState(header) for i := 0; i < txPerHeight; i++ { @@ -1534,7 +1534,7 @@ func TestDeliverTxHooks(t *testing.T) { codec := codec.NewLegacyAmino() registerTestCodec(codec) - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) // every even i is an evm tx @@ -1686,7 +1686,7 @@ func TestLoadVersionInvalid(t *testing.T) { err = app.LoadVersion(-1) require.Error(t, err) - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) app.SetDeliverStateToCommit() app.Commit(context.Background()) @@ -1732,7 +1732,7 @@ func setupBaseAppWithSnapshots(t *testing.T, blocks uint, blockTxs int, options r := rand.New(rand.NewSource(3920758213583)) keyCounter := 0 for height := int64(1); height <= int64(blocks); height++ { - app.setDeliverState(tmproto.Header{Height: height}) + app.setDeliverState(sdk.Header{Height: height}) for txNum := 0; txNum < blockTxs; txNum++ { tx := txTest{Msgs: []sdk.Msg{}} for msgNum := 0; msgNum < 100; msgNum++ { @@ -1806,13 +1806,13 @@ func TestLoadVersion(t *testing.T) { require.Equal(t, emptyCommitID, lastID) // execute a block, collect commit ID - header := tmproto.Header{Height: 1} + header := sdk.Header{Height: 1} app.setDeliverState(header) app.SetDeliverStateToCommit() app.Commit(context.Background()) // execute a block, collect commit ID - header = tmproto.Header{Height: 2} + header = sdk.Header{Height: 2} app.setDeliverState(header) app.SetDeliverStateToCommit() app.Commit(context.Background()) @@ -1895,7 +1895,7 @@ func TestSetLoader(t *testing.T) { require.Nil(t, err) // "execute" one block - app.setDeliverState(tmproto.Header{Height: 2}) + app.setDeliverState(sdk.Header{Height: 2}) app.SetDeliverStateToCommit() app.Commit(context.Background()) diff --git a/sei-cosmos/baseapp/grpcrouter_test.go b/sei-cosmos/baseapp/grpcrouter_test.go index 0f5881c75c..9e0c197d48 100644 --- a/sei-cosmos/baseapp/grpcrouter_test.go +++ b/sei-cosmos/baseapp/grpcrouter_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/sei-wasmd/app" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" @@ -25,7 +24,7 @@ func TestGRPCGatewayRouter(t *testing.T) { testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) helper := &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: qr, - Ctx: sdk.NewContext(nil, tmproto.Header{}, false, nil).WithContext(context.Background()), + Ctx: sdk.NewContext(nil, sdk.Header{}, false, nil).WithContext(context.Background()), } client := testdata.NewQueryClient(helper) diff --git a/sei-cosmos/baseapp/test_helpers.go b/sei-cosmos/baseapp/test_helpers.go index 85d6a9ddb7..ccb0262649 100644 --- a/sei-cosmos/baseapp/test_helpers.go +++ b/sei-cosmos/baseapp/test_helpers.go @@ -5,7 +5,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" ) func (app *BaseApp) Check(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { @@ -16,7 +15,7 @@ func (app *BaseApp) Check(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk if err != nil { return sdk.GasInfo{}, nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) } - ctx := app.checkState.ctx.WithTxBytes(bz).WithVoteInfos(app.voteInfos).WithConsensusParams(app.GetConsensusParams(app.checkState.ctx)) + ctx := app.checkState.ctx.WithTxBytes(bz).WithConsensusParams(app.GetConsensusParams(app.checkState.ctx)) gasInfo, result, _, _, _, _, _, _, err := app.runTx(ctx, runTxModeCheck, tx, sha256.Sum256(bz)) return gasInfo, result, err } @@ -27,7 +26,7 @@ func (app *BaseApp) Deliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *s if err != nil { return sdk.GasInfo{}, nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) } - ctx := app.deliverState.ctx.WithTxBytes(bz).WithVoteInfos(app.voteInfos).WithConsensusParams(app.GetConsensusParams(app.deliverState.ctx)) + ctx := app.deliverState.ctx.WithTxBytes(bz).WithConsensusParams(app.GetConsensusParams(app.deliverState.ctx)) decoded, err := app.txDecoder(bz) if err != nil { return sdk.GasInfo{}, &sdk.Result{}, err @@ -37,7 +36,7 @@ func (app *BaseApp) Deliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *s } // Context with current {check, deliver}State of the app used by tests. -func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context { +func (app *BaseApp) NewContext(isCheckTx bool, header sdk.Header) sdk.Context { if isCheckTx { return sdk.NewContext(app.checkState.ms, header, true, app.logger). WithMinGasPrices(app.minGasPrices) @@ -46,7 +45,7 @@ func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Contex return sdk.NewContext(app.deliverState.ms, header, false, app.logger) } -func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context { +func (app *BaseApp) NewUncachedContext(isCheckTx bool, header sdk.Header) sdk.Context { return sdk.NewContext(app.cms, header, isCheckTx, app.logger) } diff --git a/sei-cosmos/go.mod b/sei-cosmos/go.mod index fa3ca62660..dc898763ee 100644 --- a/sei-cosmos/go.mod +++ b/sei-cosmos/go.mod @@ -68,6 +68,8 @@ require ( github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54 // indirect github.com/VictoriaMetrics/fastcache v1.12.2 // indirect github.com/alitto/pond v1.8.3 // indirect + github.com/andybalholm/brotli v1.2.0 // indirect + github.com/apache/arrow-go/v18 v18.4.1 // indirect github.com/benbjohnson/immutable v0.4.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.22.0 // indirect @@ -97,6 +99,15 @@ require ( github.com/dgraph-io/ristretto v0.2.0 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 // indirect + github.com/duckdb/duckdb-go-bindings v0.1.23 // indirect + github.com/duckdb/duckdb-go-bindings/darwin-amd64 v0.1.23 // indirect + github.com/duckdb/duckdb-go-bindings/darwin-arm64 v0.1.23 // indirect + github.com/duckdb/duckdb-go-bindings/linux-amd64 v0.1.23 // indirect + github.com/duckdb/duckdb-go-bindings/linux-arm64 v0.1.23 // indirect + github.com/duckdb/duckdb-go-bindings/windows-amd64 v0.1.23 // indirect + github.com/duckdb/duckdb-go/arrowmapping v0.0.26 // indirect + github.com/duckdb/duckdb-go/mapping v0.0.25 // indirect + github.com/duckdb/duckdb-go/v2 v2.5.3 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/ethereum/c-kzg-4844 v1.0.0 // indirect @@ -112,13 +123,14 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect - github.com/go-viper/mapstructure/v2 v2.3.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/goccy/go-json v0.10.5 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.13.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/snappy v1.0.0 // indirect - github.com/google/flatbuffers v23.5.26+incompatible // indirect + github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect @@ -140,6 +152,7 @@ require ( github.com/jmhodges/levigo v1.0.0 // indirect github.com/keybase/go-keychain v0.0.1 // indirect github.com/klauspost/compress v1.18.3 // indirect + github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 // indirect @@ -147,16 +160,18 @@ require ( github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.11 // indirect github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/parquet-go/parquet-go v0.25.1 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/pion/dtls/v2 v2.2.7 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/stun/v2 v2.0.0 // indirect @@ -179,7 +194,7 @@ require ( github.com/spf13/afero v1.14.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect - github.com/tidwall/gjson v1.10.2 // indirect + github.com/tidwall/gjson v1.14.2 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/tidwall/tinylru v1.1.0 // indirect @@ -190,6 +205,7 @@ require ( github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d // indirect + github.com/zeebo/xxh3 v1.0.2 // indirect github.com/zondax/golem v0.27.0 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v1.0.1 // indirect @@ -202,12 +218,16 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect + golang.org/x/mod v0.32.0 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.40.0 // indirect + golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect golang.org/x/term v0.39.0 // indirect golang.org/x/text v0.33.0 // indirect golang.org/x/time v0.13.0 // indirect + golang.org/x/tools v0.41.0 // indirect + golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/sei-cosmos/go.sum b/sei-cosmos/go.sum index 510a77acc6..07bad714f5 100644 --- a/sei-cosmos/go.sum +++ b/sei-cosmos/go.sum @@ -609,8 +609,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0/go.mod h1: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0/go.mod h1:c+Lifp3EDEamAkPVzMooRNOK6CZjNSdEnf1A7jsI9u4= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= -github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= -github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -674,12 +674,18 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= +github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow-go/v18 v18.4.1 h1:q/jVkBWCJOB9reDgaIZIdruLQUb1kbkvOnOFezVH1C4= +github.com/apache/arrow-go/v18 v18.4.1/go.mod h1:tLyFubsAl17bvFdUAy24bsSvA/6ww95Iqi67fTpGu3E= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/apache/thrift v0.22.0 h1:r7mTJdj51TMDe6RtcmNdQxgn9XcyfGDOzegMDRg47uc= +github.com/apache/thrift v0.22.0/go.mod h1:1e7J/O1Ae6ZQMTYdy9xa3w9k+XHWPfRvdPyJeynQ+/g= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -891,10 +897,10 @@ github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= -github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0/go.mod h1:56wL82FO0bfMU5RvfXoIwSOP2ggqqxT+tAfNEIyxuHw= github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= @@ -902,6 +908,24 @@ github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 h1:+3HCtB74++ClLy8GgjU github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= +github.com/duckdb/duckdb-go-bindings v0.1.23 h1:sJRXraxfC/gdHI2T7oHqrdp1VdKemrgqWGQ8986mH1c= +github.com/duckdb/duckdb-go-bindings v0.1.23/go.mod h1:WA7U/o+b37MK2kiOPPueVZ+FIxt5AZFCjszi8hHeH18= +github.com/duckdb/duckdb-go-bindings/darwin-amd64 v0.1.23 h1:Xyw1fWu4jzOtv2Hqkaehr7f+qbIWNRfBMbZyD+g8dyU= +github.com/duckdb/duckdb-go-bindings/darwin-amd64 v0.1.23/go.mod h1:jfbOHwGZqNCpMAxV4g4g5jmWr0gKdMvh2fGusPubxC4= +github.com/duckdb/duckdb-go-bindings/darwin-arm64 v0.1.23 h1:85Xomx5NxZ+Nt+VepUJzuMYbBTH+nB6JlBXIyJuTovA= +github.com/duckdb/duckdb-go-bindings/darwin-arm64 v0.1.23/go.mod h1:zLVtv1a7TBuTPvuAi32AIbnuw7jjaX5JElZ+urv1ydc= +github.com/duckdb/duckdb-go-bindings/linux-amd64 v0.1.23 h1:RGw8mDqQl9JdlCYV0PAfGBuVAgOguiL5Vz5W8pH8fGw= +github.com/duckdb/duckdb-go-bindings/linux-amd64 v0.1.23/go.mod h1:GCaBoYnuLZEva7BXzdXehTbqh9VSvpLB80xcmxGBGs8= +github.com/duckdb/duckdb-go-bindings/linux-arm64 v0.1.23 h1:f8NHa8DGes7vg55BxeMVm0ycddEJTRHEt813USdL0/I= +github.com/duckdb/duckdb-go-bindings/linux-arm64 v0.1.23/go.mod h1:kpQSpJmDSSZQ3ikbZR1/8UqecqMeUkWFjFX2xZxlCuI= +github.com/duckdb/duckdb-go-bindings/windows-amd64 v0.1.23 h1:HJqVo+09gT6LQWW6PlN/c7K8s0eQhv5giE7kJcMGMSU= +github.com/duckdb/duckdb-go-bindings/windows-amd64 v0.1.23/go.mod h1:wa+egSGXTPS16NPADFCK1yFyt3VSXxUS6Pt2fLnvRPM= +github.com/duckdb/duckdb-go/arrowmapping v0.0.26 h1:XKhWpNkLtIbcBE2vnKm7FaAju3daplxo8MJIXOAY/Zg= +github.com/duckdb/duckdb-go/arrowmapping v0.0.26/go.mod h1:R7egXxZcy0hxKY/MsoM2xjkMvRo4H07TffDhYCnhKfQ= +github.com/duckdb/duckdb-go/mapping v0.0.25 h1:z4RhivKCIRv0MWQwtYekqH+ikoA29/n8L+rzgreKvsc= +github.com/duckdb/duckdb-go/mapping v0.0.25/go.mod h1:CIo3WbNx3Txl+VO9+P5eNCN9ZifUA/KIp9NY1rTG/uo= +github.com/duckdb/duckdb-go/v2 v2.5.3 h1:GlT+bXW+/gCYo0Q8P9L6IvvKRzMM0/tDXj5fKkoAfCM= +github.com/duckdb/duckdb-go/v2 v2.5.3/go.mod h1:+mGhZCF5tHYIdBWrp7+KGj6JnTXdm+sBTh3ZSLhXorE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -1027,8 +1051,8 @@ github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -1040,6 +1064,8 @@ github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -1118,8 +1144,8 @@ github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= -github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= +github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -1271,6 +1297,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -1351,6 +1379,7 @@ github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhd github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -1363,6 +1392,8 @@ github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+ github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -1436,8 +1467,9 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1445,7 +1477,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 h1:0lgqHvJWHLGW5TuObJrfyEi6+ASTKDBWikGvPqy9Yiw= @@ -1552,8 +1586,8 @@ github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfad github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= -github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.1.14 h1:rgSuzbmgz5DUJjeSnw337TxDbRuqjs6iqQck/2weR6w= github.com/opencontainers/runc v1.1.14/go.mod h1:E4C2z+7BxR7GHXp0hAY53mek+x49X1LjPNeMTfRGvOA= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= @@ -1567,6 +1601,8 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/parquet-go/parquet-go v0.25.1 h1:l7jJwNM0xrk0cnIIptWMtnSnuxRkwq53S+Po3KG8Xgo= +github.com/parquet-go/parquet-go v0.25.1/go.mod h1:AXBuotO1XiBtcqJb/FKFyjBG4aqa3aQAAWF3ZPzCanY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1589,6 +1625,8 @@ github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= +github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8= @@ -1831,8 +1869,9 @@ github.com/tendermint/tm-db v0.6.8-0.20220519162814-e24b96538a12/go.mod h1:PWsIW github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= -github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.2 h1:6BBkirS0rAHjumnjHF6qgy5d2YAJ1TLIaFE2lzfOLqo= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= @@ -1888,6 +1927,8 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= +github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= @@ -1906,7 +1947,9 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d h1:XQyeLr7N9iY9mi+TGgsBFkj54+j3fdoo8e2u6zrGP5A= github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d/go.mod h1:hoMeDjlNXTNqVwrCk8YDyaBS2g5vFfEX2ezMi4vb6CY= +github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zondax/golem v0.27.0 h1:IbBjGIXF3SoGOZHsILJvIM/F/ylwJzMcHAcggiqniPw= github.com/zondax/golem v0.27.0/go.mod h1:AmorCgJPt00L8xN1VrMBe13PSifoZksnQ1Ge906bu4A= @@ -2084,6 +2127,8 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2368,6 +2413,8 @@ golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2510,6 +2557,8 @@ golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8 golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2518,10 +2567,14 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= +golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= diff --git a/sei-cosmos/store/rootmulti/rollback_test.go b/sei-cosmos/store/rootmulti/rollback_test.go index 43f24a51a1..b48e186f07 100644 --- a/sei-cosmos/store/rootmulti/rollback_test.go +++ b/sei-cosmos/store/rootmulti/rollback_test.go @@ -10,7 +10,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/legacyabci" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" ) @@ -55,7 +54,7 @@ func TestRollback(t *testing.T) { ver0 := a.LastBlockHeight() // commit 10 blocks for i := int64(1); i <= 10; i++ { - header := tmproto.Header{ + header := sdk.Header{ Height: ver0 + i, AppHash: a.LastCommitID().Hash, } @@ -67,7 +66,7 @@ func TestRollback(t *testing.T) { } require.Equal(t, ver0+10, a.LastBlockHeight()) - store := a.NewContext(true, tmproto.Header{}).KVStore(a.GetKey("bank")) + store := a.NewContext(true, sdk.Header{}).KVStore(a.GetKey("bank")) require.Equal(t, []byte("value10"), store.Get([]byte("key"))) // rollback 5 blocks @@ -77,12 +76,12 @@ func TestRollback(t *testing.T) { // recreate app to have clean check state a = SetupWithDB(t, false, db) - store = a.NewContext(true, tmproto.Header{}).KVStore(a.GetKey("bank")) + store = a.NewContext(true, sdk.Header{}).KVStore(a.GetKey("bank")) require.Equal(t, []byte("value5"), store.Get([]byte("key"))) // commit another 5 blocks with different values for i := int64(6); i <= 10; i++ { - header := tmproto.Header{ + header := sdk.Header{ Height: ver0 + i, AppHash: a.LastCommitID().Hash, } @@ -94,6 +93,6 @@ func TestRollback(t *testing.T) { } require.Equal(t, ver0+10, a.LastBlockHeight()) - store = a.NewContext(true, tmproto.Header{}).KVStore(a.GetKey("bank")) + store = a.NewContext(true, sdk.Header{}).KVStore(a.GetKey("bank")) require.Equal(t, []byte("VALUE10"), store.Get([]byte("key"))) } diff --git a/sei-cosmos/testutil/context.go b/sei-cosmos/testutil/context.go index 379bad05d4..fd90bc2297 100644 --- a/sei-cosmos/testutil/context.go +++ b/sei-cosmos/testutil/context.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/store" @@ -19,7 +18,7 @@ func DefaultContext(key sdk.StoreKey, tkey sdk.StoreKey) sdk.Context { if err != nil { panic(err) } - ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cms, sdk.Header{}, false, log.NewNopLogger()) return ctx } diff --git a/sei-cosmos/types/context.go b/sei-cosmos/types/context.go index 907d16eb50..ae4f5bf1a7 100644 --- a/sei-cosmos/types/context.go +++ b/sei-cosmos/types/context.go @@ -28,13 +28,12 @@ type Context struct { ms MultiStore nextMs MultiStore // ms of the next height; only used in tracing nextStoreKeys map[string]struct{} // store key names that should use nextMs - header tmproto.Header + header Header headerHash tmbytes.HexBytes chainID string txBytes []byte txSum [32]byte logger log.Logger - voteInfo []abci.VoteInfo gasMeter GasMeter gasEstimate uint64 occEnabled bool @@ -116,10 +115,6 @@ func (c Context) Logger() log.Logger { return c.logger } -func (c Context) VoteInfos() []abci.VoteInfo { - return c.voteInfo -} - func (c Context) GasMeter() GasMeter { return c.gasMeter } @@ -208,10 +203,9 @@ func (c Context) TxIndex() int { return c.txIndex } -// clone the header before returning -func (c Context) BlockHeader() tmproto.Header { - msg := proto.Clone(&c.header).(*tmproto.Header) - return *msg +// BlockHeader returns a cloned copy of the current block header to prevent mutation. +func (c Context) BlockHeader() Header { + return c.header.Clone() } func (c Context) TraceSpanContext() context.Context { @@ -254,13 +248,12 @@ func (c Context) ConsensusParams() *tmproto.ConsensusParams { } // create a new context -func NewContext(ms MultiStore, header tmproto.Header, isCheckTx bool, logger log.Logger) Context { - // https://github.com/gogo/protobuf/issues/519 +func NewContext(ms MultiStore, header Header, isCheckTx bool, logger log.Logger) Context { header.Time = header.Time.UTC() return Context{ ctx: context.Background(), ms: ms, - header: header, + header: header.Clone(), chainID: header.ChainID, checkTx: isCheckTx, logger: logger, @@ -283,11 +276,10 @@ func (c Context) WithMultiStore(ms MultiStore) Context { return c } -// WithBlockHeader returns a Context with an updated tendermint block header in UTC time. -func (c Context) WithBlockHeader(header tmproto.Header) Context { - // https://github.com/gogo/protobuf/issues/519 +// WithBlockHeader returns a Context with an updated block header in UTC time. +func (c Context) WithBlockHeader(header Header) Context { header.Time = header.Time.UTC() - c.header = header + c.header = header.Clone() return c } @@ -345,12 +337,6 @@ func (c Context) WithLogger(logger log.Logger) Context { return c } -// WithVoteInfos returns a Context with an updated consensus VoteInfo. -func (c Context) WithVoteInfos(voteInfo []abci.VoteInfo) Context { - c.voteInfo = voteInfo - return c -} - // WithGasMeter returns a Context with an updated transaction GasMeter. func (c Context) WithGasMeter(meter GasMeter) Context { c.gasMeter = meter diff --git a/sei-cosmos/types/context_test.go b/sei-cosmos/types/context_test.go index 4a22bcf195..1f43f7d5f4 100644 --- a/sei-cosmos/types/context_test.go +++ b/sei-cosmos/types/context_test.go @@ -7,7 +7,6 @@ import ( "time" "github.com/golang/mock/gomock" - abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -72,7 +71,7 @@ func (s *contextTestSuite) TestLogContext() { type dummy int64 //nolint:unused -func (d dummy) Clone() interface{} { +func (d dummy) Clone() any { return d } @@ -84,14 +83,13 @@ func (s *contextTestSuite) TestContextWithCustom() { ctrl := gomock.NewController(s.T()) s.T().Cleanup(ctrl.Finish) - header := tmproto.Header{} + header := types.Header{} height := int64(1) chainid := "chainid" ischeck := true isOCC := true txbytes := []byte("txbytes") logger := mocks.NewMockLogger(ctrl) - voteinfos := []abci.VoteInfo{{}} meter := types.NewGasMeterWithMultiplier(ctx, 10000) minGasPrices := types.DecCoins{types.NewInt64DecCoin("feetoken", 1)} headerHash := []byte("headerHash") @@ -103,7 +101,6 @@ func (s *contextTestSuite) TestContextWithCustom() { WithBlockHeight(height). WithChainID(chainid). WithTxBytes(txbytes). - WithVoteInfos(voteinfos). WithGasMeter(meter). WithMinGasPrices(minGasPrices). WithHeaderHash(headerHash). @@ -115,7 +112,6 @@ func (s *contextTestSuite) TestContextWithCustom() { s.Require().Equal(isOCC, ctx.IsOCCEnabled()) s.Require().Equal(txbytes, ctx.TxBytes()) s.Require().Equal(logger, ctx.Logger()) - s.Require().Equal(voteinfos, ctx.VoteInfos()) s.Require().Equal(meter, ctx.GasMeter()) s.Require().Equal(minGasPrices, ctx.MinGasPrices()) s.Require().Equal(headerHash, ctx.HeaderHash().Bytes()) @@ -147,7 +143,7 @@ func (s *contextTestSuite) TestContextHeader() { addr := secp256k1.GenPrivKey().PubKey().Address() proposer := types.ConsAddress(addr) - ctx = types.NewContext(nil, tmproto.Header{}, false, nil) + ctx = types.NewContext(nil, types.Header{}, false, nil) fmt.Printf("Start ctx\n") @@ -164,35 +160,35 @@ func (s *contextTestSuite) TestContextHeader() { func (s *contextTestSuite) TestContextHeaderClone() { cases := map[string]struct { - h tmproto.Header + h types.Header }{ "empty": { - h: tmproto.Header{}, + h: types.Header{}, }, "height": { - h: tmproto.Header{ + h: types.Header{ Height: 77, }, }, "time": { - h: tmproto.Header{ + h: types.Header{ Time: time.Unix(12345677, 12345), }, }, "zero time": { - h: tmproto.Header{ + h: types.Header{ Time: time.Unix(0, 0), }, }, "many items": { - h: tmproto.Header{ + h: types.Header{ Height: 823, Time: time.Unix(9999999999, 0), ChainID: "silly-demo", }, }, "many items with hash": { - h: tmproto.Header{ + h: types.Header{ Height: 823, Time: time.Unix(9999999999, 0), ChainID: "silly-demo", @@ -203,7 +199,6 @@ func (s *contextTestSuite) TestContextHeaderClone() { } for name, tc := range cases { - tc := tc s.T().Run(name, func(t *testing.T) { ctx := types.NewContext(nil, tc.h, false, nil) s.Require().Equal(tc.h.Height, ctx.BlockHeight()) @@ -219,7 +214,7 @@ func (s *contextTestSuite) TestContextHeaderClone() { } func (s *contextTestSuite) TestUnwrapSDKContext() { - sdkCtx := types.NewContext(nil, tmproto.Header{}, false, nil) + sdkCtx := types.NewContext(nil, types.Header{}, false, nil) ctx := types.WrapSDKContext(sdkCtx) sdkCtx2 := types.UnwrapSDKContext(ctx) s.Require().Equal(sdkCtx, sdkCtx2) diff --git a/sei-cosmos/types/header.go b/sei-cosmos/types/header.go new file mode 100644 index 0000000000..3de8dc36dc --- /dev/null +++ b/sei-cosmos/types/header.go @@ -0,0 +1,135 @@ +package types + +import ( + "slices" + "time" + + tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + version "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/version" +) + +// ConsensusVersion duplicates tendermint's version.Consensus without proto baggage. +type ConsensusVersion struct { + Block uint64 + App uint64 +} + +// PartSetHeader duplicates tendermint's PartSetHeader. +type PartSetHeader struct { + Total uint32 + Hash []byte +} + +// BlockID duplicates tendermint's BlockID. +type BlockID struct { + Hash []byte + PartSetHeader PartSetHeader +} + +// Header duplicates tendermint's Header for SDK context usage. +type Header struct { + Version ConsensusVersion + ChainID string + Height int64 + Time time.Time + LastBlockId BlockID + LastCommitHash []byte + DataHash []byte + ValidatorsHash []byte + NextValidatorsHash []byte + ConsensusHash []byte + AppHash []byte + LastResultsHash []byte + EvidenceHash []byte + ProposerAddress []byte +} + +// Clone returns a deep copy of the header so callers cannot mutate shared state. +func (h Header) Clone() Header { + clone := h + clone.Version = h.Version + clone.Time = h.Time + clone.LastBlockId = h.LastBlockId.Clone() + clone.LastCommitHash = slices.Clone(h.LastCommitHash) + clone.DataHash = slices.Clone(h.DataHash) + clone.ValidatorsHash = slices.Clone(h.ValidatorsHash) + clone.NextValidatorsHash = slices.Clone(h.NextValidatorsHash) + clone.ConsensusHash = slices.Clone(h.ConsensusHash) + clone.AppHash = slices.Clone(h.AppHash) + clone.LastResultsHash = slices.Clone(h.LastResultsHash) + clone.EvidenceHash = slices.Clone(h.EvidenceHash) + clone.ProposerAddress = slices.Clone(h.ProposerAddress) + return clone +} + +// Clone returns a deep copy of the block ID. +func (b BlockID) Clone() BlockID { + clone := b + clone.Hash = slices.Clone(b.Hash) + clone.PartSetHeader = b.PartSetHeader.Clone() + return clone +} + +// Clone returns a deep copy of the part set header. +func (p PartSetHeader) Clone() PartSetHeader { + clone := p + clone.Hash = slices.Clone(p.Hash) + return clone +} + +// HeaderFromProto converts a Tendermint proto header into the SDK Header. +func HeaderFromProto(h tmproto.Header) Header { + return Header{ + Version: ConsensusVersion{Block: h.Version.Block, App: h.Version.App}, + ChainID: h.ChainID, + Height: h.Height, + Time: h.Time, + LastBlockId: BlockIDFromProto(h.LastBlockId), + LastCommitHash: slices.Clone(h.LastCommitHash), + DataHash: slices.Clone(h.DataHash), + ValidatorsHash: slices.Clone(h.ValidatorsHash), + NextValidatorsHash: slices.Clone(h.NextValidatorsHash), + ConsensusHash: slices.Clone(h.ConsensusHash), + AppHash: slices.Clone(h.AppHash), + LastResultsHash: slices.Clone(h.LastResultsHash), + EvidenceHash: slices.Clone(h.EvidenceHash), + ProposerAddress: slices.Clone(h.ProposerAddress), + } +} + +// BlockIDFromProto converts the proto block ID into the SDK BlockID. +func BlockIDFromProto(b tmproto.BlockID) BlockID { + return BlockID{ + Hash: slices.Clone(b.Hash), + PartSetHeader: PartSetHeader{ + Total: b.PartSetHeader.Total, + Hash: slices.Clone(b.PartSetHeader.Hash), + }, + } +} + +// ToProto converts the SDK Header back to the proto representation for Tendermint. +func (h Header) ToProto() tmproto.Header { + return tmproto.Header{ + Version: version.Consensus{Block: h.Version.Block, App: h.Version.App}, + ChainID: h.ChainID, + Height: h.Height, + Time: h.Time, + LastBlockId: tmproto.BlockID{ + Hash: slices.Clone(h.LastBlockId.Hash), + PartSetHeader: tmproto.PartSetHeader{ + Total: h.LastBlockId.PartSetHeader.Total, + Hash: slices.Clone(h.LastBlockId.PartSetHeader.Hash), + }, + }, + LastCommitHash: slices.Clone(h.LastCommitHash), + DataHash: slices.Clone(h.DataHash), + ValidatorsHash: slices.Clone(h.ValidatorsHash), + NextValidatorsHash: slices.Clone(h.NextValidatorsHash), + ConsensusHash: slices.Clone(h.ConsensusHash), + AppHash: slices.Clone(h.AppHash), + LastResultsHash: slices.Clone(h.LastResultsHash), + EvidenceHash: slices.Clone(h.EvidenceHash), + ProposerAddress: slices.Clone(h.ProposerAddress), + } +} diff --git a/sei-cosmos/types/module/module_test.go b/sei-cosmos/types/module/module_test.go index 1e2bff8006..c14a6bb2be 100644 --- a/sei-cosmos/types/module/module_test.go +++ b/sei-cosmos/types/module/module_test.go @@ -5,8 +5,6 @@ import ( "errors" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec/types" "github.com/golang/mock/gomock" @@ -256,5 +254,5 @@ func TestManager_MidBlock(t *testing.T) { mockAppModule1.EXPECT().MidBlock(gomock.Any(), gomock.Eq(height)).Times(1) mockAppModule2.EXPECT().MidBlock(gomock.Any(), gomock.Eq(height)).Times(1) - mm.MidBlock(sdk.NewContext(nil, tmproto.Header{}, false, nil), height) + mm.MidBlock(sdk.NewContext(nil, sdk.Header{}, false, nil), height) } diff --git a/sei-cosmos/types/query/pagination_test.go b/sei-cosmos/types/query/pagination_test.go index 0e254007e7..db4ccfd09b 100644 --- a/sei-cosmos/types/query/pagination_test.go +++ b/sei-cosmos/types/query/pagination_test.go @@ -7,7 +7,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" dbm "github.com/tendermint/tm-db" @@ -293,7 +292,7 @@ func (s *paginationTestSuite) TestReversePagination() { func setupTest(t *testing.T) (*app.App, sdk.Context, codec.Codec) { a := app.Setup(t, false, false, false) - ctx := a.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + ctx := a.BaseApp.NewContext(false, sdk.Header{Height: 1}) appCodec := a.AppCodec() db := dbm.NewMemDB() diff --git a/sei-cosmos/types/result_test.go b/sei-cosmos/types/result_test.go index 439f30865b..a436592f6c 100644 --- a/sei-cosmos/types/result_test.go +++ b/sei-cosmos/types/result_test.go @@ -3,7 +3,6 @@ package types_test import ( "encoding/hex" "fmt" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "strings" "testing" @@ -220,7 +219,7 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { } func TestWrapServiceResult(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) res, err := sdk.WrapServiceResult(ctx, nil, fmt.Errorf("test")) require.Nil(t, res) diff --git a/sei-cosmos/x/auth/ante/testutil_test.go b/sei-cosmos/x/auth/ante/testutil_test.go index b2a749c79c..80f4ca0050 100644 --- a/sei-cosmos/x/auth/ante/testutil_test.go +++ b/sei-cosmos/x/auth/ante/testutil_test.go @@ -7,7 +7,6 @@ import ( minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -42,7 +41,7 @@ type AnteTestSuite struct { // returns context and app with params set on account keeper func createTestApp(t *testing.T, isCheckTx bool) (*app.App, sdk.Context) { app := app.Setup(t, isCheckTx, false, false) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, sdk.Header{}) app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) return app, ctx diff --git a/sei-cosmos/x/auth/keeper/integration_test.go b/sei-cosmos/x/auth/keeper/integration_test.go index 257709da3d..b6ecbdcebc 100644 --- a/sei-cosmos/x/auth/keeper/integration_test.go +++ b/sei-cosmos/x/auth/keeper/integration_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -11,7 +10,7 @@ import ( // returns context and app with params set on account keeper func createTestApp(isCheckTx bool) (*app.App, sdk.Context) { app := app.SetupWithDefaultHome(isCheckTx, false, false) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, sdk.Header{}) app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) return app, ctx diff --git a/sei-cosmos/x/auth/legacy/legacytx/stdtx_test.go b/sei-cosmos/x/auth/legacy/legacytx/stdtx_test.go index 6d3871612a..d2c1e2e09d 100644 --- a/sei-cosmos/x/auth/legacy/legacytx/stdtx_test.go +++ b/sei-cosmos/x/auth/legacy/legacytx/stdtx_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -102,7 +101,7 @@ func TestStdSignBytes(t *testing.T) { } func TestTxValidateBasic(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{ChainID: "mychainid"}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, sdk.Header{ChainID: "mychainid"}, false, log.NewNopLogger()) // keys and addresses priv1, _, addr1 := testdata.KeyTestPubAddr() diff --git a/sei-cosmos/x/auth/module_test.go b/sei-cosmos/x/auth/module_test.go index 3ba609b400..8d7444fc87 100644 --- a/sei-cosmos/x/auth/module_test.go +++ b/sei-cosmos/x/auth/module_test.go @@ -6,15 +6,15 @@ import ( "github.com/sei-protocol/sei-chain/app" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app := app.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.InitChain( context.Background(), &abcitypes.RequestInitChain{ diff --git a/sei-cosmos/x/auth/signing/verify_test.go b/sei-cosmos/x/auth/signing/verify_test.go index c42ca5e9f8..e29ad71553 100644 --- a/sei-cosmos/x/auth/signing/verify_test.go +++ b/sei-cosmos/x/auth/signing/verify_test.go @@ -5,7 +5,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -99,7 +98,7 @@ func TestVerifySignature(t *testing.T) { // returns context and app with params set on account keeper func createTestApp(t *testing.T, isCheckTx bool) (*app.App, sdk.Context) { app := app.Setup(t, isCheckTx, false, false) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, sdk.Header{}) app.AccountKeeper.SetParams(ctx, types.DefaultParams()) return app, ctx diff --git a/sei-cosmos/x/auth/vesting/handler_test.go b/sei-cosmos/x/auth/vesting/handler_test.go index c55543a37c..ff374a2561 100644 --- a/sei-cosmos/x/auth/vesting/handler_test.go +++ b/sei-cosmos/x/auth/vesting/handler_test.go @@ -5,7 +5,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -29,7 +28,7 @@ func (suite *HandlerTestSuite) SetupTest() { } func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() { - ctx := suite.app.BaseApp.NewContext(false, tmproto.Header{Height: suite.app.LastBlockHeight() + 1}) + ctx := suite.app.BaseApp.NewContext(false, sdk.Header{Height: suite.app.LastBlockHeight() + 1}) balances := sdk.NewCoins(sdk.NewInt64Coin("test", 1000)) addr1 := sdk.AccAddress([]byte("addr1_______________")) diff --git a/sei-cosmos/x/authz/keeper/genesis_test.go b/sei-cosmos/x/authz/keeper/genesis_test.go index 460a00d34d..59a521fefc 100644 --- a/sei-cosmos/x/authz/keeper/genesis_test.go +++ b/sei-cosmos/x/authz/keeper/genesis_test.go @@ -5,7 +5,6 @@ import ( "time" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -25,7 +24,7 @@ func (suite *GenesisTestSuite) SetupTest() { checkTx := false app := app.Setup(suite.T(), checkTx, false, false) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = app.AuthzKeeper } diff --git a/sei-cosmos/x/authz/keeper/keeper_test.go b/sei-cosmos/x/authz/keeper/keeper_test.go index 81a1d698b7..4021e93f0e 100644 --- a/sei-cosmos/x/authz/keeper/keeper_test.go +++ b/sei-cosmos/x/authz/keeper/keeper_test.go @@ -7,7 +7,6 @@ import ( tmtime "github.com/cosmos/cosmos-sdk/std" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -29,9 +28,9 @@ type TestSuite struct { func (s *TestSuite) SetupTest() { a := app.Setup(s.T(), false, false, false) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, a.InterfaceRegistry()) authz.RegisterQueryServer(queryHelper, a.AuthzKeeper) queryClient := authz.NewQueryClient(queryHelper) diff --git a/sei-cosmos/x/bank/app_test.go b/sei-cosmos/x/bank/app_test.go index 61d5fd872c..b093f2f067 100644 --- a/sei-cosmos/x/bank/app_test.go +++ b/sei-cosmos/x/bank/app_test.go @@ -7,7 +7,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -87,7 +86,7 @@ func TestSendNotEnoughBalance(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) require.NoError(t, apptesting.FundAccount(a.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) @@ -101,14 +100,14 @@ func TestSendNotEnoughBalance(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 100)}) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, false, false, priv1) require.Error(t, err) app.CheckBalance(t, a, addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 67)}) - res2 := a.AccountKeeper.GetAccount(a.NewContext(true, tmproto.Header{}), addr1) + res2 := a.AccountKeeper.GetAccount(a.NewContext(true, sdk.Header{}), addr1) require.NotNil(t, res2) require.Equal(t, res2.GetAccountNumber(), origAccNum) @@ -122,7 +121,7 @@ func TestSendReceiverNotInAllowList(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) testDenom := "testDenom" factoryDenom := fmt.Sprintf("factory/%s/%s", addr1.String(), testDenom) @@ -140,7 +139,7 @@ func TestSendReceiverNotInAllowList(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin(factoryDenom, 10)}) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, false, false, priv1) require.Error(t, err) @@ -156,7 +155,7 @@ func TestSendSenderAndReceiverInAllowList(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) testDenom := "testDenom" factoryDenom := fmt.Sprintf("factory/%s/%s", addr1.String(), testDenom) @@ -174,7 +173,7 @@ func TestSendSenderAndReceiverInAllowList(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin(factoryDenom, 10)}) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, true, true, priv1) require.NoError(t, err) @@ -190,7 +189,7 @@ func TestSendWithEmptyAllowList(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) testDenom := "testDenom" factoryDenom := fmt.Sprintf("factory/%s/%s", addr1.String(), testDenom) @@ -208,7 +207,7 @@ func TestSendWithEmptyAllowList(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin(factoryDenom, 10)}) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, true, true, priv1) require.NoError(t, err) @@ -224,7 +223,7 @@ func TestSendSenderNotInAllowList(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) testDenom := "testDenom" factoryDenom := fmt.Sprintf("factory/%s/%s", addr1.String(), testDenom) @@ -242,7 +241,7 @@ func TestSendSenderNotInAllowList(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin(factoryDenom, 10)}) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, false, false, priv1) require.Error(t, err) @@ -258,7 +257,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) require.NoError(t, apptesting.FundAccount(a.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) @@ -294,7 +293,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) if tc.expPass { @@ -319,7 +318,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1, acc2} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) require.NoError(t, apptesting.FundAccount(a.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) @@ -344,7 +343,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -368,7 +367,7 @@ func TestMsgMultiSendMultipleInOut(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1, acc2, acc4} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) require.NoError(t, apptesting.FundAccount(a.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) @@ -396,7 +395,7 @@ func TestMsgMultiSendMultipleInOut(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -415,7 +414,7 @@ func TestMsgMultiSendDependent(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1, acc2} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) require.NoError(t, apptesting.FundAccount(a.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) @@ -448,7 +447,7 @@ func TestMsgMultiSendDependent(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -653,7 +652,7 @@ func TestMultiSendAllowList(t *testing.T) { genAccs := []authtypes.GenesisAccount{sender, receiver} a := app.SetupWithGenesisAccounts(t, genAccs) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) msgs := make([]sdk.Msg, 0) @@ -673,7 +672,7 @@ func TestMultiSendAllowList(t *testing.T) { a.Commit(context.Background()) - header := tmproto.Header{Height: a.LastBlockHeight() + 1} + header := sdk.Header{Height: a.LastBlockHeight() + 1} txGen := app.MakeEncodingConfig().TxConfig _, _, err := app.SignCheckDeliver(t, txGen, a.BaseApp, header, msgs, "", tc.accNums, tc.accSeqs, !tc.expectedError, !tc.expectedError, tc.privKeys...) diff --git a/sei-cosmos/x/bank/handler_test.go b/sei-cosmos/x/bank/handler_test.go index 93cf29cc10..b725843be3 100644 --- a/sei-cosmos/x/bank/handler_test.go +++ b/sei-cosmos/x/bank/handler_test.go @@ -4,7 +4,6 @@ import ( "strings" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -22,7 +21,7 @@ import ( func TestInvalidMsg(t *testing.T) { h := bank.NewHandler(nil) - res, err := h(sdk.NewContext(nil, tmproto.Header{}, false, nil), testdata.NewTestMsg()) + res, err := h(sdk.NewContext(nil, sdk.Header{}, false, nil), testdata.NewTestMsg()) require.Error(t, err) require.Nil(t, res) @@ -66,7 +65,7 @@ func TestSendToModuleAccount(t *testing.T) { } app := seiapp.SetupWithGenesisAccounts(t, accs, balances...) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.BankKeeper = bankkeeper.NewBaseKeeper( app.AppCodec(), app.GetKey(types.StoreKey), app.AccountKeeper, app.GetSubspace(types.ModuleName), map[string]bool{ diff --git a/sei-cosmos/x/bank/keeper/keeper_test.go b/sei-cosmos/x/bank/keeper/keeper_test.go index 1ae2f4ff50..8957f202b4 100644 --- a/sei-cosmos/x/bank/keeper/keeper_test.go +++ b/sei-cosmos/x/bank/keeper/keeper_test.go @@ -18,7 +18,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/suite" ) @@ -101,7 +100,7 @@ func (suite *IntegrationTestSuite) initKeepersWithmAccPerms(blockedAddrs map[str func (suite *IntegrationTestSuite) SetupTest() { sdk.RegisterDenom(sdk.DefaultBondDenom, sdk.OneDec()) a := app.Setup(suite.T(), false, false, false) - ctx := a.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := a.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) a.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) a.BankKeeper.SetParams(ctx, types.DefaultParams()) @@ -853,7 +852,7 @@ func (suite *IntegrationTestSuite) TestWriteDeferredOperations() { func (suite *IntegrationTestSuite) TestValidateBalance() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) addr1 := sdk.AccAddress([]byte("addr1_______________")) @@ -1170,7 +1169,7 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() { func (suite *IntegrationTestSuite) TestSpendableCoins() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -1201,7 +1200,7 @@ func (suite *IntegrationTestSuite) TestSpendableCoins() { func (suite *IntegrationTestSuite) TestVestingAccountSend() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -1230,7 +1229,7 @@ func (suite *IntegrationTestSuite) TestVestingAccountSend() { func (suite *IntegrationTestSuite) TestPeriodicVestingAccountSend() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 50)) @@ -1263,7 +1262,7 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountSend() { func (suite *IntegrationTestSuite) TestVestingAccountReceive() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -1297,7 +1296,7 @@ func (suite *IntegrationTestSuite) TestVestingAccountReceive() { func (suite *IntegrationTestSuite) TestPeriodicVestingAccountReceive() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 50)) @@ -1336,7 +1335,7 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountReceive() { func (suite *IntegrationTestSuite) TestDelegateCoins() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) @@ -1378,7 +1377,7 @@ func (suite *IntegrationTestSuite) TestDelegateCoins() { func (suite *IntegrationTestSuite) TestDelegateCoinsFromAccountToModule() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) delCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 50)) @@ -1430,7 +1429,7 @@ func (suite *IntegrationTestSuite) TestDelegateCoins_Invalid() { func (suite *IntegrationTestSuite) TestUndelegateCoins() { app, ctx := suite.app, suite.ctx now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("usei", 100)) diff --git a/sei-cosmos/x/bank/types/send_authorization_test.go b/sei-cosmos/x/bank/types/send_authorization_test.go index 06bf523018..af3f88951f 100644 --- a/sei-cosmos/x/bank/types/send_authorization_test.go +++ b/sei-cosmos/x/bank/types/send_authorization_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,7 @@ var ( func TestSendAuthorization(t *testing.T) { a := app.Setup(t, false, false, false) - ctx := a.BaseApp.NewContext(false, tmproto.Header{}) + ctx := a.BaseApp.NewContext(false, sdk.Header{}) authorization := types.NewSendAuthorization(coins1000) t.Log("verify authorization returns valid method name") diff --git a/sei-cosmos/x/capability/capability_test.go b/sei-cosmos/x/capability/capability_test.go index 362a77c595..8843e76dee 100644 --- a/sei-cosmos/x/capability/capability_test.go +++ b/sei-cosmos/x/capability/capability_test.go @@ -3,7 +3,6 @@ package capability_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/codec" @@ -35,7 +34,7 @@ func (suite *CapabilityTestSuite) SetupTest() { keeper := keeper.NewKeeper(cdc, app.GetKey(types.StoreKey), app.GetMemKey(types.MemStoreKey)) suite.app = app - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = keeper suite.cdc = cdc suite.module = capability.NewAppModule(cdc, *keeper) @@ -53,12 +52,12 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { suite.Require().NotNil(cap1) // Mock App startup - ctx := suite.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + ctx := suite.app.BaseApp.NewUncachedContext(false, sdk.Header{}) newKeeper.Seal() suite.Require().False(newKeeper.IsInitialized(ctx), "memstore initialized flag set before BeginBlock") // Mock app beginblock and ensure that no gas has been consumed and memstore is initialized - ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx = suite.app.BaseApp.NewContext(false, sdk.Header{}) capability.BeginBlocker(ctx, *newKeeper) suite.Require().True(newKeeper.IsInitialized(ctx), "memstore initialized flag not set") @@ -69,7 +68,7 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { suite.Require().True(ok) // Ensure that the second transaction can still receive capability even if first tx fails. - ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx = suite.app.BaseApp.NewContext(false, sdk.Header{}) cap1, ok = newSk1.GetCapability(ctx, "transfer") suite.Require().True(ok) diff --git a/sei-cosmos/x/capability/genesis_test.go b/sei-cosmos/x/capability/genesis_test.go index 52ceeff5b7..5c899f3dd7 100644 --- a/sei-cosmos/x/capability/genesis_test.go +++ b/sei-cosmos/x/capability/genesis_test.go @@ -1,7 +1,7 @@ package capability_test import ( - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" dbm "github.com/tendermint/tm-db" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -37,7 +37,7 @@ func (suite *CapabilityTestSuite) TestGenesis() { newKeeper := keeper.NewKeeper(suite.cdc, newApp.GetKey(types.StoreKey), newApp.GetMemKey(types.MemStoreKey)) newSk1 := newKeeper.ScopeToModule(banktypes.ModuleName) newSk2 := newKeeper.ScopeToModule(stakingtypes.ModuleName) - deliverCtx, _ := newApp.BaseApp.NewUncachedContext(false, tmproto.Header{}).CacheContext() + deliverCtx, _ := newApp.BaseApp.NewUncachedContext(false, sdk.Header{}).CacheContext() capability.InitGenesis(deliverCtx, *newKeeper, *genState) diff --git a/sei-cosmos/x/capability/keeper/keeper_test.go b/sei-cosmos/x/capability/keeper/keeper_test.go index 5b10f1a83c..eab2a3d24d 100644 --- a/sei-cosmos/x/capability/keeper/keeper_test.go +++ b/sei-cosmos/x/capability/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "testing" seiapp "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,7 +31,7 @@ func (suite *KeeperTestSuite) SetupTest() { keeper := keeper.NewKeeper(cdc, app.GetKey(types.StoreKey), app.GetMemKey(types.MemStoreKey)) suite.app = app - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = keeper } diff --git a/sei-cosmos/x/capability/spec/README.md b/sei-cosmos/x/capability/spec/README.md index ec612ba976..98820a7660 100644 --- a/sei-cosmos/x/capability/spec/README.md +++ b/sei-cosmos/x/capability/spec/README.md @@ -63,7 +63,7 @@ func NewApp(...) *App { // Initialize and seal the capability keeper so all persistent capabilities // are loaded in-memory and prevent any further modules from creating scoped // sub-keepers. - ctx := app.BaseApp.NewContext(true, tmproto.Header{}) + ctx := app.BaseApp.NewContext(true, sdk.Header{}) app.capabilityKeeper.InitializeAndSeal(ctx) return app diff --git a/sei-cosmos/x/crisis/handler_test.go b/sei-cosmos/x/crisis/handler_test.go index 2e60d43da5..4fb1d66f16 100644 --- a/sei-cosmos/x/crisis/handler_test.go +++ b/sei-cosmos/x/crisis/handler_test.go @@ -3,8 +3,6 @@ package crisis_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -20,7 +18,7 @@ var ( func createTestApp(t *testing.T) (*seiapp.App, sdk.Context, []sdk.AccAddress) { app := seiapp.Setup(t, false, false, false) - ctx := app.NewContext(false, tmproto.Header{}) + ctx := app.NewContext(false, sdk.Header{}) constantFee := sdk.NewInt64Coin(sdk.DefaultBondDenom, 10) app.CrisisKeeper.SetConstantFee(ctx, constantFee) diff --git a/sei-cosmos/x/crisis/keeper/keeper_test.go b/sei-cosmos/x/crisis/keeper/keeper_test.go index 1e3578d9d2..e5f271c0e2 100644 --- a/sei-cosmos/x/crisis/keeper/keeper_test.go +++ b/sei-cosmos/x/crisis/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +15,7 @@ import ( func TestLogger(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.NewContext(true, tmproto.Header{}) + ctx := app.NewContext(true, sdk.Header{}) require.Equal(t, ctx.Logger().With("module", "x/"+types.ModuleName), app.CrisisKeeper.Logger(ctx)) } @@ -38,7 +37,7 @@ func TestAssertInvariants(t *testing.T) { app.Commit(context.Background()) app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) - ctx := app.NewContext(true, tmproto.Header{}) + ctx := app.NewContext(true, sdk.Header{}) app.CrisisKeeper.RegisterRoute("testModule", "testRoute1", func(sdk.Context) (string, bool) { return "", false }) require.NotPanics(t, func() { app.CrisisKeeper.AssertInvariants(ctx) }) diff --git a/sei-cosmos/x/distribution/keeper/allocation_test.go b/sei-cosmos/x/distribution/keeper/allocation_test.go index 4ceb455ce8..4cc792d041 100644 --- a/sei-cosmos/x/distribution/keeper/allocation_test.go +++ b/sei-cosmos/x/distribution/keeper/allocation_test.go @@ -4,7 +4,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,7 +17,7 @@ import ( func TestAllocateTokensToValidatorWithCommission(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1234)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrs) @@ -47,7 +46,7 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { func TestAllocateTokensToManyValidators(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) params := app.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDec(0) app.StakingKeeper.SetParams(ctx, params) @@ -132,7 +131,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { func TestAllocateTokensTruncation(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1234)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrs) diff --git a/sei-cosmos/x/distribution/keeper/delegation_test.go b/sei-cosmos/x/distribution/keeper/delegation_test.go index fb229e970a..d1f8960609 100644 --- a/sei-cosmos/x/distribution/keeper/delegation_test.go +++ b/sei-cosmos/x/distribution/keeper/delegation_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +15,7 @@ import ( func TestCalculateRewardsBasic(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000)) @@ -70,7 +69,7 @@ func TestCalculateRewardsBasic(t *testing.T) { func TestCalculateRewardsAfterSlash(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) valAddrs := seiapp.ConvertAddrsToValAddrs(addr) @@ -133,7 +132,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { func TestCalculateRewardsAfterManySlashes(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) @@ -208,7 +207,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { func TestCalculateRewardsMultiDelegator(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) @@ -271,7 +270,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { func TestWithdrawDelegationRewardsBasic(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) balancePower := int64(1000) balanceTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, balancePower) @@ -335,7 +334,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addr := seiapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(1000000000)) valAddrs := seiapp.ConvertAddrsToValAddrs(addr) @@ -403,7 +402,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000000000)) @@ -477,7 +476,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000000000)) diff --git a/sei-cosmos/x/distribution/keeper/grpc_query_test.go b/sei-cosmos/x/distribution/keeper/grpc_query_test.go index 0038b10abe..c63a94bbb3 100644 --- a/sei-cosmos/x/distribution/keeper/grpc_query_test.go +++ b/sei-cosmos/x/distribution/keeper/grpc_query_test.go @@ -7,7 +7,6 @@ import ( seiapp "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/apptesting" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -31,7 +30,7 @@ type KeeperTestSuite struct { func (suite *KeeperTestSuite) SetupTest() { app := seiapp.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, app.DistrKeeper) diff --git a/sei-cosmos/x/distribution/keeper/keeper_test.go b/sei-cosmos/x/distribution/keeper/keeper_test.go index 399be90fe3..eec9cba50e 100644 --- a/sei-cosmos/x/distribution/keeper/keeper_test.go +++ b/sei-cosmos/x/distribution/keeper/keeper_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -15,7 +14,7 @@ import ( func TestSetWithdrawAddr(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000000000)) @@ -37,7 +36,7 @@ func TestSetWithdrawAddr(t *testing.T) { func TestWithdrawValidatorCommission(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valCommission := sdk.DecCoins{ sdk.NewDecCoinFromDec("mytoken", sdk.NewDec(5).Quo(sdk.NewDec(4))), @@ -89,7 +88,7 @@ func TestWithdrawValidatorCommission(t *testing.T) { func TestGetTotalRewards(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valCommission := sdk.DecCoins{ sdk.NewDecCoinFromDec("mytoken", sdk.NewDec(5).Quo(sdk.NewDec(4))), @@ -110,7 +109,7 @@ func TestGetTotalRewards(t *testing.T) { func TestFundCommunityPool(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addr := seiapp.AddTestAddrs(app, ctx, 2, sdk.ZeroInt()) diff --git a/sei-cosmos/x/distribution/keeper/querier_test.go b/sei-cosmos/x/distribution/keeper/querier_test.go index d16bf45b9e..f9b8386a55 100644 --- a/sei-cosmos/x/distribution/keeper/querier_test.go +++ b/sei-cosmos/x/distribution/keeper/querier_test.go @@ -5,7 +5,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -117,7 +116,7 @@ func TestQueries(t *testing.T) { banktypes.RegisterLegacyAminoCodec(cdc) app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addr := seiapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(1000000000)) valAddrs := seiapp.ConvertAddrsToValAddrs(addr) diff --git a/sei-cosmos/x/distribution/module_test.go b/sei-cosmos/x/distribution/module_test.go index 77fb17ba9d..c6db3ba0c9 100644 --- a/sei-cosmos/x/distribution/module_test.go +++ b/sei-cosmos/x/distribution/module_test.go @@ -2,10 +2,10 @@ package distribution_test import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" "testing" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -15,7 +15,7 @@ import ( func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.InitChain( context.Background(), &abcitypes.RequestInitChain{ diff --git a/sei-cosmos/x/distribution/proposal_handler_test.go b/sei-cosmos/x/distribution/proposal_handler_test.go index 3098c3f132..86bea7b9a9 100644 --- a/sei-cosmos/x/distribution/proposal_handler_test.go +++ b/sei-cosmos/x/distribution/proposal_handler_test.go @@ -3,7 +3,6 @@ package distribution_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -27,7 +26,7 @@ func testProposal(recipient sdk.AccAddress, amount sdk.Coins) *types.CommunityPo func TestProposalHandlerPassed(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) recipient := delAddr1 @@ -56,7 +55,7 @@ func TestProposalHandlerPassed(t *testing.T) { func TestProposalHandlerFailed(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) recipient := delAddr1 diff --git a/sei-cosmos/x/evidence/genesis_test.go b/sei-cosmos/x/evidence/genesis_test.go index 3bb6391e6b..02db82e1b5 100644 --- a/sei-cosmos/x/evidence/genesis_test.go +++ b/sei-cosmos/x/evidence/genesis_test.go @@ -5,7 +5,6 @@ import ( "testing" time "github.com/cosmos/cosmos-sdk/std" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -28,7 +27,7 @@ func (suite *GenesisTestSuite) SetupTest() { checkTx := false app := seiapp.Setup(suite.T(), checkTx, false, false) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = app.EvidenceKeeper } diff --git a/sei-cosmos/x/evidence/handler_test.go b/sei-cosmos/x/evidence/handler_test.go index 01617e8afe..4d0df6be01 100644 --- a/sei-cosmos/x/evidence/handler_test.go +++ b/sei-cosmos/x/evidence/handler_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -104,7 +103,7 @@ func (suite *HandlerTestSuite) TestMsgSubmitEvidence() { } for i, tc := range testCases { - ctx := suite.app.BaseApp.NewContext(false, tmproto.Header{Height: suite.app.LastBlockHeight() + 1}) + ctx := suite.app.BaseApp.NewContext(false, sdk.Header{Height: suite.app.LastBlockHeight() + 1}) res, err := suite.handler(ctx, tc.msg) if tc.expectErr { diff --git a/sei-cosmos/x/evidence/keeper/keeper_test.go b/sei-cosmos/x/evidence/keeper/keeper_test.go index 421c41c0a5..8615cb472c 100644 --- a/sei-cosmos/x/evidence/keeper/keeper_test.go +++ b/sei-cosmos/x/evidence/keeper/keeper_test.go @@ -7,7 +7,6 @@ import ( minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -94,7 +93,7 @@ func (suite *KeeperTestSuite) SetupTest() { app.EvidenceKeeper = *evidenceKeeper - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.querier = keeper.NewQuerier(*evidenceKeeper, app.LegacyAmino()) suite.app = app diff --git a/sei-cosmos/x/feegrant/basic_fee_test.go b/sei-cosmos/x/feegrant/basic_fee_test.go index 058fb2eee7..d8a11de336 100644 --- a/sei-cosmos/x/feegrant/basic_fee_test.go +++ b/sei-cosmos/x/feegrant/basic_fee_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,14 +15,14 @@ import ( func TestBasicFeeValidAllow(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) badTime := ctx.BlockTime().AddDate(0, 0, -1) allowace := &feegrant.BasicAllowance{ Expiration: &badTime, } require.Error(t, allowace.ValidateBasic()) - ctx = app.BaseApp.NewContext(false, tmproto.Header{ + ctx = app.BaseApp.NewContext(false, sdk.Header{ Time: time.Now(), }) eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 10)) @@ -131,7 +130,7 @@ func TestBasicFeeValidAllow(t *testing.T) { err := tc.allowance.ValidateBasic() require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}).WithBlockTime(tc.blockTime) + ctx := app.BaseApp.NewContext(false, sdk.Header{}).WithBlockTime(tc.blockTime) // now try to deduct removed, err := tc.allowance.Accept(ctx, tc.fee, []sdk.Msg{}) diff --git a/sei-cosmos/x/feegrant/filtered_fee_test.go b/sei-cosmos/x/feegrant/filtered_fee_test.go index c9c0c47b46..19ff572476 100644 --- a/sei-cosmos/x/feegrant/filtered_fee_test.go +++ b/sei-cosmos/x/feegrant/filtered_fee_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -17,7 +16,7 @@ import ( func TestFilteredFeeValidAllow(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ctx := app.BaseApp.NewContext(false, sdk.Header{ Time: time.Now(), }) @@ -196,7 +195,7 @@ func TestFilteredFeeValidAllow(t *testing.T) { err := tc.allowance.ValidateBasic() require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}).WithBlockTime(tc.blockTime) + ctx := app.BaseApp.NewContext(false, sdk.Header{}).WithBlockTime(tc.blockTime) removed, err := tc.allowance.Accept(ctx, tc.fee, tc.msgs) if !tc.accept { @@ -253,7 +252,7 @@ func TestFilteredFeeValidAllowance(t *testing.T) { err := tc.allowance.ValidateBasic() require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}).WithBlockTime(tc.blockTime) + ctx := app.BaseApp.NewContext(false, sdk.Header{}).WithBlockTime(tc.blockTime) // now try to deduct removed, err := tc.allowance.Accept(ctx, tc.fee, []sdk.Msg{ diff --git a/sei-cosmos/x/feegrant/grant_test.go b/sei-cosmos/x/feegrant/grant_test.go index 0b9cbef8d2..1693b37d5d 100644 --- a/sei-cosmos/x/feegrant/grant_test.go +++ b/sei-cosmos/x/feegrant/grant_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,7 +18,7 @@ func TestGrant(t *testing.T) { addr2, err := sdk.AccAddressFromBech32("sei1rs8v2232uv5nw8c88ruvyjy08mmxfx25pur3pl") require.NoError(t, err) atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) - ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ctx := app.BaseApp.NewContext(false, sdk.Header{ Time: time.Now(), }) now := ctx.BlockTime() diff --git a/sei-cosmos/x/feegrant/keeper/genesis_test.go b/sei-cosmos/x/feegrant/keeper/genesis_test.go index 12fcfbfab0..032327d6ad 100644 --- a/sei-cosmos/x/feegrant/keeper/genesis_test.go +++ b/sei-cosmos/x/feegrant/keeper/genesis_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -24,7 +23,7 @@ type GenesisTestSuite struct { func (suite *GenesisTestSuite) SetupTest() { checkTx := false app := seiapp.Setup(suite.T(), checkTx, false, false) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = app.FeeGrantKeeper } diff --git a/sei-cosmos/x/feegrant/keeper/keeper_test.go b/sei-cosmos/x/feegrant/keeper/keeper_test.go index 8a95db5d3c..b9aa7e3fa6 100644 --- a/sei-cosmos/x/feegrant/keeper/keeper_test.go +++ b/sei-cosmos/x/feegrant/keeper/keeper_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -31,7 +30,7 @@ func TestKeeperTestSuite(t *testing.T) { func (suite *KeeperTestSuite) SetupTest() { app := seiapp.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) suite.app = app suite.sdkCtx = ctx diff --git a/sei-cosmos/x/feegrant/periodic_fee_test.go b/sei-cosmos/x/feegrant/periodic_fee_test.go index 8237a214df..b94d72f20c 100644 --- a/sei-cosmos/x/feegrant/periodic_fee_test.go +++ b/sei-cosmos/x/feegrant/periodic_fee_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -15,7 +14,7 @@ import ( func TestPeriodicFeeValidAllow(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ctx := app.BaseApp.NewContext(false, sdk.Header{ Time: time.Now(), }) @@ -192,7 +191,7 @@ func TestPeriodicFeeValidAllow(t *testing.T) { } require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}).WithBlockTime(tc.blockTime) + ctx := app.BaseApp.NewContext(false, sdk.Header{}).WithBlockTime(tc.blockTime) // now try to deduct remove, err := tc.allow.Accept(ctx, tc.fee, []sdk.Msg{}) if !tc.accept { diff --git a/sei-cosmos/x/genutil/gentx_test.go b/sei-cosmos/x/genutil/gentx_test.go index 559c9564a4..39c335b2e3 100644 --- a/sei-cosmos/x/genutil/gentx_test.go +++ b/sei-cosmos/x/genutil/gentx_test.go @@ -5,7 +5,6 @@ import ( "fmt" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -45,7 +44,7 @@ type GenTxTestSuite struct { func (suite *GenTxTestSuite) SetupTest() { checkTx := false app := seiapp.Setup(suite.T(), checkTx, false, false) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{}) suite.app = app suite.encodingConfig = seiapp.MakeEncodingConfig() diff --git a/sei-cosmos/x/gov/abci_test.go b/sei-cosmos/x/gov/abci_test.go index 8d88a61774..944ecd4a79 100644 --- a/sei-cosmos/x/gov/abci_test.go +++ b/sei-cosmos/x/gov/abci_test.go @@ -7,7 +7,6 @@ import ( "github.com/golang/protobuf/proto" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,7 @@ import ( func TestTickExpiredDepositPeriod(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens) app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) @@ -71,7 +70,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { func TestTickMultipleExpiredDepositPeriod(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens) app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) @@ -147,7 +146,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { func TestTickPassedDepositPeriod(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens) app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) @@ -203,7 +202,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { func TestTickPassedVotingPeriod(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens) SortAddresses(addrs) @@ -291,7 +290,7 @@ func TestProposalPassedEndblocker(t *testing.T) { depositMultiplier := getDepositMultiplier(tc.isExpedited) app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens.Mul(sdk.NewInt(depositMultiplier))) params := app.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDec(0) @@ -301,7 +300,7 @@ func TestProposalPassedEndblocker(t *testing.T) { handler := gov.NewHandler(app.GovKeeper) stakingHandler := staking.NewHandler(app.StakingKeeper) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} legacyabci.BeginBlock(ctx, header.Height, []abci.VoteInfo{}, []abci.Misbehavior{}, app.BeginBlockKeepers) valAddr := sdk.ValAddress(addrs[0]) @@ -376,13 +375,13 @@ func TestExpeditedProposalPassAndConvertToRegular(t *testing.T) { testProposal := types.NewTextProposal("TestTitle", "description", isExpedited) app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 10, valTokens) params := app.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDec(0) app.StakingKeeper.SetParams(ctx, params) SortAddresses(addrs) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} legacyabci.BeginBlock(ctx, header.Height, []abci.VoteInfo{}, []abci.Misbehavior{}, app.BeginBlockKeepers) valAddr := sdk.ValAddress(addrs[0]) @@ -564,7 +563,7 @@ func TestExpeditedProposalPassAndConvertToRegular(t *testing.T) { func TestEndBlockerProposalHandlerFailed(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 1, valTokens) params := app.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDec(0) diff --git a/sei-cosmos/x/gov/genesis_test.go b/sei-cosmos/x/gov/genesis_test.go index 790ad458a6..2b2ec79253 100644 --- a/sei-cosmos/x/gov/genesis_test.go +++ b/sei-cosmos/x/gov/genesis_test.go @@ -6,7 +6,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" @@ -21,14 +20,14 @@ import ( func TestImportExportQueues(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 2, valTokens) SortAddresses(addrs) app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) - ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + ctx = app.BaseApp.NewContext(false, sdk.Header{}) // Create two proposals, put the second into the voting period proposal := TestProposal @@ -81,7 +80,7 @@ func TestImportExportQueues(t *testing.T) { app2.Commit(context.Background()) app2.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app2.LastBlockHeight() + 1}) - ctx2 := app2.BaseApp.NewContext(false, tmproto.Header{}) + ctx2 := app2.BaseApp.NewContext(false, sdk.Header{}) // Jump the time forward past the DepositPeriod and VotingPeriod ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(app2.GovKeeper.GetDepositParams(ctx2).MaxDepositPeriod).Add(app2.GovKeeper.GetVotingParams(ctx2).VotingPeriod)) @@ -110,7 +109,7 @@ func TestImportExportQueues(t *testing.T) { func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) require.Panics(t, func() { gov.InitGenesis(ctx, app.AccountKeeper, app.BankKeeper, app.GovKeeper, &types.GenesisState{ Deposits: types.Deposits{ @@ -131,7 +130,7 @@ func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { func TestEqualProposals(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrs(app, ctx, 2, valTokens) SortAddresses(addrs) diff --git a/sei-cosmos/x/gov/handler_test.go b/sei-cosmos/x/gov/handler_test.go index 5e12ddcda1..7f101d7f0f 100644 --- a/sei-cosmos/x/gov/handler_test.go +++ b/sei-cosmos/x/gov/handler_test.go @@ -4,8 +4,6 @@ import ( "strings" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/stretchr/testify/require" @@ -19,7 +17,7 @@ func TestInvalidMsg(t *testing.T) { k := keeper.Keeper{} h := gov.NewHandler(k) - res, err := h(sdk.NewContext(nil, tmproto.Header{}, false, nil), testdata.NewTestMsg()) + res, err := h(sdk.NewContext(nil, sdk.Header{}, false, nil), testdata.NewTestMsg()) require.Error(t, err) require.Nil(t, res) require.True(t, strings.Contains(err.Error(), "unrecognized gov message type")) diff --git a/sei-cosmos/x/gov/keeper/deposit_test.go b/sei-cosmos/x/gov/keeper/deposit_test.go index 927a4f63a8..52fcc942b1 100644 --- a/sei-cosmos/x/gov/keeper/deposit_test.go +++ b/sei-cosmos/x/gov/keeper/deposit_test.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -27,7 +26,7 @@ func TestDeposits(t *testing.T) { for _, tc := range testcases { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) // With expedited proposals the minimum deposit is higer, so we must // initialize and deposit an amount depositMultiplier times larger diff --git a/sei-cosmos/x/gov/keeper/hooks_test.go b/sei-cosmos/x/gov/keeper/hooks_test.go index d9bac39004..70254cbe27 100644 --- a/sei-cosmos/x/gov/keeper/hooks_test.go +++ b/sei-cosmos/x/gov/keeper/hooks_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -45,7 +44,7 @@ func (h *MockGovHooksReceiver) AfterProposalVotingPeriodEnded(ctx sdk.Context, p func TestHooks(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) minDeposit := app.GovKeeper.GetDepositParams(ctx).MinDeposit addrs := seiapp.AddTestAddrs(app, ctx, 1, minDeposit[0].Amount) diff --git a/sei-cosmos/x/gov/keeper/keeper_test.go b/sei-cosmos/x/gov/keeper/keeper_test.go index cd29a644f6..93d1ddce23 100644 --- a/sei-cosmos/x/gov/keeper/keeper_test.go +++ b/sei-cosmos/x/gov/keeper/keeper_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -24,7 +23,7 @@ type KeeperTestSuite struct { func (suite *KeeperTestSuite) SetupTest() { app := seiapp.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, app.GovKeeper) @@ -38,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() { func TestIncrementProposalNumber(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) tp := TestProposal _, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -59,7 +58,7 @@ func TestIncrementProposalNumber(t *testing.T) { func TestProposalQueues(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) // create test proposals tp := TestProposal diff --git a/sei-cosmos/x/gov/keeper/querier_test.go b/sei-cosmos/x/gov/keeper/querier_test.go index d9ef410176..de03c4e3bd 100644 --- a/sei-cosmos/x/gov/keeper/querier_test.go +++ b/sei-cosmos/x/gov/keeper/querier_test.go @@ -7,7 +7,6 @@ import ( "time" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -146,7 +145,7 @@ func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, quer func TestQueries(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) legacyQuerierCdc := app.LegacyAmino() querier := keeper.NewQuerier(app.GovKeeper, legacyQuerierCdc) @@ -305,7 +304,7 @@ func TestQueries(t *testing.T) { func TestPaginatedVotesQuery(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) legacyQuerierCdc := app.LegacyAmino() proposal := types.Proposal{ diff --git a/sei-cosmos/x/gov/keeper/tally_test.go b/sei-cosmos/x/gov/keeper/tally_test.go index 6691df834e..e0a2dd3181 100644 --- a/sei-cosmos/x/gov/keeper/tally_test.go +++ b/sei-cosmos/x/gov/keeper/tally_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,7 +14,7 @@ import ( func TestTallyNoOneVotes(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) createValidators(t, ctx, app, []int64{5, 5, 5}) @@ -37,7 +36,7 @@ func TestTallyNoOneVotes(t *testing.T) { func TestTallyNoQuorum(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) createValidators(t, ctx, app, []int64{2, 5, 0}) @@ -62,7 +61,7 @@ func TestTallyNoQuorum(t *testing.T) { func TestTallyOnlyValidatorsAllYes(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal @@ -88,7 +87,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { func TestTallyOnlyValidatorsAllNo(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal @@ -114,7 +113,7 @@ func TestTallyOnlyValidatorsAllNo(t *testing.T) { func TestTallyOnlyValidators51No(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) @@ -138,7 +137,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { func TestTallyOnlyValidators51Yes(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) @@ -163,7 +162,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { func TestTallyOnlyValidatorsVetoed(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) @@ -189,7 +188,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) @@ -215,7 +214,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) @@ -241,7 +240,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { func TestTallyOnlyValidatorsNonVoter(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 7}) valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] @@ -267,7 +266,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { func TestTallyDelgatorOverride(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, valAddrs := createValidators(t, ctx, app, []int64{5, 6, 7}) @@ -303,7 +302,7 @@ func TestTallyDelgatorOverride(t *testing.T) { func TestTallyDelgatorInherit(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, vals := createValidators(t, ctx, app, []int64{5, 6, 7}) @@ -338,7 +337,7 @@ func TestTallyDelgatorInherit(t *testing.T) { func TestTallyDelgatorMultipleOverride(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, vals := createValidators(t, ctx, app, []int64{5, 6, 7}) @@ -378,7 +377,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { func TestTallyDelgatorMultipleInherit(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) createValidators(t, ctx, app, []int64{25, 6, 7}) @@ -419,7 +418,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { func TestTallyJailedValidator(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, valAddrs := createValidators(t, ctx, app, []int64{25, 6, 7}) @@ -462,7 +461,7 @@ func TestTallyJailedValidator(t *testing.T) { func TestTallyValidatorMultipleDelegations(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs, valAddrs := createValidators(t, ctx, app, []int64{10, 10, 10}) diff --git a/sei-cosmos/x/gov/keeper/vote_test.go b/sei-cosmos/x/gov/keeper/vote_test.go index 6346db618f..29bc621033 100644 --- a/sei-cosmos/x/gov/keeper/vote_test.go +++ b/sei-cosmos/x/gov/keeper/vote_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,7 +12,7 @@ import ( func TestVotes(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrs := seiapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) diff --git a/sei-cosmos/x/gov/module_test.go b/sei-cosmos/x/gov/module_test.go index f2b0f35e22..c47c5e4e41 100644 --- a/sei-cosmos/x/gov/module_test.go +++ b/sei-cosmos/x/gov/module_test.go @@ -2,10 +2,10 @@ package gov_test import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" "testing" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -15,7 +15,7 @@ import ( func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.InitChain( context.Background(), &abcitypes.RequestInitChain{ diff --git a/sei-cosmos/x/params/keeper/genesis_test.go b/sei-cosmos/x/params/keeper/genesis_test.go index 57bc1bbd13..eed2b99bbc 100644 --- a/sei-cosmos/x/params/keeper/genesis_test.go +++ b/sei-cosmos/x/params/keeper/genesis_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,7 +20,7 @@ type GenesisTestSuite struct { func (suite *GenesisTestSuite) SetupTest() { checkTx := false app := seiapp.Setup(suite.T(), checkTx, false, false) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1}) suite.keeper = app.ParamsKeeper } diff --git a/sei-cosmos/x/params/keeper/keeper_test.go b/sei-cosmos/x/params/keeper/keeper_test.go index c5047887db..788f4a71b2 100644 --- a/sei-cosmos/x/params/keeper/keeper_test.go +++ b/sei-cosmos/x/params/keeper/keeper_test.go @@ -6,7 +6,6 @@ import ( "reflect" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -42,7 +41,7 @@ func TestKeeperTestSuite(t *testing.T) { // returns context and app func createTestApp(t *testing.T, isCheckTx bool) (*seiapp.App, sdk.Context) { app := seiapp.Setup(t, isCheckTx, false, false) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, sdk.Header{}) return app, ctx } diff --git a/sei-cosmos/x/params/proposal_handler_test.go b/sei-cosmos/x/params/proposal_handler_test.go index c353e802a1..4fdb0beffa 100644 --- a/sei-cosmos/x/params/proposal_handler_test.go +++ b/sei-cosmos/x/params/proposal_handler_test.go @@ -5,8 +5,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/params" @@ -25,7 +23,7 @@ type HandlerTestSuite struct { func (suite *HandlerTestSuite) SetupTest() { suite.app = seiapp.Setup(suite.T(), false, false, false) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = suite.app.BaseApp.NewContext(false, sdk.Header{}) suite.govHandler = params.NewParamChangeProposalHandler(suite.app.ParamsKeeper) } diff --git a/sei-cosmos/x/params/types/subspace_test.go b/sei-cosmos/x/params/types/subspace_test.go index 8d0616002c..50f5489502 100644 --- a/sei-cosmos/x/params/types/subspace_test.go +++ b/sei-cosmos/x/params/types/subspace_test.go @@ -6,7 +6,6 @@ import ( "time" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" dbm "github.com/tendermint/tm-db" @@ -39,7 +38,7 @@ func (suite *SubspaceTestSuite) SetupTest() { suite.cdc = encCfg.Marshaler suite.amino = encCfg.Amino - suite.ctx = sdk.NewContext(ms, tmproto.Header{}, false, log.NewNopLogger()) + suite.ctx = sdk.NewContext(ms, sdk.Header{}, false, log.NewNopLogger()) suite.ss = ss.WithKeyTable(paramKeyTable()) } diff --git a/sei-cosmos/x/simulation/mock_tendermint.go b/sei-cosmos/x/simulation/mock_tendermint.go index b5c1a87609..ead3e4b007 100644 --- a/sei-cosmos/x/simulation/mock_tendermint.go +++ b/sei-cosmos/x/simulation/mock_tendermint.go @@ -7,10 +7,10 @@ import ( "testing" "time" + sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" tmbytes "github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" ) type mockValidator struct { @@ -119,10 +119,10 @@ func updateValidators( func RandomRequestBeginBlock(r *rand.Rand, params Params, validators mockValidators, pastTimes []time.Time, pastVoteInfos [][]abci.VoteInfo, - event func(route, op, evResult string), header tmproto.Header) abci.RequestBeginBlock { + event func(route, op, evResult string), header sdk.Header) abci.RequestBeginBlock { if len(validators) == 0 { return abci.RequestBeginBlock{ - Header: header, + Header: header.ToProto(), } } @@ -166,7 +166,7 @@ func RandomRequestBeginBlock(r *rand.Rand, params Params, // return if no past times if len(pastTimes) == 0 { return abci.RequestBeginBlock{ - Header: header, + Header: header.ToProto(), LastCommitInfo: abci.LastCommitInfo{ Votes: voteInfos, }, @@ -209,7 +209,7 @@ func RandomRequestBeginBlock(r *rand.Rand, params Params, } return abci.RequestBeginBlock{ - Header: header, + Header: header.ToProto(), LastCommitInfo: abci.LastCommitInfo{ Votes: voteInfos, }, diff --git a/sei-cosmos/x/simulation/simulate.go b/sei-cosmos/x/simulation/simulate.go index ee522736dc..7f5bcc11c5 100644 --- a/sei-cosmos/x/simulation/simulate.go +++ b/sei-cosmos/x/simulation/simulate.go @@ -12,7 +12,6 @@ import ( "time" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -105,7 +104,7 @@ func SimulateFromSeed( accs = tmpAccs nextValidators := validators - header := tmproto.Header{ + header := sdk.Header{ ChainID: config.ChainID, Height: 1, Time: genesisTimestamp, @@ -253,7 +252,7 @@ func SimulateFromSeed( } type blockSimFn func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accounts []simulation.Account, header tmproto.Header) (opCount int) + accounts []simulation.Account, header sdk.Header) (opCount int) // Returns a function to simulate blocks. Written like this to avoid constant // parameters being passed everytime, to minimize memory overhead. @@ -267,7 +266,7 @@ func createBlockSimulator(testingMode bool, tb testing.TB, w io.Writer, params P selectOp := ops.getSelectOpFn() return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accounts []simulation.Account, header tmproto.Header, + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accounts []simulation.Account, header sdk.Header, ) (opCount int) { _, _ = fmt.Fprintf( w, "\rSimulating... block %d/%d, operation %d/%d.", diff --git a/sei-cosmos/x/slashing/abci_test.go b/sei-cosmos/x/slashing/abci_test.go index 398095ca46..a2bb566f43 100644 --- a/sei-cosmos/x/slashing/abci_test.go +++ b/sei-cosmos/x/slashing/abci_test.go @@ -5,7 +5,6 @@ import ( "time" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,7 @@ import ( func TestBeginBlocker(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) pks := seiapp.CreateTestPubKeys(5) seiapp.AddTestAddrsFromPubKeys(app, ctx, pks, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) @@ -118,7 +117,7 @@ func TestBeginBlocker(t *testing.T) { func TestResizeTrimResetValidatorMissedBlocksArray(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -178,7 +177,7 @@ func TestResizeTrimResetValidatorMissedBlocksArray(t *testing.T) { func TestResizeExpandValidatorMissedBlocksArray(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -238,7 +237,7 @@ func TestResizeExpandValidatorMissedBlocksArray(t *testing.T) { func TestResizeExpandShiftValidatorMissedBlocksArrayMultipleBitGroups(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -303,7 +302,7 @@ func TestResizeExpandShiftValidatorMissedBlocksArrayMultipleBitGroups(t *testing func TestResizeExpandShiftValidatorMissedBlocksArrayMultipleBitGroupsBeforeAndAfter(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -375,7 +374,7 @@ func TestResizeExpandShiftValidatorMissedBlocksArrayMultipleBitGroupsBeforeAndAf func TestResizeTrimValidatorMissedBlocksArrayMultipleBitGroups(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -439,7 +438,7 @@ func TestResizeTrimValidatorMissedBlocksArrayMultipleBitGroups(t *testing.T) { func TestResizeTrimValidatorMissedBlocksArrayEliminateBitGroup(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) diff --git a/sei-cosmos/x/slashing/app_test.go b/sei-cosmos/x/slashing/app_test.go index 977ba47bca..2857107599 100644 --- a/sei-cosmos/x/slashing/app_test.go +++ b/sei-cosmos/x/slashing/app_test.go @@ -6,7 +6,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -28,14 +27,14 @@ var ( ) func checkValidator(t *testing.T, app *seiapp.App, _ sdk.AccAddress, expFound bool) stakingtypes.Validator { - ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck := app.BaseApp.NewContext(true, sdk.Header{}) validator, found := app.StakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) require.Equal(t, expFound, found) return validator } func checkValidatorSigningInfo(t *testing.T, app *seiapp.App, addr sdk.ConsAddress, expFound bool) types.ValidatorSigningInfo { - ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck := app.BaseApp.NewContext(true, sdk.Header{}) signingInfo, found := app.SlashingKeeper.GetValidatorSigningInfo(ctxCheck, addr) require.Equal(t, expFound, found) return signingInfo @@ -69,13 +68,13 @@ func TestSlashingMsgs(t *testing.T) { ) require.NoError(t, err) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} txGen := seiapp.MakeEncodingConfig().TxConfig _, _, err = seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) seiapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) validator := checkValidator(t, app, addr1, true) @@ -87,7 +86,7 @@ func TestSlashingMsgs(t *testing.T) { checkValidatorSigningInfo(t, app, sdk.ConsAddress(valAddr), true) // unjail should fail with unknown validator - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} _, res, err := seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{unjailMsg}, "", []uint64{0}, []uint64{1}, false, false, priv1) require.Error(t, err) require.Nil(t, res) diff --git a/sei-cosmos/x/slashing/genesis_test.go b/sei-cosmos/x/slashing/genesis_test.go index 5c652a22a5..0dbc9ff1bb 100644 --- a/sei-cosmos/x/slashing/genesis_test.go +++ b/sei-cosmos/x/slashing/genesis_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +15,7 @@ import ( func TestExportAndInitGenesis(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) diff --git a/sei-cosmos/x/slashing/handler_test.go b/sei-cosmos/x/slashing/handler_test.go index 40200c7d24..11e91fd275 100644 --- a/sei-cosmos/x/slashing/handler_test.go +++ b/sei-cosmos/x/slashing/handler_test.go @@ -6,7 +6,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -24,7 +23,7 @@ import ( func TestCannotUnjailUnlessJailed(t *testing.T) { // initial setup app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) pks := seiapp.CreateTestPubKeys(1) seiapp.AddTestAddrsFromPubKeys(app, ctx, pks, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) @@ -50,7 +49,7 @@ func TestCannotUnjailUnlessJailed(t *testing.T) { func TestCannotUnjailUnlessMeetMinSelfDelegation(t *testing.T) { // initial setup app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) pks := seiapp.CreateTestPubKeys(1) seiapp.AddTestAddrsFromPubKeys(app, ctx, pks, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) @@ -81,7 +80,7 @@ func TestCannotUnjailUnlessMeetMinSelfDelegation(t *testing.T) { func TestJailedValidatorDelegations(t *testing.T) { // initial setup app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{Time: time.Unix(0, 0)}) + ctx := app.BaseApp.NewContext(false, sdk.Header{Time: time.Unix(0, 0)}) pks := seiapp.CreateTestPubKeys(3) seiapp.AddTestAddrsFromPubKeys(app, ctx, pks, app.StakingKeeper.TokensFromConsensusPower(ctx, 20)) @@ -132,7 +131,7 @@ func TestInvalidMsg(t *testing.T) { k := keeper.Keeper{} h := slashing.NewHandler(k) - res, err := h(sdk.NewContext(nil, tmproto.Header{}, false, nil), testdata.NewTestMsg()) + res, err := h(sdk.NewContext(nil, sdk.Header{}, false, nil), testdata.NewTestMsg()) require.Error(t, err) require.Nil(t, res) require.True(t, strings.Contains(err.Error(), "unrecognized slashing message type")) @@ -143,7 +142,7 @@ func TestInvalidMsg(t *testing.T) { func TestHandleAbsentValidator(t *testing.T) { // initial setup app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{Time: time.Unix(0, 0)}) + ctx := app.BaseApp.NewContext(false, sdk.Header{Time: time.Unix(0, 0)}) pks := seiapp.CreateTestPubKeys(1) seiapp.AddTestAddrsFromPubKeys(app, ctx, pks, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) @@ -240,7 +239,7 @@ func TestHandleAbsentValidator(t *testing.T) { require.Nil(t, res) // unrevocation should succeed after jail expiration - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(1, 0).Add(app.SlashingKeeper.DowntimeJailDuration(ctx))}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Unix(1, 0).Add(app.SlashingKeeper.DowntimeJailDuration(ctx))}) res, err = slh(ctx, types.NewMsgUnjail(addr)) require.NoError(t, err) require.NotNil(t, res) diff --git a/sei-cosmos/x/slashing/keeper/grpc_query_test.go b/sei-cosmos/x/slashing/keeper/grpc_query_test.go index 9523698ce9..c664e4b386 100644 --- a/sei-cosmos/x/slashing/keeper/grpc_query_test.go +++ b/sei-cosmos/x/slashing/keeper/grpc_query_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -29,7 +28,7 @@ type SlashingTestSuite struct { func (suite *SlashingTestSuite) SetupTest() { app := seiapp.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) app.BankKeeper.SetParams(ctx, banktypes.DefaultParams()) diff --git a/sei-cosmos/x/slashing/keeper/hooks_test.go b/sei-cosmos/x/slashing/keeper/hooks_test.go index f9ce9c731d..bbbc0e8403 100644 --- a/sei-cosmos/x/slashing/keeper/hooks_test.go +++ b/sei-cosmos/x/slashing/keeper/hooks_test.go @@ -5,13 +5,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" seiapp "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" ) func TestAfterValidatorBonded(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 6, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) keeper := app.SlashingKeeper diff --git a/sei-cosmos/x/slashing/keeper/infractions_test.go b/sei-cosmos/x/slashing/keeper/infractions_test.go index ff342a9b69..9ea50f841d 100644 --- a/sei-cosmos/x/slashing/keeper/infractions_test.go +++ b/sei-cosmos/x/slashing/keeper/infractions_test.go @@ -1,17 +1,17 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "testing" "github.com/cosmos/cosmos-sdk/x/slashing/types" seiapp "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" ) func TestResizeMissedBlockArray(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 6, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) diff --git a/sei-cosmos/x/slashing/keeper/keeper_test.go b/sei-cosmos/x/slashing/keeper/keeper_test.go index 5f52c426df..d14d2e1bcd 100644 --- a/sei-cosmos/x/slashing/keeper/keeper_test.go +++ b/sei-cosmos/x/slashing/keeper/keeper_test.go @@ -8,7 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/stretchr/testify/assert" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,7 +21,7 @@ import ( func TestUnJailNotBonded(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) p := app.StakingKeeper.GetParams(ctx) p.MaxValidators = 5 @@ -86,7 +85,7 @@ func TestUnJailNotBonded(t *testing.T) { // and that they are not immediately jailed func TestHandleNewValidator(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -129,7 +128,7 @@ func TestHandleNewValidator(t *testing.T) { func TestHandleAlreadyJailed(t *testing.T) { // initial setup app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -192,7 +191,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // initial setup // TestParams set the SignedBlocksWindow to 1000 and MaxMissedBlocksPerWindow to 500 app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) params := app.StakingKeeper.GetParams(ctx) @@ -291,7 +290,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { func TestSlash(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 6, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) keeper := app.SlashingKeeper diff --git a/sei-cosmos/x/slashing/keeper/migrations_test.go b/sei-cosmos/x/slashing/keeper/migrations_test.go index 7de9027c70..e294fcdf80 100644 --- a/sei-cosmos/x/slashing/keeper/migrations_test.go +++ b/sei-cosmos/x/slashing/keeper/migrations_test.go @@ -11,13 +11,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/teststaking" gogotypes "github.com/gogo/protobuf/types" seiapp "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" ) func TestMigrate2to3(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -134,7 +133,7 @@ func TestMigrate2to3(t *testing.T) { func TestMigrate2to4(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) @@ -285,7 +284,7 @@ func TestMigrate2to4(t *testing.T) { func TestMigrate3to4(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) valAddrs := seiapp.ConvertAddrsToValAddrs(addrDels) diff --git a/sei-cosmos/x/slashing/keeper/querier_test.go b/sei-cosmos/x/slashing/keeper/querier_test.go index 47fd49c4d4..ba58eb3a95 100644 --- a/sei-cosmos/x/slashing/keeper/querier_test.go +++ b/sei-cosmos/x/slashing/keeper/querier_test.go @@ -1,12 +1,12 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "testing" "github.com/stretchr/testify/require" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" @@ -17,7 +17,7 @@ import ( func TestNewQuerier(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino()) querier := keeper.NewQuerier(app.SlashingKeeper, legacyQuerierCdc.LegacyAmino) @@ -35,7 +35,7 @@ func TestQueryParams(t *testing.T) { cdc := codec.NewLegacyAmino() legacyQuerierCdc := codec.NewAminoCodec(cdc) app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) querier := keeper.NewQuerier(app.SlashingKeeper, legacyQuerierCdc.LegacyAmino) diff --git a/sei-cosmos/x/slashing/keeper/signing_info_test.go b/sei-cosmos/x/slashing/keeper/signing_info_test.go index 8517cf4f8f..0336154f4c 100644 --- a/sei-cosmos/x/slashing/keeper/signing_info_test.go +++ b/sei-cosmos/x/slashing/keeper/signing_info_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,7 +14,7 @@ import ( func TestGetSetValidatorSigningInfo(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) info, found := app.SlashingKeeper.GetValidatorSigningInfo(ctx, sdk.ConsAddress(addrDels[0])) @@ -39,7 +38,7 @@ func TestGetSetValidatorSigningInfo(t *testing.T) { func TestTombstoned(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) require.Panics(t, func() { app.SlashingKeeper.Tombstone(ctx, sdk.ConsAddress(addrDels[0])) }) @@ -63,7 +62,7 @@ func TestTombstoned(t *testing.T) { func TestJailUntil(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) addrDels := seiapp.AddTestAddrsIncremental(app, ctx, 1, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) require.Panics(t, func() { app.SlashingKeeper.JailUntil(ctx, sdk.ConsAddress(addrDels[0]), time.Now()) }) diff --git a/sei-cosmos/x/staking/app_test.go b/sei-cosmos/x/staking/app_test.go index 1525187eb2..46797ac592 100644 --- a/sei-cosmos/x/staking/app_test.go +++ b/sei-cosmos/x/staking/app_test.go @@ -5,7 +5,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +15,7 @@ import ( ) func checkValidator(t *testing.T, app *seiapp.App, addr sdk.ValAddress, expFound bool) types.Validator { - ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck := app.BaseApp.NewContext(true, sdk.Header{}) validator, found := app.StakingKeeper.GetValidator(ctxCheck, addr) require.Equal(t, expFound, found) @@ -28,7 +27,7 @@ func checkDelegation( validatorAddr sdk.ValAddress, expFound bool, expShares sdk.Dec, ) { - ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck := app.BaseApp.NewContext(true, sdk.Header{}) delegation, found := app.StakingKeeper.GetDelegation(ctxCheck, delegatorAddr, validatorAddr) if expFound { require.True(t, found) @@ -71,13 +70,13 @@ func TestStakingMsgs(t *testing.T) { ) require.NoError(t, err) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := sdk.Header{Height: app.LastBlockHeight() + 1} txGen := seiapp.MakeEncodingConfig().TxConfig _, _, err = seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) seiapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) validator := checkValidator(t, app, sdk.ValAddress(addr1), true) @@ -85,14 +84,14 @@ func TestStakingMsgs(t *testing.T) { require.Equal(t, types.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} app.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) // edit the validator description = types.NewDescription("bar_moniker", "", "", "", "") editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1), description, nil, nil) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} _, _, err = seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{editValidatorMsg}, "", []uint64{0}, []uint64{1}, true, true, priv1) require.NoError(t, err) @@ -103,7 +102,7 @@ func TestStakingMsgs(t *testing.T) { seiapp.CheckBalance(t, app, addr2, sdk.Coins{genCoin}) delegateMsg := types.NewMsgDelegate(addr2, sdk.ValAddress(addr1), bondCoin) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} _, _, err = seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{delegateMsg}, "", []uint64{1}, []uint64{0}, true, true, priv2) require.NoError(t, err) @@ -112,7 +111,7 @@ func TestStakingMsgs(t *testing.T) { // begin unbonding beginUnbondingMsg := types.NewMsgUndelegate(addr2, sdk.ValAddress(addr1), bondCoin) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = sdk.Header{Height: app.LastBlockHeight() + 1} _, _, err = seiapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{beginUnbondingMsg}, "", []uint64{1}, []uint64{1}, true, true, priv2) require.NoError(t, err) diff --git a/sei-cosmos/x/staking/common_test.go b/sei-cosmos/x/staking/common_test.go index 40c4479f25..d919a280ac 100644 --- a/sei-cosmos/x/staking/common_test.go +++ b/sei-cosmos/x/staking/common_test.go @@ -4,8 +4,6 @@ import ( "math/big" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -38,7 +36,7 @@ var ( // to avoid messing with the hooks. func getBaseSimappWithCustomKeeper(t *testing.T) (*codec.LegacyAmino, *seiapp.App, sdk.Context) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) appCodec := app.AppCodec() diff --git a/sei-cosmos/x/staking/genesis_test.go b/sei-cosmos/x/staking/genesis_test.go index 8aa7eb67f5..d4cc3ac884 100644 --- a/sei-cosmos/x/staking/genesis_test.go +++ b/sei-cosmos/x/staking/genesis_test.go @@ -6,7 +6,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -108,7 +107,7 @@ func TestInitGenesis(t *testing.T) { func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.NewContext(false, tmproto.Header{}) + ctx := app.NewContext(false, sdk.Header{}) consPub, err := codectypes.NewAnyWithValue(PKs[0]) require.NoError(t, err) diff --git a/sei-cosmos/x/staking/handler_test.go b/sei-cosmos/x/staking/handler_test.go index a9c8e5c11f..4880032b86 100644 --- a/sei-cosmos/x/staking/handler_test.go +++ b/sei-cosmos/x/staking/handler_test.go @@ -1146,7 +1146,7 @@ func TestInvalidMsg(t *testing.T) { k := keeper.Keeper{} h := staking.NewHandler(k) - res, err := h(sdk.NewContext(nil, tmproto.Header{}, false, nil), testdata.NewTestMsg()) + res, err := h(sdk.NewContext(nil, sdk.Header{}, false, nil), testdata.NewTestMsg()) require.Error(t, err) require.Nil(t, res) require.True(t, strings.Contains(err.Error(), "unrecognized staking message type")) diff --git a/sei-cosmos/x/staking/keeper/common_test.go b/sei-cosmos/x/staking/keeper/common_test.go index e0386693cf..bf00d01f27 100644 --- a/sei-cosmos/x/staking/keeper/common_test.go +++ b/sei-cosmos/x/staking/keeper/common_test.go @@ -4,8 +4,6 @@ import ( "math/big" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -25,7 +23,7 @@ func init() { // to avoid messing with the hooks. func createTestInput(t *testing.T) (*codec.LegacyAmino, *seiapp.App, sdk.Context) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.StakingKeeper = keeper.NewKeeper( app.AppCodec(), diff --git a/sei-cosmos/x/staking/keeper/historical_info_test.go b/sei-cosmos/x/staking/keeper/historical_info_test.go index 193aa0e253..9184b025e9 100644 --- a/sei-cosmos/x/staking/keeper/historical_info_test.go +++ b/sei-cosmos/x/staking/keeper/historical_info_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -63,11 +62,11 @@ func TestTrackHistoricalInfo(t *testing.T) { // set historical info at 5, 4 which should be pruned // and check that it has been stored - h4 := tmproto.Header{ + h4 := sdk.Header{ ChainID: "HelloChain", Height: 4, } - h5 := tmproto.Header{ + h5 := sdk.Header{ ChainID: "HelloChain", Height: 5, } @@ -102,7 +101,7 @@ func TestTrackHistoricalInfo(t *testing.T) { IsValSetSorted(vals, app.StakingKeeper.PowerReduction(ctx)) // Set Header for BeginBlock context - header := tmproto.Header{ + header := sdk.Header{ ChainID: "HelloChain", Height: 10, } @@ -112,7 +111,7 @@ func TestTrackHistoricalInfo(t *testing.T) { // Check HistoricalInfo at height 10 is persisted expected := types.HistoricalInfo{ - Header: header, + Header: header.ToProto(), Valset: vals, } recv, found = app.StakingKeeper.GetHistoricalInfo(ctx, 10) @@ -139,13 +138,13 @@ func TestGetAllHistoricalInfo(t *testing.T) { teststaking.NewValidator(t, addrVals[1], PKs[1]), } - header1 := tmproto.Header{ChainID: "HelloChain", Height: 10} - header2 := tmproto.Header{ChainID: "HelloChain", Height: 11} - header3 := tmproto.Header{ChainID: "HelloChain", Height: 12} + header1 := sdk.Header{ChainID: "HelloChain", Height: 10} + header2 := sdk.Header{ChainID: "HelloChain", Height: 11} + header3 := sdk.Header{ChainID: "HelloChain", Height: 12} - hist1 := types.HistoricalInfo{Header: header1, Valset: valSet} - hist2 := types.HistoricalInfo{Header: header2, Valset: valSet} - hist3 := types.HistoricalInfo{Header: header3, Valset: valSet} + hist1 := types.HistoricalInfo{Header: header1.ToProto(), Valset: valSet} + hist2 := types.HistoricalInfo{Header: header2.ToProto(), Valset: valSet} + hist3 := types.HistoricalInfo{Header: header3.ToProto(), Valset: valSet} expHistInfos := []types.HistoricalInfo{hist1, hist2, hist3} diff --git a/sei-cosmos/x/staking/keeper/keeper_test.go b/sei-cosmos/x/staking/keeper/keeper_test.go index 87b05a6be5..246b649035 100644 --- a/sei-cosmos/x/staking/keeper/keeper_test.go +++ b/sei-cosmos/x/staking/keeper/keeper_test.go @@ -6,8 +6,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -27,7 +25,7 @@ type KeeperTestSuite struct { func (suite *KeeperTestSuite) SetupTest() { app := seiapp.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) querier := keeper.Querier{Keeper: app.StakingKeeper} @@ -36,7 +34,7 @@ func (suite *KeeperTestSuite) SetupTest() { queryClient := types.NewQueryClient(queryHelper) addrs, _, validators := createValidators(suite.T(), ctx, app, []int64{9, 8, 7}) - header := tmproto.Header{ + header := sdk.Header{ ChainID: "HelloChain", Height: 5, } @@ -52,7 +50,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestParams(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) expParams := types.DefaultParams() diff --git a/sei-cosmos/x/staking/keeper/querier_test.go b/sei-cosmos/x/staking/keeper/querier_test.go index 5cade6d587..ee2fe4be04 100644 --- a/sei-cosmos/x/staking/keeper/querier_test.go +++ b/sei-cosmos/x/staking/keeper/querier_test.go @@ -5,7 +5,6 @@ import ( "testing" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -33,7 +32,7 @@ func TestNewQuerier(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[i]) } - header := tmproto.Header{ + header := sdk.Header{ ChainID: "HelloChain", Height: 5, } @@ -720,7 +719,7 @@ func TestQueryHistoricalInfo(t *testing.T) { app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) - header := tmproto.Header{ + header := sdk.Header{ ChainID: "HelloChain", Height: 5, } diff --git a/sei-cosmos/x/staking/keeper/slash_test.go b/sei-cosmos/x/staking/keeper/slash_test.go index cc5b31371e..4ba02b07a6 100644 --- a/sei-cosmos/x/staking/keeper/slash_test.go +++ b/sei-cosmos/x/staking/keeper/slash_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -90,7 +89,7 @@ func TestSlashUnbondingDelegation(t *testing.T) { require.True(t, slashAmount.Equal(sdk.NewInt(0))) // after the expiration time, no longer eligible for slashing - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(10, 0)}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Unix(10, 0)}) app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) slashAmount = app.StakingKeeper.SlashUnbondingDelegation(ctx, ubd, 0, fraction) require.True(t, slashAmount.Equal(sdk.NewInt(0))) @@ -98,7 +97,7 @@ func TestSlashUnbondingDelegation(t *testing.T) { // test valid slash, before expiration timestamp and to which stake contributed notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) oldUnbondedPoolBalances := app.BankKeeper.GetAllBalances(ctx, notBondedPool.GetAddress()) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(0, 0)}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Unix(0, 0)}) app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) slashAmount = app.StakingKeeper.SlashUnbondingDelegation(ctx, ubd, 0, fraction) require.True(t, slashAmount.Equal(sdk.NewInt(5))) @@ -147,7 +146,7 @@ func TestSlashRedelegation(t *testing.T) { require.True(t, slashAmount.Equal(sdk.NewInt(0))) // after the expiration time, no longer eligible for slashing - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(10, 0)}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Unix(10, 0)}) app.StakingKeeper.SetRedelegation(ctx, rd) validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[1]) require.True(t, found) @@ -157,7 +156,7 @@ func TestSlashRedelegation(t *testing.T) { balances = app.BankKeeper.GetAllBalances(ctx, bondedPool.GetAddress()) // test valid slash, before expiration timestamp and to which stake contributed - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(0, 0)}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Unix(0, 0)}) app.StakingKeeper.SetRedelegation(ctx, rd) validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[1]) require.True(t, found) diff --git a/sei-cosmos/x/staking/keeper/validator_test.go b/sei-cosmos/x/staking/keeper/validator_test.go index 38e9616ff8..f53df756ad 100644 --- a/sei-cosmos/x/staking/keeper/validator_test.go +++ b/sei-cosmos/x/staking/keeper/validator_test.go @@ -6,7 +6,6 @@ import ( "time" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -1043,7 +1042,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { func TestUpdateValidatorCommission(t *testing.T) { app, ctx, _, addrVals := bootstrapValidatorTest(t, 1000, 20) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Now().UTC()}) + ctx = ctx.WithBlockHeader(sdk.Header{Time: time.Now().UTC()}) // Set MinCommissionRate to 0.05 params := app.StakingKeeper.GetParams(ctx) diff --git a/sei-cosmos/x/staking/module_test.go b/sei-cosmos/x/staking/module_test.go index aae59b7fcb..b1bfb1df96 100644 --- a/sei-cosmos/x/staking/module_test.go +++ b/sei-cosmos/x/staking/module_test.go @@ -2,10 +2,10 @@ package staking_test import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" "testing" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -15,7 +15,7 @@ import ( func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.InitChain( context.Background(), &abcitypes.RequestInitChain{ diff --git a/sei-cosmos/x/staking/types/authz_test.go b/sei-cosmos/x/staking/types/authz_test.go index 005caf0e3d..08945dd61e 100644 --- a/sei-cosmos/x/staking/types/authz_test.go +++ b/sei-cosmos/x/staking/types/authz_test.go @@ -3,7 +3,6 @@ package types_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,7 +21,7 @@ var ( func TestAuthzAuthorizations(t *testing.T) { app := seiapp.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) // verify ValidateBasic returns error for the AUTHORIZATION_TYPE_UNSPECIFIED authorization type delAuth, err := stakingtypes.NewStakeAuthorization([]sdk.ValAddress{val1, val2}, []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNSPECIFIED, &coin100) diff --git a/sei-cosmos/x/staking/types/historical_info.go b/sei-cosmos/x/staking/types/historical_info.go index 41c0812da4..0ffd12e54a 100644 --- a/sei-cosmos/x/staking/types/historical_info.go +++ b/sei-cosmos/x/staking/types/historical_info.go @@ -4,7 +4,6 @@ import ( "sort" "github.com/gogo/protobuf/proto" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -14,14 +13,14 @@ import ( // NewHistoricalInfo will create a historical information struct from header and valset // it will first sort valset before inclusion into historical info -func NewHistoricalInfo(header tmproto.Header, valSet Validators, powerReduction sdk.Int) HistoricalInfo { +func NewHistoricalInfo(header sdk.Header, valSet Validators, powerReduction sdk.Int) HistoricalInfo { // Must sort in the same way that tendermint does sort.SliceStable(valSet, func(i, j int) bool { return ValidatorsByVotingPower(valSet).Less(i, j, powerReduction) }) return HistoricalInfo{ - Header: header, + Header: header.ToProto(), Valset: valSet, } } diff --git a/sei-cosmos/x/staking/types/historical_info_test.go b/sei-cosmos/x/staking/types/historical_info_test.go index d5961b8c5a..54706201f5 100644 --- a/sei-cosmos/x/staking/types/historical_info_test.go +++ b/sei-cosmos/x/staking/types/historical_info_test.go @@ -5,14 +5,13 @@ import ( "sort" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) -var header = tmproto.Header{ +var header = sdk.Header{ ChainID: "hello", Height: 5, } @@ -48,7 +47,7 @@ func TestHistoricalInfo(t *testing.T) { func TestValidateBasic(t *testing.T) { validators := createValidators(t) hi := types.HistoricalInfo{ - Header: header, + Header: header.ToProto(), } err := types.ValidateBasic(hi) require.Error(t, err, "ValidateBasic passed on nil ValSet") @@ -62,7 +61,7 @@ func TestValidateBasic(t *testing.T) { }) } hi = types.HistoricalInfo{ - Header: header, + Header: header.ToProto(), Valset: validators, } err = types.ValidateBasic(hi) diff --git a/sei-cosmos/x/upgrade/abci_test.go b/sei-cosmos/x/upgrade/abci_test.go index 84319b6acc..e8aa97ab2b 100644 --- a/sei-cosmos/x/upgrade/abci_test.go +++ b/sei-cosmos/x/upgrade/abci_test.go @@ -9,7 +9,6 @@ import ( "time" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" @@ -50,7 +49,7 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) TestSuite { ) s.keeper = app.UpgradeKeeper - s.ctx = app.BaseApp.NewContext(false, tmproto.Header{Height: height, Time: time.Now()}) + s.ctx = app.BaseApp.NewContext(false, sdk.Header{Height: height, Time: time.Now()}) s.querier = upgrade.NewAppModule(s.keeper).LegacyQuerierHandler(app.LegacyAmino()) s.handler = upgrade.NewSoftwareUpgradeProposalHandler(s.keeper) @@ -246,7 +245,7 @@ func TestBinaryVersion(t *testing.T) { { "test not panic: no scheduled upgrade or applied upgrade is present", func() (sdk.Context, abci.RequestBeginBlock) { - req := abci.RequestBeginBlock{Header: s.ctx.BlockHeader()} + req := abci.RequestBeginBlock{Header: s.ctx.BlockHeader().ToProto()} return s.ctx, req }, false, @@ -267,7 +266,7 @@ func TestBinaryVersion(t *testing.T) { Height: 12, }) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, false, @@ -279,7 +278,7 @@ func TestBinaryVersion(t *testing.T) { require.NoError(t, err) newCtx := s.ctx.WithBlockHeight(13) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, true, @@ -294,7 +293,7 @@ func TestBinaryVersion(t *testing.T) { require.NoError(t, err) newCtx := s.ctx.WithBlockHeight(100) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, false, @@ -309,7 +308,7 @@ func TestBinaryVersion(t *testing.T) { require.NoError(t, err) newCtx := s.ctx.WithBlockHeight(13) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, true, @@ -333,7 +332,7 @@ func TestBinaryVersion(t *testing.T) { Height: 12, }) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, false, @@ -352,7 +351,7 @@ func TestBinaryVersion(t *testing.T) { require.NoError(t, err) newCtx := s.ctx.WithBlockHeight(12) - req := abci.RequestBeginBlock{Header: newCtx.BlockHeader()} + req := abci.RequestBeginBlock{Header: newCtx.BlockHeader().ToProto()} return newCtx, req }, false, diff --git a/sei-cosmos/x/upgrade/client/testutil/suite.go b/sei-cosmos/x/upgrade/client/testutil/suite.go index 90ec18ff04..8cfdfe65cf 100644 --- a/sei-cosmos/x/upgrade/client/testutil/suite.go +++ b/sei-cosmos/x/upgrade/client/testutil/suite.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade/client/cli" "github.com/cosmos/cosmos-sdk/x/upgrade/types" seiapp "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" ) @@ -30,7 +29,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") app := seiapp.Setup(s.T(), false, false, false) s.app = app - s.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = app.BaseApp.NewContext(false, sdk.Header{}) cfg := network.DefaultConfig(s.T()) cfg.NumValidators = 1 diff --git a/sei-cosmos/x/upgrade/keeper/grpc_query_test.go b/sei-cosmos/x/upgrade/keeper/grpc_query_test.go index 238f4b58a6..67ec222490 100644 --- a/sei-cosmos/x/upgrade/keeper/grpc_query_test.go +++ b/sei-cosmos/x/upgrade/keeper/grpc_query_test.go @@ -5,7 +5,6 @@ import ( "fmt" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -25,7 +24,7 @@ type UpgradeTestSuite struct { func (suite *UpgradeTestSuite) SetupTest() { suite.app = seiapp.Setup(suite.T(), false, false, false) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = suite.app.BaseApp.NewContext(false, sdk.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.app.UpgradeKeeper) diff --git a/sei-cosmos/x/upgrade/keeper/keeper_test.go b/sei-cosmos/x/upgrade/keeper/keeper_test.go index e7b3e43003..0ff0674975 100644 --- a/sei-cosmos/x/upgrade/keeper/keeper_test.go +++ b/sei-cosmos/x/upgrade/keeper/keeper_test.go @@ -6,7 +6,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -35,7 +34,7 @@ func (s *KeeperTestSuite) SetupTest() { s.T().Log("home dir:", homeDir) s.homeDir = homeDir s.app = app - s.ctx = app.BaseApp.NewContext(false, tmproto.Header{ + s.ctx = app.BaseApp.NewContext(false, sdk.Header{ Time: time.Now(), Height: 10, }) diff --git a/sei-cosmos/x/upgrade/types/plan_test.go b/sei-cosmos/x/upgrade/types/plan_test.go index 77d7695f93..ac54a7ef75 100644 --- a/sei-cosmos/x/upgrade/types/plan_test.go +++ b/sei-cosmos/x/upgrade/types/plan_test.go @@ -5,7 +5,6 @@ import ( "time" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -148,7 +147,7 @@ func TestShouldExecute(t *testing.T) { for name, tc := range cases { tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{Height: tc.ctxHeight, Time: tc.ctxTime}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, sdk.Header{Height: tc.ctxHeight, Time: tc.ctxTime}, false, log.NewNopLogger()) should := tc.p.ShouldExecute(ctx) assert.Equal(t, tc.expected, should) }) diff --git a/sei-ibc-go/modules/apps/27-interchain-accounts/module_test.go b/sei-ibc-go/modules/apps/27-interchain-accounts/module_test.go index bc4f9bad6d..2e030da730 100644 --- a/sei-ibc-go/modules/apps/27-interchain-accounts/module_test.go +++ b/sei-ibc-go/modules/apps/27-interchain-accounts/module_test.go @@ -3,8 +3,8 @@ package ica_test import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" dbm "github.com/tendermint/tm-db" @@ -36,7 +36,7 @@ func (suite *InterchainAccountsTestSuite) TestInitModule() { appModule, ok := app.GetModuleManager().Modules[types.ModuleName].(ica.AppModule) suite.Require().True(ok) - header := tmproto.Header{ + header := sdk.Header{ ChainID: "testchain", Height: 1, Time: suite.coordinator.CurrentTime.UTC(), @@ -99,7 +99,7 @@ func (suite *InterchainAccountsTestSuite) TestInitModule() { // reset app state app = simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 5, nil, simapp.MakeTestEncodingConfig(), simapp.EmptyAppOptions{}) - header := tmproto.Header{ + header := sdk.Header{ ChainID: "testchain", Height: 1, Time: suite.coordinator.CurrentTime.UTC(), diff --git a/sei-ibc-go/modules/core/02-client/abci_test.go b/sei-ibc-go/modules/core/02-client/abci_test.go index 2188f7ae4c..6196f9665a 100644 --- a/sei-ibc-go/modules/core/02-client/abci_test.go +++ b/sei-ibc-go/modules/core/02-client/abci_test.go @@ -3,8 +3,8 @@ package client_test import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" client "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core/02-client" @@ -73,7 +73,7 @@ func (suite *ClientTestSuite) TestBeginBlockerConsensusState() { store.Set(upgradetypes.PlanKey(), bz) nextValsHash := []byte("nextValsHash") - newCtx := suite.chainA.GetContext().WithBlockHeader(tmproto.Header{ + newCtx := suite.chainA.GetContext().WithBlockHeader(sdk.Header{ Height: suite.chainA.GetContext().BlockHeight(), NextValidatorsHash: nextValsHash, }) diff --git a/sei-ibc-go/modules/core/02-client/keeper/keeper_test.go b/sei-ibc-go/modules/core/02-client/keeper/keeper_test.go index 990fdfd850..749071d1f5 100644 --- a/sei-ibc-go/modules/core/02-client/keeper/keeper_test.go +++ b/sei-ibc-go/modules/core/02-client/keeper/keeper_test.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" tmbytes "github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/stretchr/testify/suite" @@ -83,7 +82,7 @@ func (suite *KeeperTestSuite) SetupTest() { app := simapp.Setup(isCheckTx) suite.cdc = app.AppCodec() - suite.ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{Height: height, ChainID: testClientID, Time: now2}) + suite.ctx = app.BaseApp.NewContext(isCheckTx, sdk.Header{Height: height, ChainID: testClientID, Time: now2}) suite.keeper = &app.IBCKeeper.ClientKeeper suite.privVal = ibctestingmock.NewPV() diff --git a/sei-ibc-go/modules/core/05-port/keeper/keeper_test.go b/sei-ibc-go/modules/core/05-port/keeper/keeper_test.go index 12b4e1d557..c1f20bfb01 100644 --- a/sei-ibc-go/modules/core/05-port/keeper/keeper_test.go +++ b/sei-ibc-go/modules/core/05-port/keeper/keeper_test.go @@ -4,7 +4,6 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -28,7 +27,7 @@ func (suite *KeeperTestSuite) SetupTest() { isCheckTx := false app := simapp.Setup(isCheckTx) - suite.ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(isCheckTx, sdk.Header{}) suite.keeper = &app.IBCKeeper.PortKeeper } diff --git a/sei-ibc-go/modules/core/genesis_test.go b/sei-ibc-go/modules/core/genesis_test.go index 1b4d411c79..03b3b7ef7f 100644 --- a/sei-ibc-go/modules/core/genesis_test.go +++ b/sei-ibc-go/modules/core/genesis_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/codec" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" ibc "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core" @@ -320,7 +320,7 @@ func (suite *IBCTestSuite) TestInitGenesis() { app := simapp.Setup(false) suite.NotPanics(func() { - ibc.InitGenesis(app.BaseApp.NewContext(false, tmproto.Header{Height: 1}), *app.IBCKeeper, true, tc.genState) + ibc.InitGenesis(app.BaseApp.NewContext(false, sdk.Header{Height: 1}), *app.IBCKeeper, true, tc.genState) }) } } diff --git a/sei-ibc-go/modules/light-clients/07-tendermint/types/tendermint_test.go b/sei-ibc-go/modules/light-clients/07-tendermint/types/tendermint_test.go index fdf8b670e5..3dcb853167 100644 --- a/sei-ibc-go/modules/light-clients/07-tendermint/types/tendermint_test.go +++ b/sei-ibc-go/modules/light-clients/07-tendermint/types/tendermint_test.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" tmbytes "github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/stretchr/testify/suite" @@ -87,7 +86,7 @@ func (suite *TendermintTestSuite) SetupTest() { suite.valSet = tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) suite.valsHash = suite.valSet.Hash() suite.header = suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1, Time: suite.now}) + suite.ctx = app.BaseApp.NewContext(checkTx, sdk.Header{Height: 1, Time: suite.now}) } func getSuiteSigners(suite *TendermintTestSuite) []tmtypes.PrivValidator { diff --git a/sei-ibc-go/modules/light-clients/09-localhost/types/localhost_test.go b/sei-ibc-go/modules/light-clients/09-localhost/types/localhost_test.go index 3429e7638c..d3558d9475 100644 --- a/sei-ibc-go/modules/light-clients/09-localhost/types/localhost_test.go +++ b/sei-ibc-go/modules/light-clients/09-localhost/types/localhost_test.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" clienttypes "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core/02-client/types" @@ -32,7 +31,7 @@ func (suite *LocalhostTestSuite) SetupTest() { app := simapp.Setup(isCheckTx) suite.cdc = app.AppCodec() - suite.ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{Height: 1, ChainID: "ibc-chain"}) + suite.ctx = app.BaseApp.NewContext(isCheckTx, sdk.Header{Height: 1, ChainID: "ibc-chain"}) suite.store = app.IBCKeeper.ClientKeeper.ClientStore(suite.ctx, exported.Localhost) } diff --git a/sei-ibc-go/testing/chain.go b/sei-ibc-go/testing/chain.go index 536e966f8f..edcabe4e6b 100644 --- a/sei-ibc-go/testing/chain.go +++ b/sei-ibc-go/testing/chain.go @@ -63,7 +63,7 @@ type TestChain struct { App TestingApp ChainID string LastHeader *ibctmtypes.Header // header for last block height committed - CurrentHeader tmproto.Header // header for current block height + CurrentHeader sdk.Header // header for current block height QueryServer types.QueryServer TxConfig client.TxConfig Codec codec.BinaryCodec @@ -124,7 +124,7 @@ func NewTestChainWithValSet(t *testing.T, coord *Coordinator, chainID string, va app := NewTestingAppDecorator(t, simapp.SetupWithGenesisValSet(t, valSet, genAccs, chainID, sdk.DefaultPowerReduction, genBals...)) // create current header and call begin block - header := tmproto.Header{ + header := sdk.Header{ ChainID: chainID, Height: 1, Time: coord.CurrentTime.UTC(), @@ -279,7 +279,7 @@ func (chain *TestChain) NextBlock() { chain.LastHeader = chain.CurrentTMClientHeader() // increment the current header - chain.CurrentHeader = tmproto.Header{ + chain.CurrentHeader = sdk.Header{ ChainID: chain.ChainID, Height: chain.App.LastBlockHeight() + 1, AppHash: chain.App.LastCommitID().Hash, diff --git a/sei-ibc-go/testing/simapp/export.go b/sei-ibc-go/testing/simapp/export.go index 1eb57806eb..5de19ad510 100644 --- a/sei-ibc-go/testing/simapp/export.go +++ b/sei-ibc-go/testing/simapp/export.go @@ -9,7 +9,6 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis @@ -18,7 +17,7 @@ func (app *SimApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, sdk.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. diff --git a/sei-ibc-go/testing/simapp/test_helpers.go b/sei-ibc-go/testing/simapp/test_helpers.go index 3abec8cae4..df08b73ad0 100644 --- a/sei-ibc-go/testing/simapp/test_helpers.go +++ b/sei-ibc-go/testing/simapp/test_helpers.go @@ -304,14 +304,14 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // CheckBalance checks the balance of an account. func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.Coins) { - ctxCheck := app.NewContext(true, tmproto.Header{}) + ctxCheck := app.NewContext(true, sdk.Header{}) require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr))) } // SignAndDeliver signs and delivers a transaction. No simulation occurs as the // ibc testing package causes checkState and deliverState to diverge in block time. func SignAndDeliver( - t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, ibcKeeper *ibckeeper.Keeper, stakingKeeper stakingkeeper.Keeper, capabilityKeeper *capabilitykeeper.Keeper, distrKeeper *distrkeeper.Keeper, slashingKeeper *slashingkeeper.Keeper, evidenceKeeper *evidencekeeper.Keeper, header tmproto.Header, msgs []sdk.Msg, + t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, ibcKeeper *ibckeeper.Keeper, stakingKeeper stakingkeeper.Keeper, capabilityKeeper *capabilitykeeper.Keeper, distrKeeper *distrkeeper.Keeper, slashingKeeper *slashingkeeper.Keeper, evidenceKeeper *evidencekeeper.Keeper, header sdk.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := helpers.GenTx( diff --git a/sei-tendermint/internal/state/execution.go b/sei-tendermint/internal/state/execution.go index 52c3d41565..6d96dce3a3 100644 --- a/sei-tendermint/internal/state/execution.go +++ b/sei-tendermint/internal/state/execution.go @@ -33,7 +33,7 @@ type BlockExecutor struct { blockStore BlockStore // execute the app against this - appClient abci.Application + app abci.Application // events eventBus types.BlockEventPublisher @@ -54,7 +54,7 @@ type BlockExecutor struct { func NewBlockExecutor( stateStore Store, logger log.Logger, - appClient abci.Application, + app abci.Application, pool mempool.Mempool, evpool EvidencePool, blockStore BlockStore, @@ -64,7 +64,7 @@ func NewBlockExecutor( return &BlockExecutor{ eventBus: eventBus, store: stateStore, - appClient: appClient, + app: app, mempool: pool, evpool: evpool, logger: logger, @@ -111,7 +111,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock( txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, maxGasWanted, maxGas) block = state.MakeBlock(height, txs, lastCommit, evidence, proposerAddr) - rpp, err := blockExec.appClient.PrepareProposal( + rpp, err := blockExec.app.PrepareProposal( ctx, &abci.RequestPrepareProposal{ MaxTxBytes: maxDataBytes, @@ -171,7 +171,7 @@ func (blockExec *BlockExecutor) ProcessProposal( state State, ) (bool, error) { txs := block.Txs.ToSliceOfBytes() - resp, err := blockExec.appClient.ProcessProposal(ctx, &abci.RequestProcessProposal{ + resp, err := blockExec.app.ProcessProposal(ctx, &abci.RequestProcessProposal{ Hash: block.Header.Hash(), Height: block.Height, Time: block.Time, @@ -267,7 +267,7 @@ func (blockExec *BlockExecutor) ApplyBlock( } txs := block.Txs.ToSliceOfBytes() finalizeBlockStartTime := time.Now() - fBlockRes, err := blockExec.appClient.FinalizeBlock( + fBlockRes, err := blockExec.app.FinalizeBlock( ctx, &abci.RequestFinalizeBlock{ Hash: block.Hash(), @@ -363,17 +363,13 @@ func (blockExec *BlockExecutor) ApplyBlock( ) // Log per-tx deterministic fields (Code, Data, GasWanted, GasUsed) for debugging for i, txRes := range fBlockRes.TxResults { - dataLen := 0 - if txRes.Data != nil { - dataLen = len(txRes.Data) - } blockExec.logger.Debug("TxResult for LastResultsHash", "height", block.Height, "txIndex", i, "code", txRes.Code, "gasWanted", txRes.GasWanted, "gasUsed", txRes.GasUsed, - "dataLen", dataLen, + "dataLen", len(txRes.Data), ) } } @@ -486,7 +482,7 @@ func (blockExec *BlockExecutor) Commit( // Commit block, get hash back start := time.Now() - res, err := blockExec.appClient.Commit(ctx) + res, err := blockExec.app.Commit(ctx) if err != nil { blockExec.logger.Error("client error during proxyAppConn.Commit", "err", err) return 0, err diff --git a/sei-wasmd/app/app.go b/sei-wasmd/app/app.go index 7c840efea5..d325a04f02 100644 --- a/sei-wasmd/app/app.go +++ b/sei-wasmd/app/app.go @@ -667,7 +667,7 @@ func NewWasmApp( if err := app.LoadLatestVersion(); err != nil { tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) } - ctx := app.NewUncachedContext(true, tmproto.Header{}) + ctx := app.NewUncachedContext(true, sdk.Header{}) // Initialize pinned codes in wasmvm as they are not persisted there if err := app.wasmKeeper.InitializePinnedCodes(ctx); err != nil { diff --git a/sei-wasmd/app/export.go b/sei-wasmd/app/export.go index cdc691b1c1..a76ba7d04d 100644 --- a/sei-wasmd/app/export.go +++ b/sei-wasmd/app/export.go @@ -4,8 +4,6 @@ import ( "encoding/json" "log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -19,7 +17,7 @@ func (app *WasmApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, sdk.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. diff --git a/sei-wasmd/app/test_helpers.go b/sei-wasmd/app/test_helpers.go index b836c56566..f516d93a94 100644 --- a/sei-wasmd/app/test_helpers.go +++ b/sei-wasmd/app/test_helpers.go @@ -304,7 +304,7 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // CheckBalance checks the balance of an account. func CheckBalance(t *testing.T, app *WasmApp, addr sdk.AccAddress, balances sdk.Coins) { - ctxCheck := app.NewContext(true, tmproto.Header{}) + ctxCheck := app.NewContext(true, sdk.Header{}) require.True(t, balances.IsEqual(app.bankKeeper.GetAllBalances(ctxCheck, addr))) } @@ -315,7 +315,7 @@ const DefaultGas = 1200000 // the parameter 'expPass' against the result. A corresponding result is // returned. func SignCheckDeliver( - t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, + t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header sdk.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := seiapp.GenTx( @@ -366,7 +366,7 @@ func SignCheckDeliver( // ibc testing package causes checkState and deliverState to diverge in block time. func SignAndDeliver( t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, - ibcKeeper *ibckeeper.Keeper, stakingKeeper stakingkeeper.Keeper, capabilityKeeper *capabilitykeeper.Keeper, distrKeeper *distrkeeper.Keeper, slashingKeeper *slashingkeeper.Keeper, evidenceKeeper *evidencekeeper.Keeper, header tmproto.Header, msgs []sdk.Msg, + ibcKeeper *ibckeeper.Keeper, stakingKeeper stakingkeeper.Keeper, capabilityKeeper *capabilitykeeper.Keeper, distrKeeper *distrkeeper.Keeper, slashingKeeper *slashingkeeper.Keeper, evidenceKeeper *evidencekeeper.Keeper, header sdk.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := seiapp.GenTx( diff --git a/sei-wasmd/x/wasm/ibctesting/chain.go b/sei-wasmd/x/wasm/ibctesting/chain.go index 497032d88c..f1dde56fd5 100644 --- a/sei-wasmd/x/wasm/ibctesting/chain.go +++ b/sei-wasmd/x/wasm/ibctesting/chain.go @@ -57,7 +57,7 @@ type TestChain struct { App TestingApp ChainID string LastHeader *ibctmtypes.Header // header for last block height committed - CurrentHeader tmproto.Header // header for current block height + CurrentHeader sdk.Header // header for current block height QueryServer types.QueryServer TxConfig client.TxConfig Codec codec.BinaryCodec @@ -145,7 +145,7 @@ func NewTestChain(t *testing.T, coord *Coordinator, chainID string, opts ...wasm app := NewTestingAppDecorator(t, wasmd.SetupWithGenesisValSet(t, chainID, valSet, []authtypes.GenesisAccount{acc}, opts, balance)) // create current header and call begin block - header := tmproto.Header{ + header := sdk.Header{ ChainID: chainID, Height: 1, Time: coord.CurrentTime.UTC(), @@ -260,7 +260,7 @@ func (chain *TestChain) NextBlock() { chain.LastHeader = chain.CurrentTMClientHeader() // increment the current header - chain.CurrentHeader = tmproto.Header{ + chain.CurrentHeader = sdk.Header{ ChainID: chain.ChainID, Height: chain.App.LastBlockHeight() + 1, AppHash: chain.App.LastCommitID().Hash, diff --git a/sei-wasmd/x/wasm/keeper/ante_test.go b/sei-wasmd/x/wasm/keeper/ante_test.go index c0cd02b6b4..f0942101a8 100644 --- a/sei-wasmd/x/wasm/keeper/ante_test.go +++ b/sei-wasmd/x/wasm/keeper/ante_test.go @@ -90,7 +90,7 @@ func TestCountTxDecorator(t *testing.T) { } for name, spec := range specs { t.Run(name, func(t *testing.T) { - ctx := sdk.NewContext(ms.CacheMultiStore(), tmproto.Header{ + ctx := sdk.NewContext(ms.CacheMultiStore(), sdk.Header{ Height: myCurrentBlockHeight, Time: time.Date(2021, time.September, 27, 12, 0, 0, 0, time.UTC), }, false, log.NewNopLogger()) diff --git a/sei-wasmd/x/wasm/keeper/genesis_test.go b/sei-wasmd/x/wasm/keeper/genesis_test.go index 9cff0f2687..71d7dec889 100644 --- a/sei-wasmd/x/wasm/keeper/genesis_test.go +++ b/sei-wasmd/x/wasm/keeper/genesis_test.go @@ -26,7 +26,6 @@ import ( abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/crypto" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" @@ -653,7 +652,7 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) { ms.MountStoreWithDB(tkeyParams, sdk.StoreTypeTransient, db) require.NoError(t, ms.LoadLatestVersion()) - ctx := sdk.NewContext(ms, tmproto.Header{ + ctx := sdk.NewContext(ms, sdk.Header{ Height: 1234567, Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), }, false, log.NewNopLogger()) diff --git a/sei-wasmd/x/wasm/keeper/keeper_test.go b/sei-wasmd/x/wasm/keeper/keeper_test.go index 037137ba88..a0a6d2af28 100644 --- a/sei-wasmd/x/wasm/keeper/keeper_test.go +++ b/sei-wasmd/x/wasm/keeper/keeper_test.go @@ -22,8 +22,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/keeper/wasmtesting" "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types" ) @@ -289,7 +287,7 @@ func TestCreateDuplicate(t *testing.T) { func TestCreateWithSimulation(t *testing.T) { ctx, keepers := CreateTestInput(t, false, SupportedFeatures) - ctx = ctx.WithBlockHeader(tmproto.Header{Height: 1}). + ctx = ctx.WithBlockHeader(sdk.Header{Height: 1}). WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) @@ -321,15 +319,15 @@ func TestIsSimulationMode(t *testing.T) { exp bool }{ "genesis block": { - ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{}).WithGasMeter(sdk.NewInfiniteGasMeter(1, 1)), + ctx: sdk.Context{}.WithBlockHeader(sdk.Header{}).WithGasMeter(sdk.NewInfiniteGasMeter(1, 1)), exp: false, }, "any regular block": { - ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{Height: 1}).WithGasMeter(sdk.NewGasMeter(10000000, 1, 1)), + ctx: sdk.Context{}.WithBlockHeader(sdk.Header{Height: 1}).WithGasMeter(sdk.NewGasMeter(10000000, 1, 1)), exp: false, }, "simulation": { - ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{Height: 1}).WithGasMeter(sdk.NewInfiniteGasMeter(1, 1)), + ctx: sdk.Context{}.WithBlockHeader(sdk.Header{Height: 1}).WithGasMeter(sdk.NewInfiniteGasMeter(1, 1)), exp: true, }, } diff --git a/sei-wasmd/x/wasm/keeper/snapshotter.go b/sei-wasmd/x/wasm/keeper/snapshotter.go index cfc9447a5e..60bca1dd83 100644 --- a/sei-wasmd/x/wasm/keeper/snapshotter.go +++ b/sei-wasmd/x/wasm/keeper/snapshotter.go @@ -12,7 +12,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protoio "github.com/gogo/protobuf/io" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/ioutils" "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types" @@ -58,7 +57,7 @@ func (ws *WasmSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) e } defer cacheMS.Close() - ctx := sdk.NewContext(cacheMS, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cacheMS, sdk.Header{}, false, log.NewNopLogger()) seenBefore := make(map[string]bool) var rerr error @@ -148,7 +147,7 @@ func (ws *WasmSnapshotter) processAllItems( return snapshot.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrInvalidHeight, "height %d exceeds max int64", height) } // #nosec G115 -- height is bounds checked above - ctx := sdk.NewContext(ws.cms, tmproto.Header{Height: int64(height)}, false, log.NewNopLogger()) + ctx := sdk.NewContext(ws.cms, sdk.Header{Height: int64(height)}, false, log.NewNopLogger()) // keep the last item here... if we break, it will either be empty (if we hit io.EOF) // or contain the last item (if we hit payload == nil) diff --git a/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go b/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go index f94ce8988d..820901cb8e 100644 --- a/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go +++ b/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go @@ -16,7 +16,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/stretchr/testify/require" @@ -44,7 +43,7 @@ func TestSnapshotter(t *testing.T) { srcWasmApp, genesisAddr := newWasmExampleApp(t) // store wasm codes on chain - ctx := srcWasmApp.NewUncachedContext(false, tmproto.Header{ + ctx := srcWasmApp.NewUncachedContext(false, sdk.Header{ ChainID: "foo", Height: srcWasmApp.LastBlockHeight() + 1, Time: time.Now(), @@ -85,7 +84,7 @@ func TestSnapshotter(t *testing.T) { // then all wasm contracts are imported wasmKeeper = app.NewTestSupport(t, destWasmApp).WasmKeeper() - ctx = destWasmApp.NewUncachedContext(false, tmproto.Header{ + ctx = destWasmApp.NewUncachedContext(false, sdk.Header{ ChainID: "foo", Height: destWasmApp.LastBlockHeight() + 1, Time: time.Now(), diff --git a/sei-wasmd/x/wasm/keeper/test_common.go b/sei-wasmd/x/wasm/keeper/test_common.go index 4ef7a79e38..172e7ddd79 100644 --- a/sei-wasmd/x/wasm/keeper/test_common.go +++ b/sei-wasmd/x/wasm/keeper/test_common.go @@ -59,7 +59,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/rand" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/mint" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/require" @@ -227,7 +226,7 @@ func createTestInput( require.NoError(t, ms.LoadLatestVersion()) - ctx := sdk.NewContext(ms, tmproto.Header{ + ctx := sdk.NewContext(ms, sdk.Header{ Height: 1234567, Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), }, isCheckTx, log.NewNopLogger()) diff --git a/testutil/keeper/epoch.go b/testutil/keeper/epoch.go index 0adf9b751c..6bd0631de1 100644 --- a/testutil/keeper/epoch.go +++ b/testutil/keeper/epoch.go @@ -11,7 +11,6 @@ import ( typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/epoch/keeper" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" @@ -48,7 +47,7 @@ func EpochKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { paramsSubspace, ) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(stateStore, sdk.Header{}, false, log.NewNopLogger()) // Initialize params k.SetParams(ctx, types.DefaultParams()) diff --git a/x/epoch/handler_test.go b/x/epoch/handler_test.go index feba020359..ab6c767382 100644 --- a/x/epoch/handler_test.go +++ b/x/epoch/handler_test.go @@ -4,12 +4,12 @@ import ( "fmt" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/epoch" "github.com/sei-protocol/sei-chain/x/epoch/types" ) @@ -20,7 +20,7 @@ func TestNewHandler(t *testing.T) { // Test unrecognized message type testMsg := testdata.NewTestMsg() - _, err := handler(app.BaseApp.NewContext(false, tmproto.Header{}), testMsg) + _, err := handler(app.BaseApp.NewContext(false, sdk.Header{}), testMsg) require.Error(t, err) expectedErrMsg := fmt.Sprintf("unrecognized %s message type", types.ModuleName) diff --git a/x/epoch/keeper/epoch_test.go b/x/epoch/keeper/epoch_test.go index 0b9a4197e2..17657326c1 100644 --- a/x/epoch/keeper/epoch_test.go +++ b/x/epoch/keeper/epoch_test.go @@ -4,15 +4,15 @@ import ( "testing" "time" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" ) func TestEpochKeeper(t *testing.T) { app := app.Setup(t, false, false, false) // Your setup function here - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) // Define an epoch currentTime := time.Now().UTC() diff --git a/x/epoch/module_test.go b/x/epoch/module_test.go index be72df6942..e6b7b243e1 100644 --- a/x/epoch/module_test.go +++ b/x/epoch/module_test.go @@ -9,7 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" epoch "github.com/sei-protocol/sei-chain/x/epoch" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" @@ -61,7 +60,7 @@ func TestExportGenesis(t *testing.T) { app.AccountKeeper, app.BankKeeper, ) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) require.NotNil(t, appModule.ExportGenesis(ctx, app.AppCodec())) } @@ -79,7 +78,7 @@ func TestBeginBlock(t *testing.T) { t.Parallel() // Create a mock context and keeper app := app.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) now := time.Now() ctx = ctx.WithBlockTime(now) diff --git a/x/epoch/types/hooks_test.go b/x/epoch/types/hooks_test.go index fc009be80d..c4e3c8be5e 100644 --- a/x/epoch/types/hooks_test.go +++ b/x/epoch/types/hooks_test.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/epoch/keeper" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" @@ -59,7 +58,7 @@ func TestMultiHooks(t *testing.T) { db := tmdb.NewMemDB() ms := store.NewCommitMultiStore(db) - ctx := sdk.NewContext(ms, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(ms, sdk.Header{}, false, nil) epoch := types.Epoch{} multiHooks.AfterEpochEnd(ctx, epoch) @@ -83,7 +82,7 @@ func TestMultiHooks_Panic(t *testing.T) { db := tmdb.NewMemDB() ms := store.NewCommitMultiStore(db) - ctx := sdk.NewContext(ms, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(ms, sdk.Header{}, false, nil) epoch := types.Epoch{} multiHooks.AfterEpochEnd(ctx, epoch) diff --git a/x/evm/artifacts/native/artifacts_test.go b/x/evm/artifacts/native/artifacts_test.go index 7fb701d251..55ca5b58ec 100644 --- a/x/evm/artifacts/native/artifacts_test.go +++ b/x/evm/artifacts/native/artifacts_test.go @@ -10,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/artifacts/native" @@ -29,7 +28,7 @@ func TestSimple(t *testing.T) { contractData := append(bytecode, args...) testApp := testkeeper.EVMTestApp - ctx := testApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) k := &testApp.EvmKeeper privKey := testkeeper.MockPrivateKey() testPrivHex := hex.EncodeToString(privKey.Bytes()) diff --git a/x/evm/keeper/evm_test.go b/x/evm/keeper/evm_test.go index 90d0c6e99e..a243c78b8f 100644 --- a/x/evm/keeper/evm_test.go +++ b/x/evm/keeper/evm_test.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" @@ -25,7 +24,7 @@ func TestInternalCallCreateContract(t *testing.T) { contractData := append(bytecode, args...) k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2).WithTxSum([32]byte{1, 2, 3}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}).WithBlockHeight(2).WithTxSum([32]byte{1, 2, 3}) testAddr, _ := testkeeper.MockAddressPair() amt := sdk.NewCoins(sdk.NewCoin(k.GetBaseDenom(ctx), sdk.NewInt(200000000))) require.Nil(t, k.BankKeeper().MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(k.GetBaseDenom(ctx), sdk.NewInt(200000000))))) @@ -59,7 +58,7 @@ func TestInternalCall(t *testing.T) { contractData := append(bytecode, args...) k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) testAddr, senderEvmAddr := testkeeper.MockAddressPair() k.SetAddressMapping(ctx, testAddr, senderEvmAddr) amt := sdk.NewCoins(sdk.NewCoin(k.GetBaseDenom(ctx), sdk.NewInt(200000000))) @@ -110,7 +109,7 @@ func TestStaticCall(t *testing.T) { contractData := append(bytecode, args...) k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) testAddr, senderEvmAddr := testkeeper.MockAddressPair() k.SetAddressMapping(ctx, testAddr, senderEvmAddr) amt := sdk.NewCoins(sdk.NewCoin(k.GetBaseDenom(ctx), sdk.NewInt(2000))) @@ -142,7 +141,7 @@ func TestNegativeTransfer(t *testing.T) { steal_amount := int64(1_000_000_000_000) k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) attackerAddr, attackerEvmAddr := testkeeper.MockAddressPair() victimAddr, victimEvmAddr := testkeeper.MockAddressPair() @@ -192,7 +191,7 @@ func TestNegativeTransfer(t *testing.T) { func TestHandleInternalEVMDelegateCall_AssociationError(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}).WithBlockHeight(2) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}).WithBlockHeight(2) testAddr, _ := testkeeper.MockAddressPair() cwAddr, contractAddr := testkeeper.MockAddressPair() castedAddr := common.BytesToAddress(cwAddr.Bytes()) diff --git a/x/evm/migrations/add_new_param_migration_test.go b/x/evm/migrations/add_new_param_migration_test.go index 4ed81710cd..d4e99bbee5 100644 --- a/x/evm/migrations/add_new_param_migration_test.go +++ b/x/evm/migrations/add_new_param_migration_test.go @@ -3,7 +3,7 @@ package migrations_test import ( "testing" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/stretchr/testify/require" @@ -11,7 +11,7 @@ import ( func TestAddNewParamsAndSetAllToDefaults(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) migrations.AddNewParamsAndSetAllToDefaults(ctx, &k) require.NotPanics(t, func() { k.GetParams(ctx) }) } diff --git a/x/evm/migrations/disable_register_pointer_test.go b/x/evm/migrations/disable_register_pointer_test.go index d95429d5be..47f9a3e92e 100644 --- a/x/evm/migrations/disable_register_pointer_test.go +++ b/x/evm/migrations/disable_register_pointer_test.go @@ -3,7 +3,7 @@ package migrations_test import ( "testing" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/stretchr/testify/require" @@ -11,7 +11,7 @@ import ( func TestMigrateDisableRegisterPointer(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) migrations.MigrateDisableRegisterPointer(ctx, &k) require.NotPanics(t, func() { k.GetParams(ctx) }) } diff --git a/x/evm/migrations/migrate_deliver_tx_gas_limit_test.go b/x/evm/migrations/migrate_deliver_tx_gas_limit_test.go index 37d0904731..bfd05192e5 100644 --- a/x/evm/migrations/migrate_deliver_tx_gas_limit_test.go +++ b/x/evm/migrations/migrate_deliver_tx_gas_limit_test.go @@ -3,7 +3,7 @@ package migrations_test import ( "testing" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/sei-protocol/sei-chain/x/evm/types" @@ -12,7 +12,7 @@ import ( func TestMigrateDeliverTxHookWasmGasLimitParam(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) currParams := k.GetParams(ctx) diff --git a/x/evm/migrations/migrate_eip_1559_max_base_fee_test.go b/x/evm/migrations/migrate_eip_1559_max_base_fee_test.go index 541cb3daef..3fc0bac0ea 100644 --- a/x/evm/migrations/migrate_eip_1559_max_base_fee_test.go +++ b/x/evm/migrations/migrate_eip_1559_max_base_fee_test.go @@ -4,7 +4,6 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/stretchr/testify/require" @@ -12,7 +11,7 @@ import ( func TestMigrateEip1559MaxBaseFee(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) keeperParams := k.GetParams(ctx) keeperParams.MaximumFeePerGas = sdk.NewDec(123) diff --git a/x/evm/migrations/migrate_eip_1559_params_test.go b/x/evm/migrations/migrate_eip_1559_params_test.go index 5f60fa6b87..4243699771 100644 --- a/x/evm/migrations/migrate_eip_1559_params_test.go +++ b/x/evm/migrations/migrate_eip_1559_params_test.go @@ -4,7 +4,6 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/sei-protocol/sei-chain/x/evm/types" @@ -13,7 +12,7 @@ import ( func TestMigrateEip1559Params(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) keeperParams := k.GetParams(ctx) keeperParams.BaseFeePerGas = sdk.NewDec(123) diff --git a/x/evm/migrations/migrate_remove_tx_hashes_test.go b/x/evm/migrations/migrate_remove_tx_hashes_test.go index adf5ad970b..463d0a5560 100644 --- a/x/evm/migrations/migrate_remove_tx_hashes_test.go +++ b/x/evm/migrations/migrate_remove_tx_hashes_test.go @@ -3,7 +3,7 @@ package migrations_test import ( "testing" - tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/evm/migrations" "github.com/sei-protocol/sei-chain/x/evm/types" @@ -12,7 +12,7 @@ import ( func TestRemoveTxHashes(t *testing.T) { k := testkeeper.EVMTestApp.EvmKeeper - ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) + ctx := testkeeper.EVMTestApp.NewContext(false, sdk.Header{}) store := ctx.KVStore(k.GetStoreKey()) store.Set(types.TxHashesKey(1), []byte{1}) store.Set(types.TxHashesKey(2), []byte{2}) diff --git a/x/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index 66ba4530a4..c6602fd837 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/testutil/nullify" "github.com/sei-protocol/sei-chain/x/mint/types" @@ -14,7 +14,7 @@ import ( func TestGenesis(t *testing.T) { app := app.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) now := time.Now() diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index 92b5f4d175..bc87433e1a 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -8,7 +8,6 @@ import ( "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -26,7 +25,7 @@ type MintTestSuite struct { func (suite *MintTestSuite) SetupTest() { app := app.Setup(suite.T(), false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) diff --git a/x/mint/keeper/hooks_test.go b/x/mint/keeper/hooks_test.go index 68babb0be3..a6056b4bab 100644 --- a/x/mint/keeper/hooks_test.go +++ b/x/mint/keeper/hooks_test.go @@ -4,14 +4,13 @@ import ( "testing" "time" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app/legacyabci" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/x/epoch/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/require" - - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" ) func getGenesisTime() time.Time { @@ -34,9 +33,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("Initial should be zero", func(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{ + header := sdk.Header{ Height: seiApp.LastBlockHeight() + 1, Time: time.Now().UTC(), } @@ -46,9 +45,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("even full release", func(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{ + header := sdk.Header{ Height: seiApp.LastBlockHeight() + 1, Time: time.Now().UTC(), } @@ -91,9 +90,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("uneven full release", func(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{ + header := sdk.Header{ Height: seiApp.LastBlockHeight() + 1, Time: time.Now().UTC(), } @@ -137,9 +136,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("multiple full releases", func(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{ + header := sdk.Header{ Height: seiApp.LastBlockHeight() + 1, Time: time.Now().UTC(), } @@ -195,9 +194,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("outage during release", func(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{ + header := sdk.Header{ Height: seiApp.LastBlockHeight() + 1, Time: time.Now().UTC(), } @@ -269,9 +268,9 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { func TestNoEpochPassedNoDistribution(t *testing.T) { seiApp := keepertest.TestApp(t) - ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx := seiApp.BaseApp.NewContext(false, sdk.Header{Time: time.Now()}) - header := tmproto.Header{Height: seiApp.LastBlockHeight() + 1} + header := sdk.Header{Height: seiApp.LastBlockHeight() + 1} legacyabci.BeginBlock(ctx, header.Height, []abci.VoteInfo{}, []abci.Misbehavior{}, seiApp.BeginBlockKeepers) // Get mint params mintParams := seiApp.MintKeeper.GetParams(ctx) diff --git a/x/mint/keeper/integration_test.go b/x/mint/keeper/integration_test.go index a95fa0bde6..6d707ebd12 100644 --- a/x/mint/keeper/integration_test.go +++ b/x/mint/keeper/integration_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/x/mint/types" @@ -14,7 +13,7 @@ import ( func createTestApp(t *testing.T, isCheckTx bool) (*app.App, sdk.Context) { app := app.Setup(t, isCheckTx, false, false) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, sdk.Header{}) app.MintKeeper.SetParams(ctx, types.DefaultParams()) app.MintKeeper.SetMinter(ctx, types.DefaultInitialMinter()) diff --git a/x/mint/keeper/migrations_test.go b/x/mint/keeper/migrations_test.go index af62a79dbd..c7e9ffcee3 100644 --- a/x/mint/keeper/migrations_test.go +++ b/x/mint/keeper/migrations_test.go @@ -12,7 +12,6 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/mint/keeper" "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/require" @@ -57,7 +56,7 @@ func TestMigrate2to3(t *testing.T) { memStoreKey, "MintParams", ) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(stateStore, sdk.Header{}, false, log.NewNopLogger()) if !paramsSubspace.HasKeyTable() { paramsSubspace = paramsSubspace.WithKeyTable(paramtypes.NewKeyTable().RegisterParamSet(&types.Version2Params{})) } diff --git a/x/mint/module_test.go b/x/mint/module_test.go index f40441366c..1dee89304c 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -3,7 +3,7 @@ package mint_test import ( "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -15,7 +15,7 @@ import ( func TestNewProposalHandler(t *testing.T) { app := app.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) app.MintKeeper.SetParams(ctx, types.DefaultParams()) app.MintKeeper.SetMinter(ctx, types.DefaultInitialMinter()) diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index 53b156a6bf..63c5f68716 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -4,8 +4,6 @@ import ( "testing" "time" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app" epochTypes "github.com/sei-protocol/sei-chain/x/epoch/types" @@ -422,7 +420,7 @@ func TestRecordSuccessfulMint(t *testing.T) { 1000, ) app := app.Setup(t, false, false, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, sdk.Header{}) currentTime := time.Now().UTC() epoch := epochTypes.Epoch{ diff --git a/x/oracle/ante_test.go b/x/oracle/ante_test.go index fac0e9789d..4cf3444784 100644 --- a/x/oracle/ante_test.go +++ b/x/oracle/ante_test.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/sei-protocol/sei-chain/app" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/oracle" "github.com/sei-protocol/sei-chain/x/oracle/keeper/testutils" "github.com/sei-protocol/sei-chain/x/oracle/types" @@ -35,7 +34,7 @@ func TestOracleVoteAloneAnteHandler(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - _, err := anteHandler(sdk.NewContext(nil, tmproto.Header{}, false, nil), tc.tx, false) + _, err := anteHandler(sdk.NewContext(nil, sdk.Header{}, false, nil), tc.tx, false) if tc.expErr { require.Error(t, err) } else { diff --git a/x/oracle/keeper/testutils/test_utils.go b/x/oracle/keeper/testutils/test_utils.go index 5661494802..c8248d63fe 100644 --- a/x/oracle/keeper/testutils/test_utils.go +++ b/x/oracle/keeper/testutils/test_utils.go @@ -13,7 +13,6 @@ import ( "github.com/stretchr/testify/require" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/codec" @@ -148,7 +147,7 @@ func CreateTestInput(t *testing.T) TestInput { db := dbm.NewMemDB() ms := store.NewCommitMultiStore(db) - ctx := sdk.NewContext(ms, tmproto.Header{Time: time.Now().UTC()}, false, log.NewNopLogger()) + ctx := sdk.NewContext(ms, sdk.Header{Time: time.Now().UTC()}, false, log.NewNopLogger()) encodingConfig := MakeEncodingConfig(t) appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino diff --git a/x/oracle/types/ballot_test.go b/x/oracle/types/ballot_test.go index c32285d167..091ffe24fd 100755 --- a/x/oracle/types/ballot_test.go +++ b/x/oracle/types/ballot_test.go @@ -12,8 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" - "github.com/sei-protocol/sei-chain/x/oracle/utils" ) @@ -106,7 +104,7 @@ func TestSqrt(t *testing.T) { } func TestPBPower(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil) + ctx := sdk.NewContext(nil, sdk.Header{}, false, nil) _, valAccAddrs, sk := GenerateRandomTestCase() pb := ExchangeRateBallot{} ballotPower := int64(0) diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index e4ec747cdf..518e2cc424 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -1,8 +1,8 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/tokenfactory/types" ) @@ -31,7 +31,7 @@ func (suite *KeeperTestSuite) TestGenesis() { }, } app := suite.App - suite.Ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.Ctx = app.BaseApp.NewContext(false, sdk.Header{}) // Test both with bank denom metadata set, and not set. for i, denom := range genesisState.FactoryDenoms { // hacky, sets bank metadata to exist if i != 0, to cover both cases. diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index f1be27988c..7ed3138b71 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -1,11 +1,10 @@ package keeper_test import ( - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "testing" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/suite" "github.com/sei-protocol/sei-chain/app/apptesting" @@ -50,7 +49,7 @@ func (suite *KeeperTestSuite) TestCreateModuleAccount() { app.AccountKeeper.RemoveAccount(suite.Ctx, tokenfactoryModuleAccount) // ensure module account was removed - suite.Ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.Ctx = app.BaseApp.NewContext(false, sdk.Header{}) tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) suite.Require().Nil(tokenfactoryModuleAccount) diff --git a/x/tokenfactory/keeper/migrations_test.go b/x/tokenfactory/keeper/migrations_test.go index 8e4d195c71..a7002b7bf7 100644 --- a/x/tokenfactory/keeper/migrations_test.go +++ b/x/tokenfactory/keeper/migrations_test.go @@ -14,7 +14,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/sei-protocol/sei-chain/x/tokenfactory/types" "github.com/stretchr/testify/require" tmdb "github.com/tendermint/tm-db" @@ -48,7 +47,7 @@ func TestMigrate2to3(t *testing.T) { oldCreateDenomFeeWhitelistPrefix := []byte(strings.Join([]string{oldCreateDenomFeeWhitelistKey, ""}, KeySeparator)) oldCreatorSpecificPrefix := []byte(strings.Join([]string{oldCreateDenomFeeWhitelistKey, "creator", ""}, KeySeparator)) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(stateStore, sdk.Header{}, false, log.NewNopLogger()) if !paramsSubspace.HasKeyTable() { paramsSubspace = paramsSubspace.WithKeyTable(types.ParamKeyTable()) } @@ -98,7 +97,7 @@ func TestMigrate3To4(t *testing.T) { func TestMigrate4To5(t *testing.T) { stateStore, keeper := getStoreAndKeeper(t) m := NewMigrator(keeper) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(stateStore, sdk.Header{}, false, log.NewNopLogger()) err := m.Migrate4to5(ctx) require.NoError(t, err) require.NotPanics(t, func() { m.keeper.GetParams(ctx) })