From 326a4949932a3035a4443369e8f87ea57888f9a0 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 18:33:43 +0100 Subject: [PATCH 01/16] removed abstraction from node.New --- sei-tendermint/node/node.go | 1 - sei-tendermint/node/node_test.go | 1 - sei-tendermint/node/public.go | 25 ++++++++++++------------- sei-tendermint/node/seed.go | 4 +++- sei-tendermint/rpc/test/helpers.go | 4 +--- sei-tendermint/test/e2e/node/main.go | 3 +-- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/sei-tendermint/node/node.go b/sei-tendermint/node/node.go index 9456fe0339..29e164adca 100644 --- a/sei-tendermint/node/node.go +++ b/sei-tendermint/node/node.go @@ -104,7 +104,6 @@ func newDefaultNode( config.DefaultDBProvider, nodeKey, defaultGenesisDocProviderFunc(cfg), - appClient, DefaultMetricsProvider(cfg.Instrumentation)(cfg.ChainID()), ) } diff --git a/sei-tendermint/node/node_test.go b/sei-tendermint/node/node_test.go index 4a03851a25..c985015de8 100644 --- a/sei-tendermint/node/node_test.go +++ b/sei-tendermint/node/node_test.go @@ -590,7 +590,6 @@ func TestNodeNewSeedNode(t *testing.T) { config.DefaultDBProvider, nodeKey, defaultGenesisDocProviderFunc(cfg), - abciclient.NewLocalClient(logger, kvstore.NewApplication()), DefaultMetricsProvider(cfg.Instrumentation)(cfg.ChainID()), ) t.Cleanup(ns.Wait) diff --git a/sei-tendermint/node/public.go b/sei-tendermint/node/public.go index 5d378620bc..18bb17876d 100644 --- a/sei-tendermint/node/public.go +++ b/sei-tendermint/node/public.go @@ -6,11 +6,12 @@ import ( "fmt" abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" + abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/service" "github.com/sei-protocol/sei-chain/sei-tendermint/privval" - "github.com/sei-protocol/sei-chain/sei-tendermint/types" + tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "go.opentelemetry.io/otel/sdk/trace" ) @@ -27,23 +28,22 @@ func NewDefault( return newDefaultNode(ctx, conf, logger, restartEvent) } -// New constructs a tendermint node. The ClientCreator makes it -// possible to construct an ABCI application that runs in the same -// process as the tendermint node. The final option is a pointer to a -// Genesis document: if the value is nil, the genesis document is read -// from the file specified in the config, and otherwise the node uses -// value of the final argument. +// New constructs a tendermint node. The provided app runs in the same +// process as the tendermint node and will be wrapped in a local ABCI client +// inside this function. The final option is a pointer to a Genesis document: +// if the value is nil, the genesis document is read from the file specified +// in the config, and otherwise the node uses value of the final argument. func New( ctx context.Context, conf *config.Config, logger log.Logger, restartEvent func(), - cf abciclient.Client, - gen *types.GenesisDoc, + app abci.Application, + gen *tmtypes.GenesisDoc, tracerProviderOptions []trace.TracerProviderOption, nodeMetrics *NodeMetrics, ) (service.Service, error) { - nodeKey, err := types.LoadOrGenNodeKey(conf.NodeKeyFile()) + nodeKey, err := tmtypes.LoadOrGenNodeKey(conf.NodeKeyFile()) if err != nil { return nil, fmt.Errorf("failed to load or gen node key %s: %w", conf.NodeKeyFile(), err) } @@ -53,7 +53,7 @@ func New( case nil: genProvider = defaultGenesisDocProviderFunc(conf) default: - genProvider = func() (*types.GenesisDoc, error) { return gen, nil } + genProvider = func() (*tmtypes.GenesisDoc, error) { return gen, nil } } switch conf.Mode { @@ -69,7 +69,7 @@ func New( restartEvent, pval, nodeKey, - cf, + abciclient.NewLocalClient(logger, app), genProvider, config.DefaultDBProvider, logger, @@ -83,7 +83,6 @@ func New( config.DefaultDBProvider, nodeKey, genProvider, - cf, nodeMetrics, ) default: diff --git a/sei-tendermint/node/seed.go b/sei-tendermint/node/seed.go index d027fa5630..bbb46f8137 100644 --- a/sei-tendermint/node/seed.go +++ b/sei-tendermint/node/seed.go @@ -9,6 +9,7 @@ import ( "time" abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" + abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p" @@ -51,13 +52,14 @@ func makeSeedNode( dbProvider config.DBProvider, nodeKey types.NodeKey, genesisDocProvider genesisDocProvider, - client abciclient.Client, nodeMetrics *NodeMetrics, ) (service.Service, error) { if !cfg.P2P.PexReactor { return nil, errors.New("cannot run seed nodes with PEX disabled") } + client := abciclient.NewLocalClient(logger, abci.NewBaseApplication()) + genDoc, err := genesisDocProvider() if err != nil { return nil, err diff --git a/sei-tendermint/rpc/test/helpers.go b/sei-tendermint/rpc/test/helpers.go index 0669b5a036..7d8bcba7ca 100644 --- a/sei-tendermint/rpc/test/helpers.go +++ b/sei-tendermint/rpc/test/helpers.go @@ -7,7 +7,6 @@ import ( "testing" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" @@ -99,13 +98,12 @@ func StartTendermint( } } - papp := abciclient.NewLocalClient(logger, app) tmNode, err := node.New( ctx, conf, logger, func() {}, - papp, + app, nil, []trace.TracerProviderOption{}, node.NoOpMetricsProvider(), diff --git a/sei-tendermint/test/e2e/node/main.go b/sei-tendermint/test/e2e/node/main.go index d68c888bba..fb2b254069 100644 --- a/sei-tendermint/test/e2e/node/main.go +++ b/sei-tendermint/test/e2e/node/main.go @@ -15,7 +15,6 @@ import ( "go.opentelemetry.io/otel/sdk/trace" "google.golang.org/grpc" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p" @@ -133,7 +132,7 @@ func startNode(ctx context.Context, cfg *Config) error { tmcfg, nodeLogger, func() {}, - abciclient.NewLocalClient(nodeLogger, app), + app, nil, []trace.TracerProviderOption{}, nil, From 193c447f3abffb40c51345ceb48dc2bb0c28bc88 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 18:48:57 +0100 Subject: [PATCH 02/16] removed dependency on default node --- sei-tendermint/node/node_test.go | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/sei-tendermint/node/node_test.go b/sei-tendermint/node/node_test.go index c985015de8..b1a3326391 100644 --- a/sei-tendermint/node/node_test.go +++ b/sei-tendermint/node/node_test.go @@ -40,6 +40,19 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/types" ) +func newLocalNodeService(ctx context.Context, cfg *config.Config, logger log.Logger) (service.Service, error) { + return New( + ctx, + cfg, + logger, + func() {}, + kvstore.NewApplication(), + nil, + nil, + DefaultMetricsProvider(cfg.Instrumentation)(cfg.ChainID()), + ) +} + func TestNodeStartStop(t *testing.T) { cfg, err := config.ResetTestRoot(t.TempDir(), "node_node_test") require.NoError(t, err) @@ -50,7 +63,7 @@ func TestNodeStartStop(t *testing.T) { logger := log.NewNopLogger() // create & start node - ns, err := newDefaultNode(ctx, cfg, logger, func() {}) + ns, err := newLocalNodeService(ctx, cfg, logger) require.NoError(t, err) n, ok := ns.(*nodeImpl) @@ -83,7 +96,7 @@ func TestNodeStartStop(t *testing.T) { func getTestNode(ctx context.Context, t *testing.T, conf *config.Config, logger log.Logger) *nodeImpl { t.Helper() - ns, err := newDefaultNode(ctx, conf, logger, func() {}) + ns, err := newLocalNodeService(ctx, conf, logger) require.NoError(t, err) n, ok := ns.(*nodeImpl) @@ -200,7 +213,9 @@ func TestPrivValidatorListenAddrNoProtocol(t *testing.T) { logger := log.NewNopLogger() - n, err := newDefaultNode(ctx, cfg, logger, func() {}) + ns, err := newLocalNodeService(ctx, cfg, logger) + + n, _ := ns.(*nodeImpl) assert.Error(t, err) @@ -666,7 +681,7 @@ func TestNodeSetEventSink(t *testing.T) { assert.Equal(t, indexer.NULL, eventSinks[0].Type()) cfg.TxIndex.Indexer = []string{"kvv"} - ns, err := newDefaultNode(ctx, cfg, logger, func() {}) + ns, err := newLocalNodeService(ctx, cfg, logger) assert.Nil(t, ns) assert.Contains(t, err.Error(), "unsupported event sink type") t.Cleanup(cleanup(ns)) @@ -678,7 +693,7 @@ func TestNodeSetEventSink(t *testing.T) { assert.Equal(t, indexer.NULL, eventSinks[0].Type()) cfg.TxIndex.Indexer = []string{"psql"} - ns, err = newDefaultNode(ctx, cfg, logger, func() {}) + ns, err = newLocalNodeService(ctx, cfg, logger) assert.Nil(t, ns) assert.Contains(t, err.Error(), "the psql connection settings cannot be empty") t.Cleanup(cleanup(ns)) @@ -688,13 +703,13 @@ func TestNodeSetEventSink(t *testing.T) { var e = errors.New("found duplicated sinks, please check the tx-index section in the config.toml") cfg.TxIndex.Indexer = []string{"null", "kv", "Kv"} - ns, err = newDefaultNode(ctx, cfg, logger, func() {}) + ns, err = newLocalNodeService(ctx, cfg, logger) require.Error(t, err) assert.Contains(t, err.Error(), e.Error()) t.Cleanup(cleanup(ns)) cfg.TxIndex.Indexer = []string{"Null", "kV", "kv", "nUlL"} - ns, err = newDefaultNode(ctx, cfg, logger, func() {}) + ns, err = newLocalNodeService(ctx, cfg, logger) require.Error(t, err) assert.Contains(t, err.Error(), e.Error()) t.Cleanup(cleanup(ns)) From 6444c32bc95099b4e6009e8fc5fefdf364c05ff4 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 19:28:21 +0100 Subject: [PATCH 03/16] removed tendermint binary --- .../cmd/tendermint/commands/compact.go | 71 ---- .../cmd/tendermint/commands/init.go | 125 ------- .../cmd/tendermint/commands/reset_test.go | 23 +- .../cmd/tendermint/commands/rollback.go | 55 --- .../cmd/tendermint/commands/rollback_test.go | 79 ----- .../cmd/tendermint/commands/root.go | 69 ---- .../cmd/tendermint/commands/root_test.go | 186 ---------- .../cmd/tendermint/commands/run_node.go | 81 ----- .../cmd/tendermint/commands/show_node_id.go | 26 -- .../cmd/tendermint/commands/show_validator.go | 83 ----- .../cmd/tendermint/commands/testnet.go | 332 ------------------ .../cmd/tendermint/commands/version.go | 18 - sei-tendermint/cmd/tendermint/main.go | 65 ---- sei-tendermint/config/db.go | 8 - 14 files changed, 17 insertions(+), 1204 deletions(-) delete mode 100644 sei-tendermint/cmd/tendermint/commands/compact.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/init.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/rollback_test.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/root.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/root_test.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/show_node_id.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/show_validator.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/testnet.go delete mode 100644 sei-tendermint/cmd/tendermint/commands/version.go delete mode 100644 sei-tendermint/cmd/tendermint/main.go diff --git a/sei-tendermint/cmd/tendermint/commands/compact.go b/sei-tendermint/cmd/tendermint/commands/compact.go deleted file mode 100644 index f5bbe3bad4..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/compact.go +++ /dev/null @@ -1,71 +0,0 @@ -package commands - -import ( - "errors" - "path/filepath" - "sync" - - "github.com/spf13/cobra" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/opt" - "github.com/syndtr/goleveldb/leveldb/util" - - "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" -) - -func MakeCompactDBCommand(cfg *config.Config, logger log.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "experimental-compact-goleveldb", - Short: "force compacts the tendermint storage engine (only GoLevelDB supported)", - Long: ` -This is a temporary utility command that performs a force compaction on the state -and blockstores to reduce disk space for a pruning node. This should only be run -once the node has stopped. This command will likely be omitted in the future after -the planned refactor to the storage engine. - -Currently, only GoLevelDB is supported. - `, - RunE: func(cmd *cobra.Command, args []string) error { - if cfg.DBBackend != "goleveldb" { - return errors.New("compaction is currently only supported with goleveldb") - } - - compactGoLevelDBs(cfg.RootDir, logger) - return nil - }, - } - - return cmd -} - -func compactGoLevelDBs(rootDir string, logger log.Logger) { - dbNames := []string{"state", "blockstore"} - o := &opt.Options{ - DisableSeeksCompaction: true, - } - wg := sync.WaitGroup{} - - for _, dbName := range dbNames { - dbName := dbName - wg.Add(1) - go func() { - defer wg.Done() - dbPath := filepath.Join(rootDir, "data", dbName+".db") - store, err := leveldb.OpenFile(dbPath, o) - if err != nil { - logger.Error("failed to initialize tendermint db", "path", dbPath, "err", err) - return - } - defer func() { _ = store.Close() }() - - logger.Info("starting compaction...", "db", dbPath) - - err = store.CompactRange(util.Range{Start: nil, Limit: nil}) - if err != nil { - logger.Error("failed to compact tendermint db", "path", dbPath, "err", err) - } - }() - } - wg.Wait() -} diff --git a/sei-tendermint/cmd/tendermint/commands/init.go b/sei-tendermint/cmd/tendermint/commands/init.go deleted file mode 100644 index f9bcb9f82b..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/init.go +++ /dev/null @@ -1,125 +0,0 @@ -package commands - -import ( - "context" - "errors" - "fmt" - - "github.com/spf13/cobra" - - "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmos "github.com/sei-protocol/sei-chain/sei-tendermint/libs/os" - tmrand "github.com/sei-protocol/sei-chain/sei-tendermint/libs/rand" - tmtime "github.com/sei-protocol/sei-chain/sei-tendermint/libs/time" - "github.com/sei-protocol/sei-chain/sei-tendermint/privval" - "github.com/sei-protocol/sei-chain/sei-tendermint/types" -) - -// MakeInitFilesCommand returns the command to initialize a fresh Tendermint Core instance. -func MakeInitFilesCommand(conf *config.Config, logger log.Logger) *cobra.Command { - var keyType string - cmd := &cobra.Command{ - Use: "init [full|validator|seed]", - Short: "Initializes a Tendermint node", - ValidArgs: []string{"full", "validator", "seed"}, - // We allow for zero args so we can throw a more informative error - Args: cobra.MaximumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - if len(args) == 0 { - return errors.New("must specify a node type: tendermint init [validator|full|seed]") - } - conf.Mode = args[0] - return initFilesWithConfig(cmd.Context(), conf, logger, keyType) - }, - } - - cmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519, - "Key type to generate privval file with (ed25519 only)") - - return cmd -} - -func initFilesWithConfig(ctx context.Context, conf *config.Config, logger log.Logger, keyType string) error { - var ( - pv *privval.FilePV - err error - ) - - if conf.Mode == config.ModeValidator { - // private validator - privValKeyFile := conf.PrivValidator.KeyFile() - privValStateFile := conf.PrivValidator.StateFile() - if tmos.FileExists(privValKeyFile) { - pv, err = privval.LoadFilePV(privValKeyFile, privValStateFile) - if err != nil { - return err - } - - logger.Info("Found private validator", "keyFile", privValKeyFile, - "stateFile", privValStateFile) - } else { - pv, err = privval.GenFilePV(privValKeyFile, privValStateFile, keyType) - if err != nil { - return err - } - if err := pv.Save(); err != nil { - return err - } - logger.Info("Generated private validator", "keyFile", privValKeyFile, - "stateFile", privValStateFile) - } - } - - nodeKeyFile := conf.NodeKeyFile() - if tmos.FileExists(nodeKeyFile) { - logger.Info("Found node key", "path", nodeKeyFile) - } else { - if _, err := types.LoadOrGenNodeKey(nodeKeyFile); err != nil { - return err - } - logger.Info("Generated node key", "path", nodeKeyFile) - } - - // genesis file - genFile := conf.GenesisFile() - if tmos.FileExists(genFile) { - logger.Info("Found genesis file", "path", genFile) - } else { - - genDoc := types.GenesisDoc{ - ChainID: fmt.Sprintf("test-chain-%v", tmrand.Str(6)), - GenesisTime: tmtime.Now(), - ConsensusParams: types.DefaultConsensusParams(), - } - - ctx, cancel := context.WithTimeout(ctx, ctxTimeout) - defer cancel() - - // if this is a validator we add it to genesis - if pv != nil { - pubKey, err := pv.GetPubKey(ctx) - if err != nil { - return fmt.Errorf("can't get pubkey: %w", err) - } - genDoc.Validators = []types.GenesisValidator{{ - Address: pubKey.Address(), - PubKey: pubKey, - Power: 10, - }} - } - - if err := genDoc.SaveAs(genFile); err != nil { - return err - } - logger.Info("Generated genesis file", "path", genFile) - } - - // write config file - if err := config.WriteConfigFile(conf.RootDir, conf); err != nil { - return err - } - logger.Info("Generated config", "mode", conf.Mode) - - return nil -} diff --git a/sei-tendermint/cmd/tendermint/commands/reset_test.go b/sei-tendermint/cmd/tendermint/commands/reset_test.go index 6cf790e6e0..59abac698d 100644 --- a/sei-tendermint/cmd/tendermint/commands/reset_test.go +++ b/sei-tendermint/cmd/tendermint/commands/reset_test.go @@ -1,6 +1,7 @@ package commands import ( + "os" "path/filepath" "testing" @@ -13,13 +14,12 @@ import ( ) func Test_ResetAll(t *testing.T) { - ctx := t.Context() config := cfg.TestConfig() dir := t.TempDir() config.SetRoot(dir) logger := log.NewNopLogger() cfg.EnsureRoot(dir) - require.NoError(t, initFilesWithConfig(ctx, config, logger, types.ABCIPubKeyTypeEd25519)) + initTestFiles(t, config) pv, err := privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile()) require.NoError(t, err) pv.LastSignState.Height = 10 @@ -38,13 +38,12 @@ func Test_ResetAll(t *testing.T) { } func Test_ResetState(t *testing.T) { - ctx := t.Context() config := cfg.TestConfig() dir := t.TempDir() config.SetRoot(dir) logger := log.NewNopLogger() cfg.EnsureRoot(dir) - require.NoError(t, initFilesWithConfig(ctx, config, logger, types.ABCIPubKeyTypeEd25519)) + initTestFiles(t, config) pv, err := privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile()) require.NoError(t, err) pv.LastSignState.Height = 10 @@ -63,13 +62,12 @@ func Test_ResetState(t *testing.T) { } func Test_UnsafeResetAll(t *testing.T) { - ctx := t.Context() config := cfg.TestConfig() dir := t.TempDir() config.SetRoot(dir) logger := log.NewNopLogger() cfg.EnsureRoot(dir) - require.NoError(t, initFilesWithConfig(ctx, config, logger, types.ABCIPubKeyTypeEd25519)) + initTestFiles(t, config) pv, err := privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile()) require.NoError(t, err) pv.LastSignState.Height = 10 @@ -86,3 +84,16 @@ func Test_UnsafeResetAll(t *testing.T) { require.NoError(t, err) require.Equal(t, int64(0), pv.LastSignState.Height) } + +func initTestFiles(t *testing.T, config *cfg.Config) { + t.Helper() + + privValKeyFile := config.PrivValidator.KeyFile() + privValStateFile := config.PrivValidator.StateFile() + + require.NoError(t, os.MkdirAll(filepath.Dir(privValKeyFile), 0o755)) + + pv, err := privval.GenFilePV(privValKeyFile, privValStateFile, types.ABCIPubKeyTypeEd25519) + require.NoError(t, err) + require.NoError(t, pv.Save()) +} diff --git a/sei-tendermint/cmd/tendermint/commands/rollback.go b/sei-tendermint/cmd/tendermint/commands/rollback.go index 5a8068a582..209da7f345 100644 --- a/sei-tendermint/cmd/tendermint/commands/rollback.go +++ b/sei-tendermint/cmd/tendermint/commands/rollback.go @@ -3,45 +3,10 @@ package commands import ( "fmt" - "github.com/spf13/cobra" - "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" ) -var removeBlock bool = false - -func MakeRollbackStateCommand(conf *config.Config) *cobra.Command { - cmd := &cobra.Command{ - Use: "rollback", - Short: "rollback tendermint state by one height", - Long: ` -A state rollback is performed to recover from an incorrect application state transition, -when Tendermint has persisted an incorrect app hash and is thus unable to make -progress. Rollback overwrites a state at height n with the state at height n - 1. -The application should also roll back to height n - 1. No blocks are removed, so upon -restarting Tendermint the transactions in block n will be re-executed against the -application. -`, - RunE: func(cmd *cobra.Command, args []string) error { - height, hash, err := RollbackState(conf, removeBlock) - if err != nil { - return fmt.Errorf("failed to rollback state: %w", err) - } - - if removeBlock { - fmt.Printf("Rolled back both state and block to height %d and hash %X\n", height, hash) - } else { - fmt.Printf("Rolled back state to height %d and hash %X\n", height, hash) - } - return nil - }, - } - cmd.Flags().BoolVar(&removeBlock, "hard", false, "remove last block as well as state") - - return cmd -} - // LoadTendermintState loads the tendermint state from the database. // Returns the state, or an error if loading fails. func LoadTendermintState(config *config.Config) (state.State, error) { @@ -62,26 +27,6 @@ func LoadTendermintState(config *config.Config) (state.State, error) { return tmState, nil } -// RollbackState takes the state at the current height n and overwrites it with the state -// at height n - 1. Note state here refers to tendermint state not application state. -// Returns the latest state height and app hash alongside an error if there was one. -func RollbackState(config *config.Config, removeBlock bool) (int64, []byte, error) { - // use the parsed config to load the block and state store - blockStore, stateStore, err := loadStateAndBlockStore(config) - if err != nil { - return -1, nil, err - } - - defer func() { - _ = blockStore.Close() - _ = stateStore.Close() - }() - - // rollback the last state - height, hash, err := state.Rollback(blockStore, stateStore, removeBlock, config.PrivValidator) - return height, hash, err -} - // RollbackStateToTargetHeight rolls back the tendermint state to the target height. // It repeatedly calls state.Rollback until the target height is reached. func RollbackStateToTargetHeight(config *config.Config, removeBlock bool, targetHeight int64) (int64, []byte, error) { diff --git a/sei-tendermint/cmd/tendermint/commands/rollback_test.go b/sei-tendermint/cmd/tendermint/commands/rollback_test.go deleted file mode 100644 index 8ba542add0..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/rollback_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package commands_test - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/sei-protocol/sei-chain/sei-tendermint/cmd/tendermint/commands" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client/local" - rpctest "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/test" - e2e "github.com/sei-protocol/sei-chain/sei-tendermint/test/e2e/app" -) - -func TestRollbackIntegration(t *testing.T) { - var height int64 - dir := t.TempDir() - cfg, err := rpctest.CreateConfig(t, t.Name()) - require.NoError(t, err) - cfg.BaseConfig.DBBackend = "goleveldb" - - app, err := e2e.NewApplication(e2e.DefaultConfig(dir)) - require.NoError(t, err) - - t.Run("First run", func(t *testing.T) { - ctx := t.Context() - require.NoError(t, err) - node, _, err := rpctest.StartTendermint(ctx, cfg, app, rpctest.SuppressStdout) - require.NoError(t, err) - require.True(t, node.IsRunning()) - - time.Sleep(3 * time.Second) - for !app.CanRollback() { - time.Sleep(time.Second) - } - t.Cleanup(func() { - node.Wait() - require.False(t, node.IsRunning()) - }) - }) - t.Run("Rollback", func(t *testing.T) { - time.Sleep(time.Second) - require.NoError(t, app.Rollback()) - height, _, err = commands.RollbackState(cfg, false) - require.NoError(t, err, "%d", height) - }) - t.Run("Restart", func(t *testing.T) { - require.True(t, height > 0, "%d", height) - - ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second) - defer cancel() - node2, _, err2 := rpctest.StartTendermint(ctx, cfg, app, rpctest.SuppressStdout) - require.NoError(t, err2) - t.Cleanup(node2.Wait) - - logger := log.NewNopLogger() - - client, err := local.New(logger, node2.(local.NodeService)) - require.NoError(t, err) - - ticker := time.NewTicker(200 * time.Millisecond) - for { - select { - case <-ctx.Done(): - t.Fatalf("failed to make progress after 20 seconds. Min height: %d", height) - case <-ticker.C: - status, err := client.Status(ctx) - require.NoError(t, err) - - if status.SyncInfo.LatestBlockHeight > height { - return - } - } - } - }) - -} diff --git a/sei-tendermint/cmd/tendermint/commands/root.go b/sei-tendermint/cmd/tendermint/commands/root.go deleted file mode 100644 index 2ad1efcf00..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/root.go +++ /dev/null @@ -1,69 +0,0 @@ -package commands - -import ( - "fmt" - "os" - "path/filepath" - "time" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/cli" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" -) - -const ctxTimeout = 4 * time.Second - -// ParseConfig retrieves the default environment configuration, -// sets up the Tendermint root and ensures that the root exists -func ParseConfig(conf *config.Config) (*config.Config, error) { - if err := viper.Unmarshal(conf); err != nil { - return nil, err - } - - conf.SetRoot(conf.RootDir) - - if err := conf.ValidateBasic(); err != nil { - return nil, fmt.Errorf("error in config file: %w", err) - } - return conf, nil -} - -// RootCommand constructs the root command-line entry point for Tendermint core. -func RootCommand(conf *config.Config, logger log.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "tendermint", - Short: "BFT state machine replication for applications in any programming languages", - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - if cmd.Name() == VersionCmd.Name() { - return nil - } - - if err := cli.BindFlagsLoadViper(cmd, args); err != nil { - return err - } - - pconf, err := ParseConfig(conf) - if err != nil { - return err - } - *conf = *pconf - config.EnsureRoot(conf.RootDir) - if err := log.OverrideWithNewLogger(logger, conf.LogFormat, conf.LogLevel); err != nil { - return err - } - if warning := pconf.DeprecatedFieldWarning(); warning != nil { - logger.Info("WARNING", "deprecated field warning", warning) - } - - return nil - }, - } - cmd.PersistentFlags().StringP(cli.HomeFlag, "", os.ExpandEnv(filepath.Join("$HOME", config.DefaultTendermintDir)), "directory for config and data") - cmd.PersistentFlags().Bool(cli.TraceFlag, false, "print out full stack trace on errors") - cmd.PersistentFlags().String("log-level", conf.LogLevel, "log level") - cobra.OnInitialize(func() { cli.InitEnv("TM") }) - return cmd -} diff --git a/sei-tendermint/cmd/tendermint/commands/root_test.go b/sei-tendermint/cmd/tendermint/commands/root_test.go deleted file mode 100644 index bd3dceb1fd..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/root_test.go +++ /dev/null @@ -1,186 +0,0 @@ -package commands - -import ( - "context" - "fmt" - "os" - "path/filepath" - "testing" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - cfg "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/cli" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmos "github.com/sei-protocol/sei-chain/sei-tendermint/libs/os" -) - -// writeConfigVals writes a toml file with the given values. -// It returns an error if writing was impossible. -func writeConfigVals(dir string, vals map[string]string) error { - data := "" - for k, v := range vals { - data += fmt.Sprintf("%s = \"%s\"\n", k, v) - } - cfile := filepath.Join(dir, "config.toml") - return os.WriteFile(cfile, []byte(data), 0600) -} - -// clearConfig clears env vars, the given root dir, and resets viper. -func clearConfig(t *testing.T, dir string) *cfg.Config { - t.Helper() - require.NoError(t, os.Unsetenv("TMHOME")) - require.NoError(t, os.Unsetenv("TM_HOME")) - require.NoError(t, os.RemoveAll(dir)) - - viper.Reset() - conf := cfg.DefaultConfig() - conf.RootDir = dir - return conf -} - -// prepare new rootCmd -func testRootCmd(conf *cfg.Config) *cobra.Command { - logger := log.NewNopLogger() - cmd := RootCommand(conf, logger) - cmd.RunE = func(cmd *cobra.Command, args []string) error { return nil } - - var l string - cmd.PersistentFlags().String("log", l, "Log") - return cmd -} - -func testSetup(ctx context.Context, t *testing.T, conf *cfg.Config, args []string, env map[string]string) error { - t.Helper() - - cmd := testRootCmd(conf) - viper.Set(cli.HomeFlag, conf.RootDir) - - // run with the args and env - args = append([]string{cmd.Use}, args...) - return cli.RunWithArgs(ctx, cmd, args, env) -} - -func TestRootHome(t *testing.T) { - defaultRoot := t.TempDir() - newRoot := filepath.Join(defaultRoot, "something-else") - cases := []struct { - args []string - env map[string]string - root string - }{ - {nil, nil, defaultRoot}, - {[]string{"--home", newRoot}, nil, newRoot}, - {nil, map[string]string{"TMHOME": newRoot}, newRoot}, - } - - ctx := t.Context() - - for i, tc := range cases { - t.Run(fmt.Sprint(i), func(t *testing.T) { - conf := clearConfig(t, tc.root) - - err := testSetup(ctx, t, conf, tc.args, tc.env) - require.NoError(t, err) - - require.Equal(t, tc.root, conf.RootDir) - require.Equal(t, tc.root, conf.P2P.RootDir) - require.Equal(t, tc.root, conf.Consensus.RootDir) - require.Equal(t, tc.root, conf.Mempool.RootDir) - }) - } -} - -func TestRootFlagsEnv(t *testing.T) { - // defaults - defaults := cfg.DefaultConfig() - defaultDir := t.TempDir() - - defaultLogLvl := defaults.LogLevel - - cases := []struct { - args []string - env map[string]string - logLevel string - }{ - {[]string{"--log", "debug"}, nil, defaultLogLvl}, // wrong flag - {[]string{"--log-level", "debug"}, nil, "debug"}, // right flag - {nil, map[string]string{"TM_LOW": "debug"}, defaultLogLvl}, // wrong env flag - {nil, map[string]string{"MT_LOG_LEVEL": "debug"}, defaultLogLvl}, // wrong env prefix - {nil, map[string]string{"TM_LOG_LEVEL": "debug"}, "debug"}, // right env - } - - ctx := t.Context() - - for i, tc := range cases { - t.Run(fmt.Sprint(i), func(t *testing.T) { - conf := clearConfig(t, defaultDir) - - err := testSetup(ctx, t, conf, tc.args, tc.env) - require.NoError(t, err) - - assert.Equal(t, tc.logLevel, conf.LogLevel) - }) - - } -} - -func TestRootConfig(t *testing.T) { - ctx := t.Context() - - // write non-default config - nonDefaultLogLvl := "debug" - cvals := map[string]string{ - "log-level": nonDefaultLogLvl, - } - - cases := []struct { - args []string - env map[string]string - logLvl string - }{ - {[]string{"--log-level=info"}, nil, "info"}, // flag over rides - {nil, map[string]string{"TM_LOG_LEVEL": "info"}, "info"}, // env over rides - } - - for i, tc := range cases { - t.Run(fmt.Sprint(i), func(t *testing.T) { - defaultRoot := t.TempDir() - conf := clearConfig(t, defaultRoot) - conf.LogLevel = tc.logLvl - - // XXX: path must match cfg.defaultConfigPath - configFilePath := filepath.Join(defaultRoot, "config") - err := tmos.EnsureDir(configFilePath, 0700) - require.NoError(t, err) - - // write the non-defaults to a different path - // TODO: support writing sub configs so we can test that too - err = writeConfigVals(configFilePath, cvals) - require.NoError(t, err) - - cmd := testRootCmd(conf) - - // run with the args and env - tc.args = append([]string{cmd.Use}, tc.args...) - err = cli.RunWithArgs(ctx, cmd, tc.args, tc.env) - require.NoError(t, err) - - require.Equal(t, tc.logLvl, conf.LogLevel) - }) - } -} - -// WriteConfigVals writes a toml file with the given values. -// It returns an error if writing was impossible. -func WriteConfigVals(dir string, vals map[string]string) error { - data := "" - for k, v := range vals { - data += fmt.Sprintf("%s = \"%s\"\n", k, v) - } - cfile := filepath.Join(dir, "config.toml") - return os.WriteFile(cfile, []byte(data), 0600) -} diff --git a/sei-tendermint/cmd/tendermint/commands/run_node.go b/sei-tendermint/cmd/tendermint/commands/run_node.go index 485e3ac345..99562f79cd 100644 --- a/sei-tendermint/cmd/tendermint/commands/run_node.go +++ b/sei-tendermint/cmd/tendermint/commands/run_node.go @@ -1,19 +1,9 @@ package commands import ( - "bytes" - "crypto/sha256" - "fmt" - "io" - "os" - "os/signal" - "syscall" - "github.com/spf13/cobra" cfg "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils" ) var ( @@ -98,74 +88,3 @@ func addDBFlags(cmd *cobra.Command, conf *cfg.Config) { conf.DBPath, "database directory") } - -// NewRunNodeCmd returns the command that allows the CLI to start a node. -// It can be used with a custom PrivValidator and in-process ABCI application. -func NewRunNodeCmd(nodeProvider cfg.ServiceProvider, conf *cfg.Config, logger log.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "start", - Aliases: []string{"node", "run"}, - Short: "Run the tendermint node", - RunE: func(cmd *cobra.Command, args []string) error { - if err := checkGenesisHash(conf); err != nil { - return err - } - - ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM) - defer cancel() - - restart := utils.NewAtomicSend(false) - - n, err := nodeProvider(ctx, conf, logger, func() { restart.Store(true) }) - if err != nil { - return fmt.Errorf("failed to create node: %w", err) - } - - if err := n.Start(ctx); err != nil { - return fmt.Errorf("failed to start node: %w", err) - } - - logger.Info("started node", "chain", conf.ChainID()) - - if _, err := restart.Wait(ctx, func(x bool) bool { return x }); err != nil { - // Context canceled. - // TODO(gprusak): shouldn't we stop the node either way though? - return nil - } - logger.Info("Received signal to restart node.") - n.Stop() - os.Exit(1) - panic("unreachable") - }, - } - - AddNodeFlags(cmd, conf) - return cmd -} - -func checkGenesisHash(config *cfg.Config) error { - if len(genesisHash) == 0 || config.Genesis == "" { - return nil - } - - // Calculate SHA-256 hash of the genesis file. - f, err := os.Open(config.GenesisFile()) - if err != nil { - return fmt.Errorf("can't open genesis file: %w", err) - } - defer func() { _ = f.Close() }() - h := sha256.New() - if _, err := io.Copy(h, f); err != nil { - return fmt.Errorf("error when hashing genesis file: %w", err) - } - actualHash := h.Sum(nil) - - // Compare with the flag. - if !bytes.Equal(genesisHash, actualHash) { - return fmt.Errorf( - "--genesis-hash=%X does not match %s hash: %X", - genesisHash, config.GenesisFile(), actualHash) - } - - return nil -} diff --git a/sei-tendermint/cmd/tendermint/commands/show_node_id.go b/sei-tendermint/cmd/tendermint/commands/show_node_id.go deleted file mode 100644 index 909014a574..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/show_node_id.go +++ /dev/null @@ -1,26 +0,0 @@ -package commands - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/sei-protocol/sei-chain/sei-tendermint/config" -) - -// MakeShowNodeIDCommand constructs a command to dump the node ID to stdout. -func MakeShowNodeIDCommand(conf *config.Config) *cobra.Command { - return &cobra.Command{ - Use: "show-node-id", - Short: "Show this node's ID", - RunE: func(cmd *cobra.Command, args []string) error { - nodeKeyID, err := conf.LoadNodeKeyID() - if err != nil { - return err - } - - fmt.Println(nodeKeyID) - return nil - }, - } -} diff --git a/sei-tendermint/cmd/tendermint/commands/show_validator.go b/sei-tendermint/cmd/tendermint/commands/show_validator.go deleted file mode 100644 index 0a282c7aed..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/show_validator.go +++ /dev/null @@ -1,83 +0,0 @@ -package commands - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - - "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/jsontypes" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmnet "github.com/sei-protocol/sei-chain/sei-tendermint/libs/net" - tmos "github.com/sei-protocol/sei-chain/sei-tendermint/libs/os" - "github.com/sei-protocol/sei-chain/sei-tendermint/privval" - tmgrpc "github.com/sei-protocol/sei-chain/sei-tendermint/privval/grpc" -) - -// MakeShowValidatorCommand constructs a command to show the validator info. -func MakeShowValidatorCommand(conf *config.Config, logger log.Logger) *cobra.Command { - return &cobra.Command{ - Use: "show-validator", - Short: "Show this node's validator info", - RunE: func(cmd *cobra.Command, args []string) error { - var ( - pubKey crypto.PubKey - err error - bctx = cmd.Context() - ) - //TODO: remove once gRPC is the only supported protocol - protocol, _ := tmnet.ProtocolAndAddress(conf.PrivValidator.ListenAddr) - switch protocol { - case "grpc": - pvsc, err := tmgrpc.DialRemoteSigner( - bctx, - conf.PrivValidator, - conf.ChainID(), - logger, - conf.Instrumentation.Prometheus, - ) - if err != nil { - return fmt.Errorf("can't connect to remote validator %w", err) - } - - ctx, cancel := context.WithTimeout(bctx, ctxTimeout) - defer cancel() - - pubKey, err = pvsc.GetPubKey(ctx) - if err != nil { - return fmt.Errorf("can't get pubkey: %w", err) - } - default: - - keyFilePath := conf.PrivValidator.KeyFile() - if !tmos.FileExists(keyFilePath) { - return fmt.Errorf("private validator file %s does not exist", keyFilePath) - } - - pv, err := privval.LoadFilePV(keyFilePath, conf.PrivValidator.StateFile()) - if err != nil { - return err - } - - ctx, cancel := context.WithTimeout(bctx, ctxTimeout) - defer cancel() - - pubKey, err = pv.GetPubKey(ctx) - if err != nil { - return fmt.Errorf("can't get pubkey: %w", err) - } - } - - bz, err := jsontypes.Marshal(pubKey) - if err != nil { - return fmt.Errorf("failed to marshal private validator pubkey: %w", err) - } - - fmt.Println(string(bz)) - return nil - }, - } - -} diff --git a/sei-tendermint/cmd/tendermint/commands/testnet.go b/sei-tendermint/cmd/tendermint/commands/testnet.go deleted file mode 100644 index 6d6745c3e6..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/testnet.go +++ /dev/null @@ -1,332 +0,0 @@ -package commands - -import ( - "context" - "fmt" - "net" - "os" - "path/filepath" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - cfg "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - tmrand "github.com/sei-protocol/sei-chain/sei-tendermint/libs/rand" - tmtime "github.com/sei-protocol/sei-chain/sei-tendermint/libs/time" - "github.com/sei-protocol/sei-chain/sei-tendermint/privval" - "github.com/sei-protocol/sei-chain/sei-tendermint/types" -) - -const ( - nodeDirPerm = 0755 -) - -// MakeTestnetFilesCommand constructs a command to generate testnet config files. -func MakeTestnetFilesCommand(conf *cfg.Config, logger log.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "testnet", - Short: "Initialize files for a Tendermint testnet", - Long: `testnet will create "v" + "n" number of directories and populate each with -necessary files (private validator, genesis, config, etc.). - -Note, strict routability for addresses is turned off in the config file. - -Optionally, it will fill in persistent-peers list in config file using either hostnames or IPs. - -Example: - - tendermint testnet --v 4 --o ./output --populate-persistent-peers --starting-ip-address 192.168.10.2 - `, - } - var ( - nValidators int - nNonValidators int - initialHeight int64 - configFile string - outputDir string - nodeDirPrefix string - - populatePersistentPeers bool - hostnamePrefix string - hostnameSuffix string - startingIPAddress string - hostnames []string - p2pPort int - randomMonikers bool - keyType string - ) - - cmd.Flags().IntVar(&nValidators, "v", 4, - "number of validators to initialize the testnet with") - cmd.Flags().StringVar(&configFile, "config", "", - "config file to use (note some options may be overwritten)") - cmd.Flags().IntVar(&nNonValidators, "n", 0, - "number of non-validators to initialize the testnet with") - cmd.Flags().StringVar(&outputDir, "o", "./mytestnet", - "directory to store initialization data for the testnet") - cmd.Flags().StringVar(&nodeDirPrefix, "node-dir-prefix", "node", - "prefix the directory name for each node with (node results in node0, node1, ...)") - cmd.Flags().Int64Var(&initialHeight, "initial-height", 0, - "initial height of the first block") - - cmd.Flags().BoolVar(&populatePersistentPeers, "populate-persistent-peers", true, - "update config of each node with the list of persistent peers build using either"+ - " hostname-prefix or"+ - " starting-ip-address") - cmd.Flags().StringVar(&hostnamePrefix, "hostname-prefix", "node", - "hostname prefix (\"node\" results in persistent peers list ID0@node0:26656, ID1@node1:26656, ...)") - cmd.Flags().StringVar(&hostnameSuffix, "hostname-suffix", "", - "hostname suffix ("+ - "\".xyz.com\""+ - " results in persistent peers list ID0@node0.xyz.com:26656, ID1@node1.xyz.com:26656, ...)") - cmd.Flags().StringVar(&startingIPAddress, "starting-ip-address", "", - "starting IP address ("+ - "\"192.168.0.1\""+ - " results in persistent peers list ID0@192.168.0.1:26656, ID1@192.168.0.2:26656, ...)") - cmd.Flags().StringArrayVar(&hostnames, "hostname", []string{}, - "manually override all hostnames of validators and non-validators (use --hostname multiple times for multiple hosts)") - cmd.Flags().IntVar(&p2pPort, "p2p-port", 26656, - "P2P Port") - cmd.Flags().BoolVar(&randomMonikers, "random-monikers", false, - "randomize the moniker for each generated node") - cmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519, - "Key type to generate privval file with (ed25519 only)") - - cmd.RunE = func(cmd *cobra.Command, args []string) error { - if len(hostnames) > 0 && len(hostnames) != (nValidators+nNonValidators) { - return fmt.Errorf( - "testnet needs precisely %d hostnames (number of validators plus non-validators) if --hostname parameter is used", - nValidators+nNonValidators, - ) - } - _ = ResetAll(conf.DBDir(), conf.PrivValidator.KeyFile(), - conf.PrivValidator.StateFile(), logger, keyType, conf.RootDir) - - // set mode to validator for testnet - config := cfg.DefaultValidatorConfig() - - // overwrite default config if set and valid - if configFile != "" { - viper.SetConfigFile(configFile) - if err := viper.ReadInConfig(); err != nil { - return err - } - if err := viper.Unmarshal(config); err != nil { - return err - } - if err := config.ValidateBasic(); err != nil { - return err - } - } - - genVals := make([]types.GenesisValidator, nValidators) - ctx := cmd.Context() - for i := 0; i < nValidators; i++ { - nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) - nodeDir := filepath.Join(outputDir, nodeDirName) - config.SetRoot(nodeDir) - - err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm) - if err != nil { - _ = os.RemoveAll(outputDir) - return err - } - err = os.MkdirAll(filepath.Join(nodeDir, "data"), nodeDirPerm) - if err != nil { - _ = os.RemoveAll(outputDir) - return err - } - - if err := initFilesWithConfig(ctx, config, logger, keyType); err != nil { - return err - } - - pvKeyFile := filepath.Join(nodeDir, config.PrivValidator.Key) - pvStateFile := filepath.Join(nodeDir, config.PrivValidator.State) - pv, err := privval.LoadFilePV(pvKeyFile, pvStateFile) - if err != nil { - return err - } - - ctx, cancel := context.WithTimeout(ctx, ctxTimeout) - defer cancel() - - pubKey, err := pv.GetPubKey(ctx) - if err != nil { - return fmt.Errorf("can't get pubkey: %w", err) - } - genVals[i] = types.GenesisValidator{ - Address: pubKey.Address(), - PubKey: pubKey, - Power: 1, - Name: nodeDirName, - } - } - - for i := 0; i < nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i+nValidators)) - config.SetRoot(nodeDir) - - err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm) - if err != nil { - _ = os.RemoveAll(outputDir) - return err - } - - err = os.MkdirAll(filepath.Join(nodeDir, "data"), nodeDirPerm) - if err != nil { - _ = os.RemoveAll(outputDir) - return err - } - - if err := initFilesWithConfig(ctx, conf, logger, keyType); err != nil { - return err - } - } - - // Generate genesis doc from generated validators - genDoc := &types.GenesisDoc{ - ChainID: "chain-" + tmrand.Str(6), - GenesisTime: tmtime.Now(), - InitialHeight: initialHeight, - Validators: genVals, - ConsensusParams: types.DefaultConsensusParams(), - } - - // Write genesis file. - for i := 0; i < nValidators+nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i)) - if err := genDoc.SaveAs(filepath.Join(nodeDir, config.Genesis)); err != nil { - _ = os.RemoveAll(outputDir) - return err - } - } - - // Gather persistent peer addresses. - var ( - persistentPeers = make([]string, 0) - err error - ) - tpargs := testnetPeerArgs{ - numValidators: nValidators, - numNonValidators: nNonValidators, - peerToPeerPort: p2pPort, - nodeDirPrefix: nodeDirPrefix, - outputDir: outputDir, - hostnames: hostnames, - startingIPAddr: startingIPAddress, - hostnamePrefix: hostnamePrefix, - hostnameSuffix: hostnameSuffix, - randomMonikers: randomMonikers, - } - - if populatePersistentPeers { - - persistentPeers, err = persistentPeersArray(config, tpargs) - if err != nil { - _ = os.RemoveAll(outputDir) - return err - } - } - - // Overwrite default config. - for i := 0; i < nValidators+nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i)) - config.SetRoot(nodeDir) - config.P2P.AllowDuplicateIP = true - if populatePersistentPeers { - persistentPeersWithoutSelf := make([]string, 0) - for j := 0; j < len(persistentPeers); j++ { - if j == i { - continue - } - persistentPeersWithoutSelf = append(persistentPeersWithoutSelf, persistentPeers[j]) - } - config.P2P.PersistentPeers = strings.Join(persistentPeersWithoutSelf, ",") - } - config.Moniker = tpargs.moniker(i) - - if err := cfg.WriteConfigFile(nodeDir, config); err != nil { - return err - } - } - - fmt.Printf("Successfully initialized %v node directories\n", nValidators+nNonValidators) - return nil - } - - return cmd -} - -type testnetPeerArgs struct { - numValidators int - numNonValidators int - peerToPeerPort int - nodeDirPrefix string - outputDir string - hostnames []string - startingIPAddr string - hostnamePrefix string - hostnameSuffix string - randomMonikers bool -} - -func (args *testnetPeerArgs) hostnameOrIP(i int) (string, error) { - if len(args.hostnames) > 0 && i < len(args.hostnames) { - return args.hostnames[i], nil - } - if args.startingIPAddr == "" { - return fmt.Sprintf("%s%d%s", args.hostnamePrefix, i, args.hostnameSuffix), nil - } - ip := net.ParseIP(args.startingIPAddr) - ip = ip.To4() - if ip == nil { - return "", fmt.Errorf("%v is non-ipv4 address", args.startingIPAddr) - } - - for j := 0; j < i; j++ { - ip[3]++ - } - return ip.String(), nil - -} - -// get an array of persistent peers -func persistentPeersArray(config *cfg.Config, args testnetPeerArgs) ([]string, error) { - peers := make([]string, args.numValidators+args.numNonValidators) - for i := 0; i < len(peers); i++ { - nodeDir := filepath.Join(args.outputDir, fmt.Sprintf("%s%d", args.nodeDirPrefix, i)) - config.SetRoot(nodeDir) - nodeKey, err := config.LoadNodeKeyID() - if err != nil { - return nil, err - } - addr, err := args.hostnameOrIP(i) - if err != nil { - return nil, err - } - - peers[i] = nodeKey.AddressString(fmt.Sprintf("%s:%d", addr, args.peerToPeerPort)) - } - return peers, nil -} - -func (args *testnetPeerArgs) moniker(i int) string { - if args.randomMonikers { - return randomMoniker() - } - if len(args.hostnames) > 0 && i < len(args.hostnames) { - return args.hostnames[i] - } - if args.startingIPAddr == "" { - return fmt.Sprintf("%s%d%s", args.hostnamePrefix, i, args.hostnameSuffix) - } - return randomMoniker() -} - -func randomMoniker() string { - return bytes.HexBytes(tmrand.Bytes(8)).String() -} diff --git a/sei-tendermint/cmd/tendermint/commands/version.go b/sei-tendermint/cmd/tendermint/commands/version.go deleted file mode 100644 index ed4ad29bab..0000000000 --- a/sei-tendermint/cmd/tendermint/commands/version.go +++ /dev/null @@ -1,18 +0,0 @@ -package commands - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/sei-protocol/sei-chain/sei-tendermint/version" -) - -// VersionCmd ... -var VersionCmd = &cobra.Command{ - Use: "version", - Short: "Show version info", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println(version.TMVersion) - }, -} diff --git a/sei-tendermint/cmd/tendermint/main.go b/sei-tendermint/cmd/tendermint/main.go deleted file mode 100644 index 17364e2067..0000000000 --- a/sei-tendermint/cmd/tendermint/main.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -import ( - "context" - - "github.com/sei-protocol/sei-chain/sei-tendermint/cmd/tendermint/commands" - "github.com/sei-protocol/sei-chain/sei-tendermint/cmd/tendermint/commands/debug" - "github.com/sei-protocol/sei-chain/sei-tendermint/config" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/cli" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - "github.com/sei-protocol/sei-chain/sei-tendermint/node" -) - -func main() { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - conf, err := commands.ParseConfig(config.DefaultConfig()) - if err != nil { - panic(err) - } - - logger, err := log.NewDefaultLogger(conf.LogFormat, conf.LogLevel) - if err != nil { - panic(err) - } - - rcmd := commands.RootCommand(conf, logger) - rcmd.AddCommand( - commands.MakeGenValidatorCommand(), - commands.MakeReindexEventCommand(conf, logger), - commands.MakeInitFilesCommand(conf, logger), - commands.MakeLightCommand(conf, logger), - commands.MakeResetCommand(conf, logger), - commands.MakeUnsafeResetAllCommand(conf, logger), - commands.MakeShowValidatorCommand(conf, logger), - commands.MakeTestnetFilesCommand(conf, logger), - commands.MakeShowNodeIDCommand(conf), - commands.GenNodeKeyCmd, - commands.VersionCmd, - commands.MakeInspectCommand(conf, logger), - commands.MakeRollbackStateCommand(conf), - commands.MakeKeyMigrateCommand(conf, logger), - debug.GetDebugCommand(logger), - commands.NewCompletionCmd(rcmd, true), - commands.MakeCompactDBCommand(conf, logger), - ) - - // NOTE: - // Users wishing to: - // * Use an external signer for their validators - // * Supply an in-proc abci app - // * Supply a genesis doc file from another source - // * Provide their own DB implementation - // can copy this file and use something other than the - // node.NewDefault function - nodeFunc := node.NewDefault - - // Create & start node - rcmd.AddCommand(commands.NewRunNodeCmd(nodeFunc, conf, logger)) - - if err := cli.RunWithTrace(ctx, rcmd); err != nil { - panic(err) - } -} diff --git a/sei-tendermint/config/db.go b/sei-tendermint/config/db.go index f76710579c..3f851b4e6c 100644 --- a/sei-tendermint/config/db.go +++ b/sei-tendermint/config/db.go @@ -1,17 +1,9 @@ package config import ( - "context" - dbm "github.com/tendermint/tm-db" - - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/service" ) -// ServiceProvider takes a config and a logger and returns a ready to go Node. -type ServiceProvider func(ctx context.Context, cfg *Config, logger log.Logger, restartEvent func()) (service.Service, error) - // DBContext specifies config information for loading a new DB. type DBContext struct { ID string From 269c5ae1059a6cff27a70c972b057c0377a21a8d Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 19:33:20 +0100 Subject: [PATCH 04/16] added back config.go --- .../cmd/tendermint/commands/config.go | 25 +++++++++++++++++++ sei-tendermint/node/public.go | 13 ---------- 2 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 sei-tendermint/cmd/tendermint/commands/config.go diff --git a/sei-tendermint/cmd/tendermint/commands/config.go b/sei-tendermint/cmd/tendermint/commands/config.go new file mode 100644 index 0000000000..215f3d7126 --- /dev/null +++ b/sei-tendermint/cmd/tendermint/commands/config.go @@ -0,0 +1,25 @@ +package commands + +import ( + "fmt" + + "github.com/spf13/viper" + + "github.com/sei-protocol/sei-chain/sei-tendermint/config" +) + +// ParseConfig retrieves the default environment configuration, +// sets up the Tendermint root and ensures that the root exists. +func ParseConfig(conf *config.Config) (*config.Config, error) { + if err := viper.Unmarshal(conf); err != nil { + return nil, err + } + + conf.SetRoot(conf.RootDir) + + if err := conf.ValidateBasic(); err != nil { + return nil, fmt.Errorf("error in config file: %w", err) + } + + return conf, nil +} diff --git a/sei-tendermint/node/public.go b/sei-tendermint/node/public.go index 18bb17876d..96f45f3a57 100644 --- a/sei-tendermint/node/public.go +++ b/sei-tendermint/node/public.go @@ -15,19 +15,6 @@ import ( "go.opentelemetry.io/otel/sdk/trace" ) -// NewDefault constructs a tendermint node service for use in go -// process that host their own process-local tendermint node. This is -// equivalent to running tendermint in it's own process communicating -// to an external ABCI application. -func NewDefault( - ctx context.Context, - conf *config.Config, - logger log.Logger, - restartEvent func(), -) (service.Service, error) { - return newDefaultNode(ctx, conf, logger, restartEvent) -} - // New constructs a tendermint node. The provided app runs in the same // process as the tendermint node and will be wrapped in a local ABCI client // inside this function. The final option is a pointer to a Genesis document: From 133a1a17add23b7630e28661f2bef2879ff374d9 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 19:53:54 +0100 Subject: [PATCH 05/16] LocalClient in Proxy --- .../internal/blocksync/reactor_test.go | 4 +- .../internal/consensus/replay_stubs.go | 4 +- .../internal/consensus/replay_test.go | 19 +++---- sei-tendermint/internal/proxy/client.go | 38 ++----------- .../internal/state/execution_test.go | 54 ++++++++----------- .../internal/state/validation_test.go | 7 ++- sei-tendermint/node/node.go | 54 +------------------ sei-tendermint/node/node_test.go | 13 +++-- sei-tendermint/node/public.go | 3 +- sei-tendermint/node/seed.go | 5 +- 10 files changed, 49 insertions(+), 152 deletions(-) diff --git a/sei-tendermint/internal/blocksync/reactor_test.go b/sei-tendermint/internal/blocksync/reactor_test.go index 9fca9cd5a7..78ecad78b4 100644 --- a/sei-tendermint/internal/blocksync/reactor_test.go +++ b/sei-tendermint/internal/blocksync/reactor_test.go @@ -96,7 +96,7 @@ func makeReactor( logger := log.NewNopLogger() - app := proxy.New(abciclient.NewLocalClient(logger, &abci.BaseApplication{}), logger, proxy.NopMetrics()) + app := proxy.New(abci.NewBaseApplication(), logger, proxy.NopMetrics()) require.NoError(t, app.Start(ctx)) blockDB := dbm.NewMemDB() @@ -167,7 +167,7 @@ func (rts *reactorTestSuite) addNode( logger := log.NewNopLogger() rts.nodes = append(rts.nodes, nodeID) - rts.app[nodeID] = proxy.New(abciclient.NewLocalClient(logger, &abci.BaseApplication{}), logger, proxy.NopMetrics()) + rts.app[nodeID] = proxy.New(abci.NewBaseApplication(), logger, proxy.NopMetrics()) require.NoError(t, rts.app[nodeID].Start(ctx)) remediationConfig := config.DefaultSelfRemediationConfig() diff --git a/sei-tendermint/internal/consensus/replay_stubs.go b/sei-tendermint/internal/consensus/replay_stubs.go index ff90ece91b..9c6c0b2bd9 100644 --- a/sei-tendermint/internal/consensus/replay_stubs.go +++ b/sei-tendermint/internal/consensus/replay_stubs.go @@ -74,10 +74,10 @@ func newMockProxyApp( appHash []byte, finalizeBlockResponses *abci.ResponseFinalizeBlock, ) (abciclient.Client, error) { - return proxy.New(abciclient.NewLocalClient(logger, &mockProxyApp{ + return proxy.New(&mockProxyApp{ appHash: appHash, finalizeBlockResponses: finalizeBlockResponses, - }), logger, proxy.NopMetrics()), nil + }, logger, proxy.NopMetrics()), nil } type mockProxyApp struct { diff --git a/sei-tendermint/internal/consensus/replay_test.go b/sei-tendermint/internal/consensus/replay_test.go index 744b96a087..a1dc541fa8 100644 --- a/sei-tendermint/internal/consensus/replay_test.go +++ b/sei-tendermint/internal/consensus/replay_test.go @@ -696,11 +696,11 @@ func testHandshakeReplay( eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) - client := abciclient.NewLocalClient(logger, kvstore.NewApplication()) + app := kvstore.NewApplication() if nBlocks > 0 { // run nBlocks against a new client to build up the app state. // use a throwaway tendermint state - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) stateDB1 := dbm.NewMemDB() stateStore := sm.NewStore(stateDB1) err := stateStore.Save(genesisState) @@ -721,7 +721,7 @@ func testHandshakeReplay( genDoc, err := sm.MakeGenesisDocFromFile(cfg.GenesisFile()) require.NoError(t, err) handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx), "Error starting proxy app connections") require.True(t, proxyApp.IsRunning()) require.NotNil(t, proxyApp) @@ -848,9 +848,9 @@ func buildTMStateFromChain( t.Helper() // run the whole chain against this client to build up the tendermint state - client := abciclient.NewLocalClient(logger, kvstore.NewApplication()) + app := kvstore.NewApplication() - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx)) state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version @@ -926,8 +926,7 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { // - 0x03 { app := &badApp{numBlocks: 3, allHashesAreWrong: true} - client := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) t.Cleanup(func() { proxyApp.Wait() }) @@ -942,8 +941,7 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { // - RANDOM HASH { app := &badApp{numBlocks: 3, onlyLastHashIsWrong: true} - client := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) t.Cleanup(func() { proxyApp.Wait() }) @@ -1150,7 +1148,6 @@ func TestHandshakeUpdatesValidators(t *testing.T) { require.NoError(t, err) vals := types.NewValidatorSet([]*types.Validator{val}) app := &initChainApp{vals: types.TM2PB.ValidatorUpdates(vals)} - client := abciclient.NewLocalClient(logger, app) eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -1173,7 +1170,7 @@ func TestHandshakeUpdatesValidators(t *testing.T) { require.NoError(t, err) handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - proxyApp := proxy.New(client, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx), "Error starting proxy app connections") require.NoError(t, handshaker.Handshake(ctx, proxyApp), "error on abci handshake") diff --git a/sei-tendermint/internal/proxy/client.go b/sei-tendermint/internal/proxy/client.go index 099ab418b3..42da47bc96 100644 --- a/sei-tendermint/internal/proxy/client.go +++ b/sei-tendermint/internal/proxy/client.go @@ -2,7 +2,6 @@ package proxy import ( "context" - "io" "os" "syscall" "time" @@ -10,43 +9,11 @@ import ( "github.com/go-kit/kit/metrics" abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" - "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" "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/libs/service" - e2e "github.com/sei-protocol/sei-chain/sei-tendermint/test/e2e/app" ) -// ClientFactory returns a client object, which will create a local -// client if addr is one of: 'kvstore', 'persistent_kvstore', 'e2e', -// or 'noop', otherwise - a remote client. -// -// The Closer is a noop except for persistent_kvstore applications, -// which will clean up the store. -func ClientFactory(logger log.Logger, addr, transport, dbDir string) (abciclient.Client, io.Closer, error) { - switch addr { - case "kvstore": - return abciclient.NewLocalClient(logger, kvstore.NewApplication()), noopCloser{}, nil - case "persistent_kvstore": - app := kvstore.NewPersistentKVStoreApplication(logger, dbDir) - return abciclient.NewLocalClient(logger, app), app, nil - case "e2e": - app, err := e2e.NewApplication(e2e.DefaultConfig(dbDir)) - if err != nil { - return nil, noopCloser{}, err - } - return abciclient.NewLocalClient(logger, app), noopCloser{}, nil - case "noop": - return abciclient.NewLocalClient(logger, types.NewBaseApplication()), noopCloser{}, nil - default: - panic("unknown client type") - } -} - -type noopCloser struct{} - -func (noopCloser) Close() error { return nil } - // proxyClient provides the application connection. type proxyClient struct { service.BaseService @@ -56,8 +23,9 @@ type proxyClient struct { metrics *Metrics } -// New creates a proxy application interface. -func New(client abciclient.Client, logger log.Logger, metrics *Metrics) abciclient.Client { +// New creates a proxy application interface around the provided ABCI application. +func New(app types.Application, logger log.Logger, metrics *Metrics) abciclient.Client { + client := abciclient.NewLocalClient(logger, app) conn := &proxyClient{ logger: logger, metrics: metrics, diff --git a/sei-tendermint/internal/state/execution_test.go b/sei-tendermint/internal/state/execution_test.go index e0fb0ba689..5e9e39edba 100644 --- a/sei-tendermint/internal/state/execution_test.go +++ b/sei-tendermint/internal/state/execution_test.go @@ -11,8 +11,6 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" - abciclientmocks "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client/mocks" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" abcimocks "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types/mocks" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" @@ -40,8 +38,7 @@ var ( func TestApplyBlock(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) ctx := t.Context() @@ -89,8 +86,7 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) { logger := log.NewNopLogger() app := &testApp{} - cc := abciclient.NewLocalClient(logger, app) - appClient := proxy.New(cc, logger, proxy.NopMetrics()) + appClient := proxy.New(app, logger, proxy.NopMetrics()) err := appClient.Start(ctx) require.NoError(t, err) @@ -164,8 +160,7 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -285,8 +280,7 @@ func TestProcessProposal(t *testing.T) { app := abcimocks.NewApplication(t) logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -501,8 +495,7 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -585,8 +578,7 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -636,8 +628,7 @@ func TestEmptyPrepareProposal(t *testing.T) { app := abcimocks.NewApplication(t) app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -708,8 +699,7 @@ func TestPrepareProposalErrorOnNonExistingRemoved(t *testing.T) { } app.On("PrepareProposal", mock.Anything, mock.Anything).Return(rpp, nil) - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -761,8 +751,7 @@ func TestPrepareProposalReorderTxs(t *testing.T) { TxRecords: trs, }, nil) - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -820,8 +809,7 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { TxRecords: trs, }, nil) - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -864,15 +852,8 @@ func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("ReapMaxBytesMaxGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(types.Txs(txs)) - cm := &abciclientmocks.Client{} - cm.On("IsRunning").Return(true) - cm.On("Error").Return(nil) - cm.On("Start", mock.Anything).Return(nil).Once() - cm.On("Wait").Return(nil).Once() - cm.On("Stop").Return(nil).Once() - cm.On("PrepareProposal", mock.Anything, mock.Anything).Return(nil, errors.New("an injected error")).Once() - - proxyApp := proxy.New(cm, logger, proxy.NopMetrics()) + app := &failingPrepareProposalApp{} + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err := proxyApp.Start(ctx) require.NoError(t, err) @@ -895,6 +876,14 @@ func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) { mp.AssertExpectations(t) } +type failingPrepareProposalApp struct { + abci.BaseApplication +} + +func (f failingPrepareProposalApp) PrepareProposal(context.Context, *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + return nil, errors.New("an injected error") +} + func makeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) types.BlockID { var ( h = make([]byte, crypto.HashSize) @@ -947,8 +936,7 @@ func TestCreateProposalBlockPanicRecovery(t *testing.T) { // Create the panicking app app := &panicApp{} - cc := abciclient.NewLocalClient(logger, app) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx)) defer proxyApp.Stop() diff --git a/sei-tendermint/internal/state/validation_test.go b/sei-tendermint/internal/state/validation_test.go index 2ebc114059..6c0d4328f7 100644 --- a/sei-tendermint/internal/state/validation_test.go +++ b/sei-tendermint/internal/state/validation_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" @@ -34,7 +33,7 @@ const validationTestsStopHeight int64 = 10 func TestValidateBlockHeader(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics()) + proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx)) eventBus := eventbus.NewDefault(logger) @@ -141,7 +140,7 @@ func TestValidateBlockCommit(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics()) + proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx)) eventBus := eventbus.NewDefault(logger) @@ -284,7 +283,7 @@ func TestValidateBlockEvidence(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics()) + proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) require.NoError(t, proxyApp.Start(ctx)) state, stateDB, privVals := makeState(t, 4, 1) diff --git a/sei-tendermint/node/node.go b/sei-tendermint/node/node.go index 29e164adca..4d7f0ba2b7 100644 --- a/sei-tendermint/node/node.go +++ b/sei-tendermint/node/node.go @@ -78,55 +78,6 @@ type nodeImpl struct { prometheusSrv *http.Server } -// newDefaultNode returns a Tendermint node with default settings for the -// PrivValidator, ClientCreator, GenesisDoc, and DBProvider. -// It implements NodeProvider. -func newDefaultNode( - ctx context.Context, - cfg *config.Config, - logger log.Logger, - restartEvent func(), -) (service.Service, error) { - nodeKey, err := types.LoadOrGenNodeKey(cfg.NodeKeyFile()) - if err != nil { - return nil, fmt.Errorf("failed to load or gen node key %s: %w", cfg.NodeKeyFile(), err) - } - - appClient, _, err := proxy.ClientFactory(logger, cfg.ProxyApp, cfg.ABCI, cfg.DBDir()) - if err != nil { - return nil, err - } - - if cfg.Mode == config.ModeSeed { - return makeSeedNode( - logger, - cfg, - config.DefaultDBProvider, - nodeKey, - defaultGenesisDocProviderFunc(cfg), - DefaultMetricsProvider(cfg.Instrumentation)(cfg.ChainID()), - ) - } - pval, err := makeDefaultPrivval(cfg) - if err != nil { - return nil, err - } - - return makeNode( - ctx, - cfg, - restartEvent, - pval, - nodeKey, - appClient, - defaultGenesisDocProviderFunc(cfg), - config.DefaultDBProvider, - logger, - []trace.TracerProviderOption{}, - DefaultMetricsProvider(cfg.Instrumentation)(cfg.ChainID()), - ) -} - // makeNode returns a new, ready to go, Tendermint Node. func makeNode( ctx context.Context, @@ -134,14 +85,13 @@ func makeNode( restartEvent func(), filePrivval *privval.FilePV, nodeKey types.NodeKey, - client abciclient.Client, + app abci.Application, genesisDocProvider genesisDocProvider, dbProvider config.DBProvider, logger log.Logger, tracerProviderOptions []trace.TracerProviderOption, nodeMetrics *NodeMetrics, ) (service.Service, error) { - var cancel context.CancelFunc ctx, cancel = context.WithCancel(ctx) @@ -169,7 +119,7 @@ func makeNode( return nil, combineCloseError(err, makeCloser(closers)) } - proxyApp := proxy.New(client, logger.With("module", "proxy"), nodeMetrics.proxy) + proxyApp := proxy.New(app, logger.With("module", "proxy"), nodeMetrics.proxy) eventBus := eventbus.NewDefault(logger.With("module", "events")) var eventLog *eventlog.Log diff --git a/sei-tendermint/node/node_test.go b/sei-tendermint/node/node_test.go index b1a3326391..92bd5219e9 100644 --- a/sei-tendermint/node/node_test.go +++ b/sei-tendermint/node/node_test.go @@ -15,7 +15,6 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" @@ -282,8 +281,8 @@ func TestCreateProposalBlock(t *testing.T) { logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, kvstore.NewApplication()) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + app := kvstore.NewApplication() + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err = proxyApp.Start(ctx) require.NoError(t, err) @@ -383,8 +382,8 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, kvstore.NewApplication()) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + app := kvstore.NewApplication() + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err = proxyApp.Start(ctx) require.NoError(t, err) @@ -455,8 +454,8 @@ func TestMaxProposalBlockSize(t *testing.T) { logger := log.NewNopLogger() - cc := abciclient.NewLocalClient(logger, kvstore.NewApplication()) - proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) + app := kvstore.NewApplication() + proxyApp := proxy.New(app, logger, proxy.NopMetrics()) err = proxyApp.Start(ctx) require.NoError(t, err) diff --git a/sei-tendermint/node/public.go b/sei-tendermint/node/public.go index 96f45f3a57..133b2d481d 100644 --- a/sei-tendermint/node/public.go +++ b/sei-tendermint/node/public.go @@ -5,7 +5,6 @@ import ( "context" "fmt" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" @@ -56,7 +55,7 @@ func New( restartEvent, pval, nodeKey, - abciclient.NewLocalClient(logger, app), + app, genProvider, config.DefaultDBProvider, logger, diff --git a/sei-tendermint/node/seed.go b/sei-tendermint/node/seed.go index bbb46f8137..c653de0ee5 100644 --- a/sei-tendermint/node/seed.go +++ b/sei-tendermint/node/seed.go @@ -8,7 +8,6 @@ import ( "strings" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" @@ -58,8 +57,6 @@ func makeSeedNode( return nil, errors.New("cannot run seed nodes with PEX disabled") } - client := abciclient.NewLocalClient(logger, abci.NewBaseApplication()) - genDoc, err := genesisDocProvider() if err != nil { return nil, err @@ -87,7 +84,7 @@ func makeSeedNode( return nil, fmt.Errorf("pex.NewReactor(): %w", err) } - proxyApp := proxy.New(client, logger.With("module", "proxy"), nodeMetrics.proxy) + proxyApp := proxy.New(abci.NewBaseApplication(), logger.With("module", "proxy"), nodeMetrics.proxy) closers := make([]closer, 0, 2) blockStore, stateDB, dbCloser, err := initDBs(cfg, dbProvider) From e2c1c806e730e84e8be28d84e804c06f12e1e216 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 21:04:16 +0100 Subject: [PATCH 06/16] turned proxy client into an app --- sei-tendermint/internal/proxy/client.go | 104 +++++------------------- 1 file changed, 19 insertions(+), 85 deletions(-) diff --git a/sei-tendermint/internal/proxy/client.go b/sei-tendermint/internal/proxy/client.go index 42da47bc96..c1aad0862e 100644 --- a/sei-tendermint/internal/proxy/client.go +++ b/sei-tendermint/internal/proxy/client.go @@ -2,163 +2,97 @@ package proxy import ( "context" - "os" - "syscall" "time" "github.com/go-kit/kit/metrics" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "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/libs/service" ) // proxyClient provides the application connection. type proxyClient struct { - service.BaseService - logger log.Logger - - client abciclient.Client + app types.Application metrics *Metrics } // New creates a proxy application interface around the provided ABCI application. -func New(app types.Application, logger log.Logger, metrics *Metrics) abciclient.Client { - client := abciclient.NewLocalClient(logger, app) - conn := &proxyClient{ - logger: logger, +func New(app types.Application, _ log.Logger, metrics *Metrics) types.Application { + return &proxyClient{ metrics: metrics, - client: client, - } - conn.BaseService = *service.NewBaseService(logger, "proxyClient", conn) - return conn -} - -func (app *proxyClient) OnStop() { tryCallStop(app.client) } -func (app *proxyClient) Error() error { return app.client.Error() } - -func tryCallStop(client abciclient.Client) { - if c, ok := client.(interface{ Stop() }); ok { - c.Stop() + app: app, } } -func (app *proxyClient) OnStart(ctx context.Context) error { - var err error - defer func() { - if err != nil { - tryCallStop(app.client) - } - }() - - // Kill Tendermint if the ABCI application crashes. - go func() { - if !app.client.IsRunning() { - return - } - app.client.Wait() - if ctx.Err() != nil { - return - } - - if err := app.client.Error(); err != nil { - app.logger.Error("client connection terminated. Did the application crash? Please restart tendermint", - "err", err) - - if killErr := kill(); killErr != nil { - app.logger.Error("Failed to kill this process - please do so manually", - "err", killErr) - } - } - - }() - - return app.client.Start(ctx) -} - -func kill() error { - p, err := os.FindProcess(os.Getpid()) - if err != nil { - return err - } - - return p.Signal(syscall.SIGABRT) -} - func (app *proxyClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "init_chain", "type", "sync"))() - return app.client.InitChain(ctx, req) + return app.app.InitChain(ctx, req) } func (app *proxyClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "prepare_proposal", "type", "sync"))() - return app.client.PrepareProposal(ctx, req) + return app.app.PrepareProposal(ctx, req) } func (app *proxyClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "process_proposal", "type", "sync"))() - return app.client.ProcessProposal(ctx, req) + return app.app.ProcessProposal(ctx, req) } func (app *proxyClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "finalize_block", "type", "sync"))() - return app.client.FinalizeBlock(ctx, req) + return app.app.FinalizeBlock(ctx, req) } func (app *proxyClient) GetTxPriorityHint(ctx context.Context, req *types.RequestGetTxPriorityHintV2) (*types.ResponseGetTxPriorityHint, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "get_tx_priority", "type", "sync"))() - return app.client.GetTxPriorityHint(ctx, req) + return app.app.GetTxPriorityHint(ctx, req) } func (app *proxyClient) Commit(ctx context.Context) (*types.ResponseCommit, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "commit", "type", "sync"))() - return app.client.Commit(ctx) + return app.app.Commit(ctx) } -func (app *proxyClient) Flush(ctx context.Context) error { - defer addTimeSample(app.metrics.MethodTiming.With("method", "flush", "type", "sync"))() - return app.client.Flush(ctx) -} +func (app *proxyClient) Flush(ctx context.Context) error { return nil } func (app *proxyClient) CheckTx(ctx context.Context, req *types.RequestCheckTxV2) (*types.ResponseCheckTxV2, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "check_tx", "type", "sync"))() - return app.client.CheckTx(ctx, req) + return app.app.CheckTx(ctx, req) } func (app *proxyClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) { - defer addTimeSample(app.metrics.MethodTiming.With("method", "echo", "type", "sync"))() - return app.client.Echo(ctx, msg) + return &types.ResponseEcho{Message: msg}, nil } func (app *proxyClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "info", "type", "sync"))() - return app.client.Info(ctx, req) + return app.app.Info(ctx, req) } func (app *proxyClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "query", "type", "sync"))() - return app.client.Query(ctx, req) + return app.app.Query(ctx, req) } func (app *proxyClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "list_snapshots", "type", "sync"))() - return app.client.ListSnapshots(ctx, req) + return app.app.ListSnapshots(ctx, req) } func (app *proxyClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "offer_snapshot", "type", "sync"))() - return app.client.OfferSnapshot(ctx, req) + return app.app.OfferSnapshot(ctx, req) } func (app *proxyClient) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "load_snapshot_chunk", "type", "sync"))() - return app.client.LoadSnapshotChunk(ctx, req) + return app.app.LoadSnapshotChunk(ctx, req) } func (app *proxyClient) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "apply_snapshot_chunk", "type", "sync"))() - return app.client.ApplySnapshotChunk(ctx, req) + return app.app.ApplySnapshotChunk(ctx, req) } // addTimeSample returns a function that, when called, adds an observation to m. From 637fe790ce0d94324faf997e56edb930b38aadda Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 21:35:25 +0100 Subject: [PATCH 07/16] Client -> Application --- sei-cosmos/server/start.go | 3 +- sei-cosmos/testutil/network/util.go | 3 +- .../internal/blocksync/reactor_test.go | 9 ------ sei-tendermint/internal/consensus/replay.go | 12 +++----- .../internal/consensus/replay_stubs.go | 3 +- .../internal/consensus/replay_test.go | 19 ++---------- sei-tendermint/internal/mempool/mempool.go | 18 ++++-------- sei-tendermint/internal/proxy/client.go | 10 ++----- sei-tendermint/internal/rpc/core/env.go | 4 +-- sei-tendermint/internal/state/execution.go | 7 ++--- .../internal/state/execution_test.go | 29 +++---------------- .../internal/state/validation_test.go | 3 -- sei-tendermint/internal/statesync/reactor.go | 5 ++-- sei-tendermint/internal/statesync/syncer.go | 3 +- sei-tendermint/node/node.go | 7 +---- sei-tendermint/node/node_test.go | 6 ---- sei-tendermint/node/setup.go | 9 +++--- 17 files changed, 33 insertions(+), 117 deletions(-) diff --git a/sei-cosmos/server/start.go b/sei-cosmos/server/start.go index 45621a433c..c4b2f93bc9 100644 --- a/sei-cosmos/server/start.go +++ b/sei-cosmos/server/start.go @@ -17,7 +17,6 @@ import ( clientconfig "github.com/cosmos/cosmos-sdk/client/config" genesistypes "github.com/cosmos/cosmos-sdk/types/genesis" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" tcmd "github.com/sei-protocol/sei-chain/sei-tendermint/cmd/tendermint/commands" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/service" "github.com/sei-protocol/sei-chain/sei-tendermint/node" @@ -355,7 +354,7 @@ func startInProcess( ctx.Config, ctx.Logger, restartEvent, - abciclient.NewLocalClient(ctx.Logger, app), + app, gen, tracerProviderOptions, nodeMetricsProvider, diff --git a/sei-cosmos/testutil/network/util.go b/sei-cosmos/testutil/network/util.go index 5f5a689663..4a570caa82 100644 --- a/sei-cosmos/testutil/network/util.go +++ b/sei-cosmos/testutil/network/util.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/codec" tmtime "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/telemetry" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" tmos "github.com/sei-protocol/sei-chain/sei-tendermint/libs/os" "github.com/sei-protocol/sei-chain/sei-tendermint/node" "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client/local" @@ -57,7 +56,7 @@ func startInProcess(cfg Config, val *Validator) error { tmCfg, logger, func() {}, - abciclient.NewLocalClient(logger, app), + app, defaultGensis, []trace.TracerProviderOption{}, node.NoOpMetricsProvider(), diff --git a/sei-tendermint/internal/blocksync/reactor_test.go b/sei-tendermint/internal/blocksync/reactor_test.go index 78ecad78b4..fbe52edee8 100644 --- a/sei-tendermint/internal/blocksync/reactor_test.go +++ b/sei-tendermint/internal/blocksync/reactor_test.go @@ -14,7 +14,6 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/consensus" @@ -37,7 +36,6 @@ type reactorTestSuite struct { nodes []types.NodeID reactors map[types.NodeID]*Reactor - app map[types.NodeID]abciclient.Client } func setup( @@ -62,7 +60,6 @@ func setup( network: p2p.MakeTestNetwork(t, p2p.TestNetworkOptions{NumNodes: numNodes}), nodes: make([]types.NodeID, 0, numNodes), reactors: make(map[types.NodeID]*Reactor, numNodes), - app: make(map[types.NodeID]abciclient.Client, numNodes), } for i, nodeID := range rts.network.NodeIDs() { @@ -74,7 +71,6 @@ func setup( for _, nodeID := range rts.nodes { if rts.reactors[nodeID].IsRunning() { rts.reactors[nodeID].Wait() - rts.app[nodeID].Wait() require.False(t, rts.reactors[nodeID].IsRunning()) } @@ -97,7 +93,6 @@ func makeReactor( logger := log.NewNopLogger() app := proxy.New(abci.NewBaseApplication(), logger, proxy.NopMetrics()) - require.NoError(t, app.Start(ctx)) blockDB := dbm.NewMemDB() stateDB := dbm.NewMemDB() @@ -164,11 +159,7 @@ func (rts *reactorTestSuite) addNode( ) { t.Helper() - logger := log.NewNopLogger() - rts.nodes = append(rts.nodes, nodeID) - rts.app[nodeID] = proxy.New(abci.NewBaseApplication(), logger, proxy.NopMetrics()) - require.NoError(t, rts.app[nodeID].Start(ctx)) remediationConfig := config.DefaultSelfRemediationConfig() remediationConfig.BlocksBehindThreshold = 1000 diff --git a/sei-tendermint/internal/consensus/replay.go b/sei-tendermint/internal/consensus/replay.go index 8f273294c5..b0e56d8872 100644 --- a/sei-tendermint/internal/consensus/replay.go +++ b/sei-tendermint/internal/consensus/replay.go @@ -6,7 +6,6 @@ import ( "fmt" "reflect" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/merkle" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" @@ -167,7 +166,7 @@ func (h *Handshaker) NBlocks() int { } // TODO: retry the handshake/replay if it fails ? -func (h *Handshaker) Handshake(ctx context.Context, appClient abciclient.Client) error { +func (h *Handshaker) Handshake(ctx context.Context, appClient abci.Application) error { // Handshake is done via ABCI Info on the query conn. res, err := appClient.Info(ctx, &proxy.RequestInfo) @@ -216,7 +215,7 @@ func (h *Handshaker) ReplayBlocks( state sm.State, appHash []byte, appBlockHeight int64, - appClient abciclient.Client, + appClient abci.Application, ) ([]byte, error) { storeBlockBase := h.store.Base() storeBlockHeight := h.store.Height() @@ -369,9 +368,6 @@ func (h *Handshaker) ReplayBlocks( if err != nil { return nil, err } - if err := mockApp.Start(ctx); err != nil { - return nil, err - } h.logger.Info("Replay last block using mock app") state, err = h.replayBlock(ctx, state, storeBlockHeight, mockApp) @@ -391,7 +387,7 @@ func (h *Handshaker) ReplayBlocks( func (h *Handshaker) replayBlocks( ctx context.Context, state sm.State, - appClient abciclient.Client, + appClient abci.Application, appBlockHeight, storeBlockHeight int64, mutateState bool, @@ -465,7 +461,7 @@ func (h *Handshaker) replayBlock( ctx context.Context, state sm.State, height int64, - appClient abciclient.Client, + appClient abci.Application, ) (sm.State, error) { block := h.store.LoadBlock(height) meta := h.store.LoadBlockMeta(height) diff --git a/sei-tendermint/internal/consensus/replay_stubs.go b/sei-tendermint/internal/consensus/replay_stubs.go index 9c6c0b2bd9..5be962c1a3 100644 --- a/sei-tendermint/internal/consensus/replay_stubs.go +++ b/sei-tendermint/internal/consensus/replay_stubs.go @@ -3,7 +3,6 @@ package consensus import ( "context" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/libs/clist" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool" @@ -73,7 +72,7 @@ func newMockProxyApp( logger log.Logger, appHash []byte, finalizeBlockResponses *abci.ResponseFinalizeBlock, -) (abciclient.Client, error) { +) (abci.Application, error) { return proxy.New(&mockProxyApp{ appHash: appHash, finalizeBlockResponses: finalizeBlockResponses, diff --git a/sei-tendermint/internal/consensus/replay_test.go b/sei-tendermint/internal/consensus/replay_test.go index a1dc541fa8..c5fd251f7f 100644 --- a/sei-tendermint/internal/consensus/replay_test.go +++ b/sei-tendermint/internal/consensus/replay_test.go @@ -16,7 +16,6 @@ import ( "github.com/stretchr/testify/assert" dbm "github.com/tendermint/tm-db" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" @@ -722,10 +721,6 @@ func testHandshakeReplay( require.NoError(t, err) handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx), "Error starting proxy app connections") - require.True(t, proxyApp.IsRunning()) - require.NotNil(t, proxyApp) - t.Cleanup(func() { cancel(); proxyApp.Wait() }) err = handshaker.Handshake(ctx, proxyApp) if expectError { @@ -768,7 +763,7 @@ func applyBlock( evpool sm.EvidencePool, st sm.State, blk *types.Block, - appClient abciclient.Client, + appClient abci.Application, blockStore *mockBlockStore, eventBus *eventbus.EventBus, ) sm.State { @@ -786,7 +781,7 @@ func applyBlock( func buildAppStateFromChain( ctx context.Context, t *testing.T, - appClient abciclient.Client, + appClient abci.Application, stateStore sm.Store, mempool mempool.Mempool, evpool sm.EvidencePool, @@ -799,8 +794,6 @@ func buildAppStateFromChain( ) { t.Helper() // start a new app without handshake, play nBlocks blocks - require.NoError(t, appClient.Start(ctx)) - state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.TM2PB.ValidatorUpdates(state.Validators) _, err := appClient.InitChain(ctx, &abci.RequestInitChain{ @@ -851,7 +844,6 @@ func buildTMStateFromChain( app := kvstore.NewApplication() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx)) state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.TM2PB.ValidatorUpdates(state.Validators) @@ -927,9 +919,6 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { { app := &badApp{numBlocks: 3, allHashesAreWrong: true} proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) - t.Cleanup(func() { proxyApp.Wait() }) h := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) assert.Error(t, h.Handshake(ctx, proxyApp)) @@ -942,9 +931,6 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { { app := &badApp{numBlocks: 3, onlyLastHashIsWrong: true} proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) - t.Cleanup(func() { proxyApp.Wait() }) h := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) require.Error(t, h.Handshake(ctx, proxyApp)) @@ -1171,7 +1157,6 @@ func TestHandshakeUpdatesValidators(t *testing.T) { handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx), "Error starting proxy app connections") require.NoError(t, handshaker.Handshake(ctx, proxyApp), "error on abci handshake") diff --git a/sei-tendermint/internal/mempool/mempool.go b/sei-tendermint/internal/mempool/mempool.go index ed5413bd4a..465426b259 100644 --- a/sei-tendermint/internal/mempool/mempool.go +++ b/sei-tendermint/internal/mempool/mempool.go @@ -11,7 +11,6 @@ import ( "sync/atomic" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/libs/clist" @@ -52,7 +51,7 @@ type TxMempool struct { logger log.Logger metrics *Metrics config *config.MempoolConfig - proxyAppConn abciclient.Client + proxyAppConn abci.Application // txsAvailable fires once for each height when the mempool is not empty txsAvailable chan struct{} @@ -128,7 +127,7 @@ type TxMempool struct { func NewTxMempool( logger log.Logger, cfg *config.MempoolConfig, - proxyAppConn abciclient.Client, + proxyAppConn abci.Application, router router, options ...TxMempoolOption, ) *TxMempool { @@ -242,11 +241,11 @@ func (txmp *TxMempool) PendingSizeBytes() int64 { return atomic.LoadInt64(&txmp.pendingSizeBytes) } -// FlushAppConn executes FlushSync on the mempool's proxyAppConn. +// FlushAppConn is kept for compatibility; it no longer needs to flush the application. // // NOTE: The caller must obtain a write-lock prior to execution. -func (txmp *TxMempool) FlushAppConn(ctx context.Context) error { - return txmp.proxyAppConn.Flush(ctx) +func (txmp *TxMempool) FlushAppConn(context.Context) error { + return nil } // WaitForNextTx returns a blocking channel that will be closed when the next @@ -342,10 +341,6 @@ func (txmp *TxMempool) CheckTx( } } - if err := txmp.proxyAppConn.Error(); err != nil { - return err - } - txHash := tx.Key() // We add the transaction to the mempool's cache and if the @@ -982,9 +977,6 @@ func (txmp *TxMempool) updateReCheckTxs(ctx context.Context) { } } - if err := txmp.proxyAppConn.Flush(ctx); err != nil { - txmp.logger.Error("failed to flush transactions during rechecking", "err", err) - } } // canAddTx returns an error if we cannot insert the provided *WrappedTx into diff --git a/sei-tendermint/internal/proxy/client.go b/sei-tendermint/internal/proxy/client.go index c1aad0862e..0f34eb57dd 100644 --- a/sei-tendermint/internal/proxy/client.go +++ b/sei-tendermint/internal/proxy/client.go @@ -12,7 +12,7 @@ import ( // proxyClient provides the application connection. type proxyClient struct { - app types.Application + app types.Application metrics *Metrics } @@ -20,7 +20,7 @@ type proxyClient struct { func New(app types.Application, _ log.Logger, metrics *Metrics) types.Application { return &proxyClient{ metrics: metrics, - app: app, + app: app, } } @@ -54,17 +54,11 @@ func (app *proxyClient) Commit(ctx context.Context) (*types.ResponseCommit, erro return app.app.Commit(ctx) } -func (app *proxyClient) Flush(ctx context.Context) error { return nil } - func (app *proxyClient) CheckTx(ctx context.Context, req *types.RequestCheckTxV2) (*types.ResponseCheckTxV2, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "check_tx", "type", "sync"))() return app.app.CheckTx(ctx, req) } -func (app *proxyClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) { - return &types.ResponseEcho{Message: msg}, nil -} - func (app *proxyClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { defer addTimeSample(app.metrics.MethodTiming.With("method", "info", "type", "sync"))() return app.app.Info(ctx, req) diff --git a/sei-tendermint/internal/rpc/core/env.go b/sei-tendermint/internal/rpc/core/env.go index 02a8b7e3fe..1107ea625a 100644 --- a/sei-tendermint/internal/rpc/core/env.go +++ b/sei-tendermint/internal/rpc/core/env.go @@ -10,7 +10,7 @@ import ( "github.com/rs/cors" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" + abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/blocksync" @@ -69,7 +69,7 @@ type peerManager interface { // to be setup once during startup. type Environment struct { // external, thread safe interfaces - ProxyApp abciclient.Client + ProxyApp abci.Application // interfaces defined in types and above StateStore sm.Store diff --git a/sei-tendermint/internal/state/execution.go b/sei-tendermint/internal/state/execution.go index 9839bcaef1..71dd41a1a8 100644 --- a/sei-tendermint/internal/state/execution.go +++ b/sei-tendermint/internal/state/execution.go @@ -8,7 +8,6 @@ import ( "math" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/merkle" @@ -34,7 +33,7 @@ type BlockExecutor struct { blockStore BlockStore // execute the app against this - appClient abciclient.Client + appClient abci.Application // events eventBus types.BlockEventPublisher @@ -55,7 +54,7 @@ type BlockExecutor struct { func NewBlockExecutor( stateStore Store, logger log.Logger, - appClient abciclient.Client, + appClient abci.Application, pool mempool.Mempool, evpool EvidencePool, blockStore BlockStore, @@ -823,7 +822,7 @@ func FireEvents( func ExecCommitBlock( ctx context.Context, be *BlockExecutor, - appConn abciclient.Client, + appConn abci.Application, block *types.Block, logger log.Logger, store Store, diff --git a/sei-tendermint/internal/state/execution_test.go b/sei-tendermint/internal/state/execution_test.go index 5e9e39edba..bb6e14c321 100644 --- a/sei-tendermint/internal/state/execution_test.go +++ b/sei-tendermint/internal/state/execution_test.go @@ -42,8 +42,6 @@ func TestApplyBlock(t *testing.T) { ctx := t.Context() - require.NoError(t, proxyApp.Start(ctx)) - eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -88,9 +86,6 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) { app := &testApp{} appClient := proxy.New(app, logger, proxy.NopMetrics()) - err := appClient.Start(ctx) - require.NoError(t, err) - state, stateDB, privVals := makeState(t, 7, 1) stateStore := sm.NewStore(stateDB) absentSig := types.NewCommitSigAbsent() @@ -161,8 +156,6 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) state, stateDB, privVals := makeState(t, 1, 1) stateStore := sm.NewStore(stateDB) @@ -281,8 +274,6 @@ func TestProcessProposal(t *testing.T) { app := abcimocks.NewApplication(t) logger := log.NewNopLogger() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) state, stateDB, privVals := makeState(t, 1, height) stateStore := sm.NewStore(stateDB) @@ -496,8 +487,6 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) state, stateDB, _ := makeState(t, 1, 1) stateStore := sm.NewStore(stateDB) @@ -579,8 +568,6 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -620,6 +607,7 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { func TestEmptyPrepareProposal(t *testing.T) { const height = 2 ctx := t.Context() + var err error logger := log.NewNopLogger() @@ -629,8 +617,6 @@ func TestEmptyPrepareProposal(t *testing.T) { app := abcimocks.NewApplication(t) app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) state, stateDB, privVals := makeState(t, 1, height) stateStore := sm.NewStore(stateDB) @@ -700,8 +686,6 @@ func TestPrepareProposalErrorOnNonExistingRemoved(t *testing.T) { app.On("PrepareProposal", mock.Anything, mock.Anything).Return(rpp, nil) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) blockExec := sm.NewBlockExecutor( stateStore, @@ -727,6 +711,7 @@ func TestPrepareProposalErrorOnNonExistingRemoved(t *testing.T) { func TestPrepareProposalReorderTxs(t *testing.T) { const height = 2 ctx := t.Context() + var err error logger := log.NewNopLogger() eventBus := eventbus.NewDefault(logger) @@ -752,8 +737,6 @@ func TestPrepareProposalReorderTxs(t *testing.T) { }, nil) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) blockExec := sm.NewBlockExecutor( stateStore, @@ -782,6 +765,7 @@ func TestPrepareProposalReorderTxs(t *testing.T) { func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { const height = 2 ctx := t.Context() + var err error logger := log.NewNopLogger() eventBus := eventbus.NewDefault(logger) @@ -810,8 +794,6 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { }, nil) proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) blockExec := sm.NewBlockExecutor( stateStore, @@ -837,6 +819,7 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) { const height = 2 ctx := t.Context() + var err error logger := log.NewNopLogger() eventBus := eventbus.NewDefault(logger) @@ -854,8 +837,6 @@ func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) { app := &failingPrepareProposalApp{} proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err := proxyApp.Start(ctx) - require.NoError(t, err) blockExec := sm.NewBlockExecutor( stateStore, @@ -937,8 +918,6 @@ func TestCreateProposalBlockPanicRecovery(t *testing.T) { // Create the panicking app app := &panicApp{} proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx)) - defer proxyApp.Stop() // Create test state and executor state, stateDB, _ := makeState(t, 1, 1) diff --git a/sei-tendermint/internal/state/validation_test.go b/sei-tendermint/internal/state/validation_test.go index 6c0d4328f7..37590e0d84 100644 --- a/sei-tendermint/internal/state/validation_test.go +++ b/sei-tendermint/internal/state/validation_test.go @@ -34,7 +34,6 @@ func TestValidateBlockHeader(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx)) eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -141,7 +140,6 @@ func TestValidateBlockCommit(t *testing.T) { logger := log.NewNopLogger() proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx)) eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -284,7 +282,6 @@ func TestValidateBlockEvidence(t *testing.T) { logger := log.NewNopLogger() proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) - require.NoError(t, proxyApp.Start(ctx)) state, stateDB, privVals := makeState(t, 4, 1) stateStore := sm.NewStore(stateDB) diff --git a/sei-tendermint/internal/statesync/reactor.go b/sei-tendermint/internal/statesync/reactor.go index 130ab057df..30bdd1b644 100644 --- a/sei-tendermint/internal/statesync/reactor.go +++ b/sei-tendermint/internal/statesync/reactor.go @@ -11,7 +11,6 @@ import ( "sync" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" @@ -169,7 +168,7 @@ type Reactor struct { stateStore sm.Store blockStore *store.BlockStore - conn abciclient.Client + conn abci.Application tempDir string router *p2p.Router evict func(types.NodeID, error) @@ -228,7 +227,7 @@ func NewReactor( initialHeight int64, cfg config.StateSyncConfig, logger log.Logger, - conn abciclient.Client, + conn abci.Application, router *p2p.Router, stateStore sm.Store, blockStore *store.BlockStore, diff --git a/sei-tendermint/internal/statesync/syncer.go b/sei-tendermint/internal/statesync/syncer.go index 2c6bae0be1..f77497e856 100644 --- a/sei-tendermint/internal/statesync/syncer.go +++ b/sei-tendermint/internal/statesync/syncer.go @@ -8,7 +8,6 @@ import ( "sync" "time" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" @@ -54,7 +53,7 @@ var ( type syncer struct { logger log.Logger stateProvider StateProvider - conn abciclient.Client + conn abci.Application snapshots *snapshotPool snapshotCh *p2p.Channel[*pb.Message] chunkCh *p2p.Channel[*pb.Message] diff --git a/sei-tendermint/node/node.go b/sei-tendermint/node/node.go index 4d7f0ba2b7..99a5cf6ab7 100644 --- a/sei-tendermint/node/node.go +++ b/sei-tendermint/node/node.go @@ -14,7 +14,6 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "go.opentelemetry.io/otel/sdk/trace" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" @@ -376,10 +375,6 @@ func makeNode( // OnStart starts the Node. It implements service.Service. func (n *nodeImpl) OnStart(ctx context.Context) error { - if err := n.rpcEnv.ProxyApp.Start(ctx); err != nil { - return fmt.Errorf("error starting proxy app connections: %w", err) - } - // EventBus and IndexerService must be started before the handshake because // we might need to index the txs of the replayed block as this might not have happened // when the node stopped last time (i.e. the node stopped or crashed after it saved the block @@ -704,7 +699,7 @@ func LoadStateFromDBOrGenesisDocProvider(stateStore sm.Store, genDoc *types.Gene return state, nil } -func getRouterConfig(conf *config.Config, appClient abciclient.Client) *p2p.RouterOptions { +func getRouterConfig(conf *config.Config, appClient abci.Application) *p2p.RouterOptions { opts := p2p.RouterOptions{} if conf.FilterPeers && appClient != nil { diff --git a/sei-tendermint/node/node_test.go b/sei-tendermint/node/node_test.go index 92bd5219e9..cdcec8333e 100644 --- a/sei-tendermint/node/node_test.go +++ b/sei-tendermint/node/node_test.go @@ -283,8 +283,6 @@ func TestCreateProposalBlock(t *testing.T) { app := kvstore.NewApplication() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err = proxyApp.Start(ctx) - require.NoError(t, err) const height int64 = 1 state, stateDB, privVals := state(t, 1, height) @@ -384,8 +382,6 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { app := kvstore.NewApplication() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err = proxyApp.Start(ctx) - require.NoError(t, err) const height int64 = 1 state, stateDB, _ := state(t, 1, height) @@ -456,8 +452,6 @@ func TestMaxProposalBlockSize(t *testing.T) { app := kvstore.NewApplication() proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - err = proxyApp.Start(ctx) - require.NoError(t, err) state, stateDB, privVals := state(t, types.MaxVotesCount, int64(1)) diff --git a/sei-tendermint/node/setup.go b/sei-tendermint/node/setup.go index cc38d82db7..a566a4e603 100644 --- a/sei-tendermint/node/setup.go +++ b/sei-tendermint/node/setup.go @@ -8,9 +8,7 @@ import ( "strings" "time" - dbm "github.com/tendermint/tm-db" - - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" + abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/blocksync" @@ -33,6 +31,7 @@ import ( tmgrpc "github.com/sei-protocol/sei-chain/sei-tendermint/privval/grpc" "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/sei-protocol/sei-chain/sei-tendermint/version" + dbm "github.com/tendermint/tm-db" "golang.org/x/time/rate" _ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port @@ -148,7 +147,7 @@ func onlyValidatorIsUs(state sm.State, pubKey utils.Option[crypto.PubKey]) bool func createMempoolReactor( logger log.Logger, cfg *config.Config, - appClient abciclient.Client, + appClient abci.Application, store sm.Store, memplMetrics *mempool.Metrics, router *p2p.Router, @@ -213,7 +212,7 @@ func createRouter( nodeInfoProducer func() *types.NodeInfo, nodeKey types.NodeKey, cfg *config.Config, - appClient abciclient.Client, + appClient abci.Application, dbProvider config.DBProvider, ) (*p2p.Router, closer, error) { closer := func() error { return nil } From b2513d08b516e134c0cddb7da9a24f6c122c73b8 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 21:43:46 +0100 Subject: [PATCH 08/16] FlushAppConn --- .../internal/blocksync/reactor_test.go | 1 - .../internal/consensus/replay_stubs.go | 9 ++++----- sei-tendermint/internal/mempool/mempool.go | 7 ------- .../internal/mempool/mocks/mempool.go | 18 ------------------ sei-tendermint/internal/mempool/types.go | 7 ------- sei-tendermint/internal/state/execution.go | 12 +----------- .../internal/state/execution_test.go | 5 ----- sei-tendermint/internal/state/metrics.gen.go | 7 ------- sei-tendermint/internal/state/metrics.go | 4 ---- .../internal/state/validation_test.go | 3 --- 10 files changed, 5 insertions(+), 68 deletions(-) diff --git a/sei-tendermint/internal/blocksync/reactor_test.go b/sei-tendermint/internal/blocksync/reactor_test.go index fbe52edee8..25067b7cb8 100644 --- a/sei-tendermint/internal/blocksync/reactor_test.go +++ b/sei-tendermint/internal/blocksync/reactor_test.go @@ -105,7 +105,6 @@ func makeReactor( mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, diff --git a/sei-tendermint/internal/consensus/replay_stubs.go b/sei-tendermint/internal/consensus/replay_stubs.go index 5be962c1a3..31569b3675 100644 --- a/sei-tendermint/internal/consensus/replay_stubs.go +++ b/sei-tendermint/internal/consensus/replay_stubs.go @@ -50,11 +50,10 @@ func (emptyMempool) Update( ) error { return nil } -func (emptyMempool) Flush() {} -func (emptyMempool) FlushAppConn(ctx context.Context) error { return nil } -func (emptyMempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } -func (emptyMempool) EnableTxsAvailable() {} -func (emptyMempool) SizeBytes() int64 { return 0 } +func (emptyMempool) Flush() {} +func (emptyMempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } +func (emptyMempool) EnableTxsAvailable() {} +func (emptyMempool) SizeBytes() int64 { return 0 } func (emptyMempool) TxsFront() *clist.CElement { return nil } func (emptyMempool) TxsWaitChan() <-chan struct{} { return nil } diff --git a/sei-tendermint/internal/mempool/mempool.go b/sei-tendermint/internal/mempool/mempool.go index 465426b259..1ae6e86fcc 100644 --- a/sei-tendermint/internal/mempool/mempool.go +++ b/sei-tendermint/internal/mempool/mempool.go @@ -241,13 +241,6 @@ func (txmp *TxMempool) PendingSizeBytes() int64 { return atomic.LoadInt64(&txmp.pendingSizeBytes) } -// FlushAppConn is kept for compatibility; it no longer needs to flush the application. -// -// NOTE: The caller must obtain a write-lock prior to execution. -func (txmp *TxMempool) FlushAppConn(context.Context) error { - return nil -} - // WaitForNextTx returns a blocking channel that will be closed when the next // valid transaction is available to gossip. It is thread-safe. func (txmp *TxMempool) WaitForNextTx() <-chan struct{} { diff --git a/sei-tendermint/internal/mempool/mocks/mempool.go b/sei-tendermint/internal/mempool/mocks/mempool.go index f5ceb73ec3..fca9cc7d0b 100644 --- a/sei-tendermint/internal/mempool/mocks/mempool.go +++ b/sei-tendermint/internal/mempool/mocks/mempool.go @@ -44,24 +44,6 @@ func (_m *Mempool) Flush() { _m.Called() } -// FlushAppConn provides a mock function with given fields: _a0 -func (_m *Mempool) FlushAppConn(_a0 context.Context) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for FlushAppConn") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - // GetTxsForKeys provides a mock function with given fields: txKeys func (_m *Mempool) GetTxsForKeys(txKeys []types.TxKey) types.Txs { ret := _m.Called(txKeys) diff --git a/sei-tendermint/internal/mempool/types.go b/sei-tendermint/internal/mempool/types.go index 6a0705e1b1..6a5a9d87da 100644 --- a/sei-tendermint/internal/mempool/types.go +++ b/sei-tendermint/internal/mempool/types.go @@ -82,13 +82,6 @@ type Mempool interface { recheck bool, ) error - // FlushAppConn flushes the mempool connection to ensure async callback calls - // are done, e.g. from CheckTx. - // - // NOTE: - // 1. Lock/Unlock must be managed by caller. - FlushAppConn(context.Context) error - // Flush removes all transactions from the mempool and caches. Flush() diff --git a/sei-tendermint/internal/state/execution.go b/sei-tendermint/internal/state/execution.go index 71dd41a1a8..52c3d41565 100644 --- a/sei-tendermint/internal/state/execution.go +++ b/sei-tendermint/internal/state/execution.go @@ -484,18 +484,8 @@ func (blockExec *BlockExecutor) Commit( blockExec.mempool.Lock() defer blockExec.mempool.Unlock() - // while mempool is Locked, flush to ensure all async requests have completed - // in the ABCI app before Commit. - start := time.Now() - err := blockExec.mempool.FlushAppConn(ctx) - if err != nil { - blockExec.logger.Error("client error during mempool.FlushAppConn", "err", err) - return 0, err - } - blockExec.metrics.FlushAppConnectionTime.Observe(float64(time.Since(start))) - // Commit block, get hash back - start = time.Now() + start := time.Now() res, err := blockExec.appClient.Commit(ctx) if err != nil { blockExec.logger.Error("client error during proxyAppConn.Commit", "err", err) diff --git a/sei-tendermint/internal/state/execution_test.go b/sei-tendermint/internal/state/execution_test.go index bb6e14c321..d38d949bef 100644 --- a/sei-tendermint/internal/state/execution_test.go +++ b/sei-tendermint/internal/state/execution_test.go @@ -51,7 +51,6 @@ func TestApplyBlock(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -109,7 +108,6 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -233,7 +231,6 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -494,7 +491,6 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -623,7 +619,6 @@ func TestEmptyPrepareProposal(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, diff --git a/sei-tendermint/internal/state/metrics.gen.go b/sei-tendermint/internal/state/metrics.gen.go index 164e9a0e26..7450a99a36 100644 --- a/sei-tendermint/internal/state/metrics.gen.go +++ b/sei-tendermint/internal/state/metrics.gen.go @@ -34,12 +34,6 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Name: "validator_set_updates", Help: "Number of validator set updates returned by the application since process start.", }, labels).With(labelsAndValues...), - FlushAppConnectionTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{ - Namespace: namespace, - Subsystem: MetricsSubsystem, - Name: "flush_app_connection_time", - Help: "ValidatorSetUpdates measures how long it takes async ABCI requests to be flushed before committing application state", - }, labels).With(labelsAndValues...), ApplicationCommitTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{ Namespace: namespace, Subsystem: MetricsSubsystem, @@ -100,7 +94,6 @@ func NopMetrics() *Metrics { BlockProcessingTime: discard.NewHistogram(), ConsensusParamUpdates: discard.NewCounter(), ValidatorSetUpdates: discard.NewCounter(), - FlushAppConnectionTime: discard.NewHistogram(), ApplicationCommitTime: discard.NewHistogram(), UpdateMempoolTime: discard.NewHistogram(), FinalizeBlockLatency: discard.NewHistogram(), diff --git a/sei-tendermint/internal/state/metrics.go b/sei-tendermint/internal/state/metrics.go index ddaea31929..86e724cbd8 100644 --- a/sei-tendermint/internal/state/metrics.go +++ b/sei-tendermint/internal/state/metrics.go @@ -27,10 +27,6 @@ type Metrics struct { //metrics:Number of validator set updates returned by the application since process start. ValidatorSetUpdates metrics.Counter - // ValidatorSetUpdates measures how long it takes async ABCI requests to be flushed before - // committing application state - FlushAppConnectionTime metrics.Histogram - // ApplicationCommitTime measures how long it takes to commit application state ApplicationCommitTime metrics.Histogram diff --git a/sei-tendermint/internal/state/validation_test.go b/sei-tendermint/internal/state/validation_test.go index 37590e0d84..e57de4f14c 100644 --- a/sei-tendermint/internal/state/validation_test.go +++ b/sei-tendermint/internal/state/validation_test.go @@ -43,7 +43,6 @@ func TestValidateBlockHeader(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -149,7 +148,6 @@ func TestValidateBlockCommit(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, @@ -299,7 +297,6 @@ func TestValidateBlockEvidence(t *testing.T) { mp := &mpmocks.Mempool{} mp.On("Lock").Return() mp.On("Unlock").Return() - mp.On("FlushAppConn", mock.Anything).Return(nil) mp.On("Update", mock.Anything, mock.Anything, From f38da569d06cdb95bab56dd54053f236547ce24b Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 21:56:14 +0100 Subject: [PATCH 09/16] removed client --- sei-tendermint/abci/client/doc.go | 20 --- sei-tendermint/abci/client/local_client.go | 54 ------- .../abci/example/kvstore/kvstore_test.go | 5 +- sei-tendermint/abci/tests/server/client.go | 7 +- .../internal/consensus/common_test.go | 5 +- .../internal/consensus/reactor_test.go | 5 +- .../internal/mempool/mempool_bench_test.go | 7 +- .../internal/mempool/mempool_test.go | 144 +++--------------- .../internal/mempool/reactor_test.go | 8 +- .../test/fuzz/tests/mempool_test.go | 10 +- 10 files changed, 37 insertions(+), 228 deletions(-) delete mode 100644 sei-tendermint/abci/client/doc.go delete mode 100644 sei-tendermint/abci/client/local_client.go diff --git a/sei-tendermint/abci/client/doc.go b/sei-tendermint/abci/client/doc.go deleted file mode 100644 index e933554439..0000000000 --- a/sei-tendermint/abci/client/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Package abciclient provides an ABCI implementation in Go. -// -// There are 3 clients available: -// 1. socket (unix or TCP) -// 2. local (in memory) -// 3. gRPC -// -// ## Socket client -// -// The client blocks for enqueuing the request, for enqueuing the -// Flush to send the request, and for the Flush response to return. -// -// ## Local client -// -// # The global mutex is locked during each call -// -// ## gRPC client -// -// The client waits for all calls to complete. -package abciclient diff --git a/sei-tendermint/abci/client/local_client.go b/sei-tendermint/abci/client/local_client.go deleted file mode 100644 index 6ca11910f5..0000000000 --- a/sei-tendermint/abci/client/local_client.go +++ /dev/null @@ -1,54 +0,0 @@ -package abciclient - -import ( - "context" - - types "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/libs/service" -) - -// Client defines the interface for an ABCI client. -// -// NOTE these are client errors, eg. ABCI socket connectivity issues. -// Application-related errors are reflected in response via ABCI error codes -// and (potentially) error response. -type Client interface { - service.Service - types.Application - - Error() error - Flush(context.Context) error - Echo(context.Context, string) (*types.ResponseEcho, error) -} - -// NOTE: use defer to unlock mutex because Application might panic (e.g., in -// case of malicious tx or query). It only makes sense for publicly exposed -// methods like CheckTx (/broadcast_tx_* RPC endpoint) or Query (/abci_query -// RPC endpoint), but defers are used everywhere for the sake of consistency. -type localClient struct { - service.BaseService - types.Application -} - -var _ Client = (*localClient)(nil) - -// NewLocalClient creates a local client, which will be directly calling the -// methods of the given app. -// -// The client methods ignore their context argument. -func NewLocalClient(logger log.Logger, app types.Application) Client { - cli := &localClient{ - Application: app, - } - cli.BaseService = *service.NewBaseService(logger, "localClient", cli) - return cli -} - -func (*localClient) OnStart(context.Context) error { return nil } -func (*localClient) OnStop() {} -func (*localClient) Error() error { return nil } -func (*localClient) Flush(context.Context) error { return nil } -func (*localClient) Echo(_ context.Context, msg string) (*types.ResponseEcho, error) { - return &types.ResponseEcho{Message: msg}, nil -} diff --git a/sei-tendermint/abci/example/kvstore/kvstore_test.go b/sei-tendermint/abci/example/kvstore/kvstore_test.go index 4565e29cd4..54aae289b3 100644 --- a/sei-tendermint/abci/example/kvstore/kvstore_test.go +++ b/sei-tendermint/abci/example/kvstore/kvstore_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/require" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/code" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" @@ -241,7 +240,7 @@ func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { } } -func runClientTests(ctx context.Context, t *testing.T, client abciclient.Client) { +func runClientTests(ctx context.Context, t *testing.T, client types.Application) { // run some tests.... key := testKey value := key @@ -253,7 +252,7 @@ func runClientTests(ctx context.Context, t *testing.T, client abciclient.Client) testClient(ctx, t, client, tx, key, value) } -func testClient(ctx context.Context, t *testing.T, app abciclient.Client, tx []byte, key, value string) { +func testClient(ctx context.Context, t *testing.T, app types.Application, tx []byte, key, value string) { ar, err := app.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: [][]byte{tx}}) require.NoError(t, err) require.Equal(t, 1, len(ar.TxResults)) diff --git a/sei-tendermint/abci/tests/server/client.go b/sei-tendermint/abci/tests/server/client.go index cc4f238aa5..74bf1dcdc4 100644 --- a/sei-tendermint/abci/tests/server/client.go +++ b/sei-tendermint/abci/tests/server/client.go @@ -7,14 +7,13 @@ import ( "fmt" mrand "math/rand" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" tmrand "github.com/sei-protocol/sei-chain/sei-tendermint/libs/rand" ) -func InitChain(ctx context.Context, client abciclient.Client) error { +func InitChain(ctx context.Context, client types.Application) error { vals := make([]types.ValidatorUpdate, 10) for i := range vals { keyBytes := tmrand.Bytes(len(crypto.PubKey{}.Bytes())) @@ -40,7 +39,7 @@ func InitChain(ctx context.Context, client abciclient.Client) error { return nil } -func Commit(ctx context.Context, client abciclient.Client) error { +func Commit(ctx context.Context, client types.Application) error { _, err := client.Commit(ctx) if err != nil { fmt.Println("Failed test: Commit") @@ -51,7 +50,7 @@ func Commit(ctx context.Context, client abciclient.Client) error { return nil } -func FinalizeBlock(ctx context.Context, client abciclient.Client, txBytes [][]byte, codeExp []uint32, dataExp []byte, hashExp []byte) error { +func FinalizeBlock(ctx context.Context, client types.Application, txBytes [][]byte, codeExp []uint32, dataExp []byte, hashExp []byte) error { res, _ := client.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: txBytes}) appHash := res.AppHash for i, tx := range res.TxResults { diff --git a/sei-tendermint/internal/consensus/common_test.go b/sei-tendermint/internal/consensus/common_test.go index 2a0b4bcba9..df4f257782 100644 --- a/sei-tendermint/internal/consensus/common_test.go +++ b/sei-tendermint/internal/consensus/common_test.go @@ -17,7 +17,6 @@ import ( dbm "github.com/tendermint/tm-db" "go.opentelemetry.io/otel/sdk/trace" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" @@ -464,8 +463,8 @@ func newStateWithConfigAndBlockStore( blockStore *store.BlockStore, ) *State { // one for mempool, one for consensus - proxyAppConnMem := abciclient.NewLocalClient(logger, app) - proxyAppConnCon := abciclient.NewLocalClient(logger, app) + proxyAppConnMem := app + proxyAppConnCon := app // Make Mempool diff --git a/sei-tendermint/internal/consensus/reactor_test.go b/sei-tendermint/internal/consensus/reactor_test.go index d519161b5c..ff39c9e305 100644 --- a/sei-tendermint/internal/consensus/reactor_test.go +++ b/sei-tendermint/internal/consensus/reactor_test.go @@ -15,7 +15,6 @@ import ( dbm "github.com/tendermint/tm-db" "go.opentelemetry.io/otel/sdk/trace" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" @@ -273,8 +272,8 @@ func TestReactorWithEvidence(t *testing.T) { blockStore := store.NewBlockStore(blockDB) // one for mempool, one for consensus - proxyAppConnMem := abciclient.NewLocalClient(logger, app) - proxyAppConnCon := abciclient.NewLocalClient(logger, app) + proxyAppConnMem := app + proxyAppConnCon := app mempool := mempool.NewTxMempool( log.NewNopLogger().With("module", "mempool"), diff --git a/sei-tendermint/internal/mempool/mempool_bench_test.go b/sei-tendermint/internal/mempool/mempool_bench_test.go index 0527664c7c..1fe7da8f53 100644 --- a/sei-tendermint/internal/mempool/mempool_bench_test.go +++ b/sei-tendermint/internal/mempool/mempool_bench_test.go @@ -8,18 +8,13 @@ import ( "github.com/stretchr/testify/require" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" ) func BenchmarkTxMempool_CheckTx(b *testing.B) { ctx := b.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), kvstore.NewApplication()) - if err := client.Start(ctx); err != nil { - b.Fatal(err) - } + client := kvstore.NewApplication() // setup the cache and the mempool number for hitting GetEvictableTxs during the // benchmark. 5000 is the current default mempool size in the TM config. diff --git a/sei-tendermint/internal/mempool/mempool_test.go b/sei-tendermint/internal/mempool/mempool_test.go index 31289eb79a..438653bcd7 100644 --- a/sei-tendermint/internal/mempool/mempool_test.go +++ b/sei-tendermint/internal/mempool/mempool_test.go @@ -16,7 +16,6 @@ import ( "github.com/stretchr/testify/require" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/code" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" @@ -173,7 +172,7 @@ func (app *application) GetTxPriorityHint(context.Context, *abci.RequestGetTxPri }, nil } -func setup(t testing.TB, app abciclient.Client, cacheSize int, options ...TxMempoolOption) *TxMempool { +func setup(t testing.TB, app abci.Application, cacheSize int, options ...TxMempoolOption) *TxMempool { t.Helper() logger := log.NewNopLogger() @@ -243,11 +242,7 @@ func (e *TestPeerEvictor) Evict(id types.NodeID, _ error) { func TestTxMempool_TxsAvailable(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) txmp.EnableTxsAvailable() @@ -305,11 +300,7 @@ func TestTxMempool_TxsAvailable(t *testing.T) { func TestTxMempool_Size(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) txs := checkTxs(ctx, t, txmp, 100, 0) @@ -338,11 +329,7 @@ func TestTxMempool_Size(t *testing.T) { func TestTxMempool_Flush(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) txs := checkTxs(ctx, t, txmp, 100, 0) @@ -372,11 +359,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) { ctx := t.Context() gasEstimated := int64(1) // gas estimated set to 1 - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated} txmp := setup(t, client, 0) tTxs := checkTxs(ctx, t, txmp, 100, 0) // all txs request 1 gas unit @@ -467,11 +450,7 @@ func TestTxMempool_ReapMaxBytesMaxGas_FallbackToGasWanted(t *testing.T) { ctx := t.Context() gasEstimated := int64(0) // gas estimated not set so fallback to gas wanted - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated} txmp := setup(t, client, 0) tTxs := checkTxs(ctx, t, txmp, 100, 0) @@ -514,11 +493,7 @@ func TestTxMempool_ReapMaxBytesMaxGas_FallbackToGasWanted(t *testing.T) { func TestTxMempool_ReapMaxTxs(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) tTxs := checkTxs(ctx, t, txmp, 100, 0) @@ -590,11 +565,7 @@ func TestTxMempool_ReapMaxBytesMaxGas_MinGasEVMTxThreshold(t *testing.T) { // estimatedGas below MinGasEVMTx (21000), gasWanted above it gasEstimated := int64(10000) gasWanted := int64(50000) - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated, gasWanted: &gasWanted}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication(), gasEstimated: &gasEstimated, gasWanted: &gasWanted} txmp := setup(t, client, 0) peerID := uint16(1) @@ -616,11 +587,7 @@ func TestTxMempool_ReapMaxBytesMaxGas_MinGasEVMTxThreshold(t *testing.T) { func TestTxMempool_CheckTxExceedsMaxSize(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) rng := rand.New(rand.NewSource(time.Now().UnixNano())) @@ -641,11 +608,7 @@ func TestTxMempool_Reap_SkipGasUnfitAndCollectMinTxs(t *testing.T) { ctx := t.Context() app := &application{Application: kvstore.NewApplication()} - client := abciclient.NewLocalClient(log.NewNopLogger(), app) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := app txmp := setup(t, client, 0) peerID := uint16(1) @@ -682,11 +645,7 @@ func TestTxMempool_Reap_SkipGasUnfitStopsAtMinEvenWithCapacity(t *testing.T) { ctx := t.Context() app := &application{Application: kvstore.NewApplication()} - client := abciclient.NewLocalClient(log.NewNopLogger(), app) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := app txmp := setup(t, client, 0) peerID := uint16(1) @@ -717,11 +676,7 @@ func TestTxMempool_Reap_SkipGasUnfitStopsAtMinEvenWithCapacity(t *testing.T) { func TestTxMempool_Prioritization(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) peerID := uint16(1) @@ -785,11 +740,7 @@ func TestTxMempool_Prioritization(t *testing.T) { func TestTxMempool_PendingStoreSize(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) txmp.config.PendingSize = 1 @@ -806,11 +757,7 @@ func TestTxMempool_PendingStoreSize(t *testing.T) { func TestTxMempool_RemoveCacheWhenPendingTxIsFull(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 10) txmp.config.PendingSize = 1 @@ -827,11 +774,7 @@ func TestTxMempool_RemoveCacheWhenPendingTxIsFull(t *testing.T) { func TestTxMempool_EVMEviction(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) txmp.config.Size = 1 @@ -887,11 +830,7 @@ func TestTxMempool_EVMEviction(t *testing.T) { func TestTxMempool_CheckTxSamePeer(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) peerID := uint16(1) @@ -910,11 +849,7 @@ func TestTxMempool_CheckTxSamePeer(t *testing.T) { func TestTxMempool_CheckTxSameSender(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) peerID := uint16(1) @@ -940,11 +875,7 @@ func TestTxMempool_CheckTxSameSender(t *testing.T) { func TestTxMempool_ConcurrentTxs(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 100) rng := rand.New(rand.NewSource(time.Now().UnixNano())) @@ -1012,11 +943,7 @@ func TestTxMempool_ConcurrentTxs(t *testing.T) { func TestTxMempool_ExpiredTxs_NumBlocks(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 500) txmp.height = 100 @@ -1085,11 +1012,7 @@ func TestTxMempool_CheckTxPostCheckError(t *testing.T) { t.Run(tc.name, func(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} postCheckFn := func(_ types.Tx, _ *abci.ResponseCheckTx) error { return tc.err @@ -1122,11 +1045,7 @@ func TestTxMempool_CheckTxPostCheckError(t *testing.T) { func TestTxMempool_FailedCheckTxCount(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} postCheckFn := func(_ types.Tx, _ *abci.ResponseCheckTx) error { return nil @@ -1167,14 +1086,7 @@ func TestTxMempool_FailedCheckTxCount(t *testing.T) { } func TestAppendCheckTxErr(t *testing.T) { - // Setup - ctx := t.Context() - - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 500) existingLogData := "existing error log" newLogData := "sample error log" @@ -1194,11 +1106,7 @@ func TestAppendCheckTxErr(t *testing.T) { func TestMempoolExpiration(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) txmp.config.TTLDuration = time.Nanosecond // we want tx to expire immediately @@ -1219,11 +1127,7 @@ func TestMempoolExpiration(t *testing.T) { func TestReapMaxBytesMaxGas_EVMFirst(t *testing.T) { ctx := t.Context() - client := abciclient.NewLocalClient(log.NewNopLogger(), &application{Application: kvstore.NewApplication()}) - if err := client.Start(ctx); err != nil { - t.Fatal(err) - } - t.Cleanup(client.Wait) + client := &application{Application: kvstore.NewApplication()} txmp := setup(t, client, 0) peerID := uint16(1) diff --git a/sei-tendermint/internal/mempool/reactor_test.go b/sei-tendermint/internal/mempool/reactor_test.go index bff0377f26..01ba78ecea 100644 --- a/sei-tendermint/internal/mempool/reactor_test.go +++ b/sei-tendermint/internal/mempool/reactor_test.go @@ -13,7 +13,6 @@ import ( "github.com/fortytw2/leaktest" "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/config" @@ -54,11 +53,8 @@ func setupReactors(ctx context.Context, t *testing.T, logger log.Logger, numNode nodeID := node.NodeID rts.kvstores[nodeID] = kvstore.NewApplication() - client := abciclient.NewLocalClient(logger, rts.kvstores[nodeID]) - require.NoError(t, client.Start(ctx)) - t.Cleanup(client.Wait) - - mempool := setup(t, client, 0) + app := rts.kvstores[nodeID] + mempool := setup(t, app, 0) rts.mempools[nodeID] = mempool reactor, err := NewReactor( diff --git a/sei-tendermint/test/fuzz/tests/mempool_test.go b/sei-tendermint/test/fuzz/tests/mempool_test.go index 16d6060ff4..a4c4bc254f 100644 --- a/sei-tendermint/test/fuzz/tests/mempool_test.go +++ b/sei-tendermint/test/fuzz/tests/mempool_test.go @@ -3,10 +3,8 @@ package tests import ( - "context" "testing" - abciclient "github.com/sei-protocol/sei-chain/sei-tendermint/abci/client" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/example/kvstore" "github.com/sei-protocol/sei-chain/sei-tendermint/config" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool" @@ -29,16 +27,10 @@ func (e *TestPeerEvictor) Evict(id types.NodeID, _ error) { func FuzzMempool(f *testing.F) { app := kvstore.NewApplication() logger := log.NewNopLogger() - conn := abciclient.NewLocalClient(logger, app) - err := conn.Start(context.TODO()) - if err != nil { - panic(err) - } - cfg := config.DefaultMempoolConfig() cfg.Broadcast = false - mp := mempool.NewTxMempool(logger, cfg, conn, NewTestPeerEvictor()) + mp := mempool.NewTxMempool(logger, cfg, app, NewTestPeerEvictor()) f.Fuzz(func(t *testing.T, data []byte) { _ = mp.CheckTx(t.Context(), data, nil, mempool.TxInfo{}) From 0e6ae47fcc8577bcf1859a977a90d43465f390af Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Tue, 17 Feb 2026 22:04:45 +0100 Subject: [PATCH 10/16] removed unnecessary proxy wrappers --- .../internal/blocksync/reactor_test.go | 3 +- sei-tendermint/internal/consensus/replay.go | 5 +-- .../internal/consensus/replay_stubs.go | 9 ++--- .../internal/consensus/replay_test.go | 32 +++++---------- sei-tendermint/internal/proxy/client.go | 3 +- .../internal/state/execution_test.go | 40 ++++++------------- .../internal/state/validation_test.go | 13 +++--- sei-tendermint/node/node.go | 2 +- sei-tendermint/node/node_test.go | 16 +++----- sei-tendermint/node/seed.go | 5 +-- 10 files changed, 42 insertions(+), 86 deletions(-) diff --git a/sei-tendermint/internal/blocksync/reactor_test.go b/sei-tendermint/internal/blocksync/reactor_test.go index 25067b7cb8..59f91978a6 100644 --- a/sei-tendermint/internal/blocksync/reactor_test.go +++ b/sei-tendermint/internal/blocksync/reactor_test.go @@ -20,7 +20,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" mpmocks "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool/mocks" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" sf "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/test/factory" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/store" @@ -92,7 +91,7 @@ func makeReactor( logger := log.NewNopLogger() - app := proxy.New(abci.NewBaseApplication(), logger, proxy.NopMetrics()) + app := abci.NewBaseApplication() blockDB := dbm.NewMemDB() stateDB := dbm.NewMemDB() diff --git a/sei-tendermint/internal/consensus/replay.go b/sei-tendermint/internal/consensus/replay.go index b0e56d8872..c3cc621a81 100644 --- a/sei-tendermint/internal/consensus/replay.go +++ b/sei-tendermint/internal/consensus/replay.go @@ -364,10 +364,7 @@ func (h *Handshaker) ReplayBlocks( if err != nil { return nil, err } - mockApp, err := newMockProxyApp(h.logger, appHash, finalizeBlockResponses) - if err != nil { - return nil, err - } + mockApp := newMockProxyApp(appHash, finalizeBlockResponses) h.logger.Info("Replay last block using mock app") state, err = h.replayBlock(ctx, state, storeBlockHeight, mockApp) diff --git a/sei-tendermint/internal/consensus/replay_stubs.go b/sei-tendermint/internal/consensus/replay_stubs.go index 31569b3675..8b32992d1d 100644 --- a/sei-tendermint/internal/consensus/replay_stubs.go +++ b/sei-tendermint/internal/consensus/replay_stubs.go @@ -6,8 +6,6 @@ import ( abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/libs/clist" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" "github.com/sei-protocol/sei-chain/sei-tendermint/types" ) @@ -68,14 +66,13 @@ func (emptyMempool) CloseWAL() {} // the real app. func newMockProxyApp( - logger log.Logger, appHash []byte, finalizeBlockResponses *abci.ResponseFinalizeBlock, -) (abci.Application, error) { - return proxy.New(&mockProxyApp{ +) abci.Application { + return &mockProxyApp{ appHash: appHash, finalizeBlockResponses: finalizeBlockResponses, - }, logger, proxy.NopMetrics()), nil + } } type mockProxyApp struct { diff --git a/sei-tendermint/internal/consensus/replay_test.go b/sei-tendermint/internal/consensus/replay_test.go index c5fd251f7f..37708439b8 100644 --- a/sei-tendermint/internal/consensus/replay_test.go +++ b/sei-tendermint/internal/consensus/replay_test.go @@ -22,7 +22,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/crypto" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/pubsub" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" sf "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/test/factory" @@ -699,12 +698,11 @@ func testHandshakeReplay( if nBlocks > 0 { // run nBlocks against a new client to build up the app state. // use a throwaway tendermint state - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) stateDB1 := dbm.NewMemDB() stateStore := sm.NewStore(stateDB1) err := stateStore.Save(genesisState) require.NoError(t, err) - buildAppStateFromChain(ctx, t, proxyApp, stateStore, sim.Mempool, sim.Evpool, genesisState, chain, eventBus, nBlocks, mode, store) + buildAppStateFromChain(ctx, t, app, stateStore, sim.Mempool, sim.Evpool, genesisState, chain, eventBus, nBlocks, mode, store) } // Prune block store if requested @@ -720,9 +718,7 @@ func testHandshakeReplay( genDoc, err := sm.MakeGenesisDocFromFile(cfg.GenesisFile()) require.NoError(t, err) handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - - err = handshaker.Handshake(ctx, proxyApp) + err = handshaker.Handshake(ctx, app) if expectError { require.Error(t, err) return @@ -730,7 +726,7 @@ func testHandshakeReplay( require.NoError(t, err, "Error on abci handshake") // get the latest app hash from the app - res, err := proxyApp.Info(ctx, &abci.RequestInfo{Version: ""}) + res, err := app.Info(ctx, &abci.RequestInfo{Version: ""}) if err != nil { t.Fatal(err) } @@ -843,11 +839,9 @@ func buildTMStateFromChain( // run the whole chain against this client to build up the tendermint state app := kvstore.NewApplication() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.TM2PB.ValidatorUpdates(state.Validators) - _, err := proxyApp.InitChain(ctx, &abci.RequestInitChain{ + _, err := app.InitChain(ctx, &abci.RequestInitChain{ Validators: validators, }) require.NoError(t, err) @@ -861,19 +855,19 @@ func buildTMStateFromChain( case 0: // sync right up for _, block := range chain { - state = applyBlock(ctx, t, stateStore, mempool, evpool, state, block, proxyApp, blockStore, eventBus) + state = applyBlock(ctx, t, stateStore, mempool, evpool, state, block, app, blockStore, eventBus) } case 1, 2, 3: // sync up to the penultimate as if we stored the block. // whether we commit or not depends on the appHash for _, block := range chain[:len(chain)-1] { - state = applyBlock(ctx, t, stateStore, mempool, evpool, state, block, proxyApp, blockStore, eventBus) + state = applyBlock(ctx, t, stateStore, mempool, evpool, state, block, app, blockStore, eventBus) } // apply the final block to a state copy so we can // get the right next appHash but keep the state back - applyBlock(ctx, t, stateStore, mempool, evpool, state, chain[len(chain)-1], proxyApp, blockStore, eventBus) + applyBlock(ctx, t, stateStore, mempool, evpool, state, chain[len(chain)-1], app, blockStore, eventBus) default: require.Fail(t, "unknown mode %v", mode) } @@ -918,10 +912,8 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { // - 0x03 { app := &badApp{numBlocks: 3, allHashesAreWrong: true} - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - h := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - assert.Error(t, h.Handshake(ctx, proxyApp)) + assert.Error(t, h.Handshake(ctx, app)) } // 3. Tendermint must panic if app returns wrong hash for the last block @@ -930,10 +922,8 @@ func TestHandshakeErrorsIfAppReturnsWrongAppHash(t *testing.T) { // - RANDOM HASH { app := &badApp{numBlocks: 3, onlyLastHashIsWrong: true} - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - h := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - require.Error(t, h.Handshake(ctx, proxyApp)) + require.Error(t, h.Handshake(ctx, app)) } } @@ -1156,9 +1146,7 @@ func TestHandshakeUpdatesValidators(t *testing.T) { require.NoError(t, err) handshaker := NewHandshaker(logger, stateStore, state, store, eventBus, genDoc) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - - require.NoError(t, handshaker.Handshake(ctx, proxyApp), "error on abci handshake") + require.NoError(t, handshaker.Handshake(ctx, app), "error on abci handshake") // reload the state, check the validator set was updated state, err = stateStore.Load() diff --git a/sei-tendermint/internal/proxy/client.go b/sei-tendermint/internal/proxy/client.go index 0f34eb57dd..76588422ba 100644 --- a/sei-tendermint/internal/proxy/client.go +++ b/sei-tendermint/internal/proxy/client.go @@ -7,7 +7,6 @@ import ( "github.com/go-kit/kit/metrics" "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" - "github.com/sei-protocol/sei-chain/sei-tendermint/libs/log" ) // proxyClient provides the application connection. @@ -17,7 +16,7 @@ type proxyClient struct { } // New creates a proxy application interface around the provided ABCI application. -func New(app types.Application, _ log.Logger, metrics *Metrics) types.Application { +func New(app types.Application, metrics *Metrics) types.Application { return &proxyClient{ metrics: metrics, app: app, diff --git a/sei-tendermint/internal/state/execution_test.go b/sei-tendermint/internal/state/execution_test.go index d38d949bef..4cb3822033 100644 --- a/sei-tendermint/internal/state/execution_test.go +++ b/sei-tendermint/internal/state/execution_test.go @@ -17,7 +17,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" mpmocks "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool/mocks" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/pubsub" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/mocks" @@ -38,7 +37,6 @@ var ( func TestApplyBlock(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) ctx := t.Context() @@ -60,7 +58,7 @@ func TestApplyBlock(t *testing.T) { mock.Anything, mock.Anything).Return(nil) mp.On("TxStore").Return(nil) - blockExec := sm.NewBlockExecutor(stateStore, logger, proxyApp, mp, sm.EmptyEvidencePool{}, blockStore, eventBus, sm.NopMetrics()) + blockExec := sm.NewBlockExecutor(stateStore, logger, app, mp, sm.EmptyEvidencePool{}, blockStore, eventBus, sm.NopMetrics()) block := sf.MakeBlock(state, 1, new(types.Commit)) bps, err := block.MakePartSet(testPartSize) @@ -83,7 +81,6 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) { logger := log.NewNopLogger() app := &testApp{} - appClient := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, privVals := makeState(t, 7, 1) stateStore := sm.NewStore(stateDB) @@ -121,7 +118,7 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) { eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) - blockExec := sm.NewBlockExecutor(stateStore, log.NewNopLogger(), appClient, mp, evpool, blockStore, eventBus, sm.NopMetrics()) + blockExec := sm.NewBlockExecutor(stateStore, log.NewNopLogger(), app, mp, evpool, blockStore, eventBus, sm.NopMetrics()) state, _, lastCommit := makeAndCommitGoodBlock(ctx, t, state, 1, new(types.Commit), state.NextValidators.Validators[0].Address, blockExec, privVals, nil) for idx, isAbsent := range tc.absentCommitSigs { @@ -153,7 +150,6 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, privVals := makeState(t, 1, 1) stateStore := sm.NewStore(stateDB) @@ -246,7 +242,7 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) { blockStore := store.NewBlockStore(dbm.NewMemDB()) - blockExec := sm.NewBlockExecutor(stateStore, log.NewNopLogger(), proxyApp, mp, evpool, blockStore, eventBus, sm.NopMetrics()) + blockExec := sm.NewBlockExecutor(stateStore, log.NewNopLogger(), app, mp, evpool, blockStore, eventBus, sm.NopMetrics()) block := sf.MakeBlock(state, 1, new(types.Commit)) block.Evidence = ev @@ -270,7 +266,6 @@ func TestProcessProposal(t *testing.T) { app := abcimocks.NewApplication(t) logger := log.NewNopLogger() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, privVals := makeState(t, 1, height) stateStore := sm.NewStore(stateDB) @@ -284,7 +279,7 @@ func TestProcessProposal(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -483,7 +478,6 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, _ := makeState(t, 1, 1) stateStore := sm.NewStore(stateDB) @@ -508,7 +502,7 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -563,7 +557,6 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { app := &testApp{} logger := log.NewNopLogger() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -576,7 +569,7 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, log.NewNopLogger(), - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -612,7 +605,6 @@ func TestEmptyPrepareProposal(t *testing.T) { app := abcimocks.NewApplication(t) app.On("PrepareProposal", mock.Anything, mock.Anything).Return(&abci.ResponsePrepareProposal{}, nil) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, privVals := makeState(t, 1, height) stateStore := sm.NewStore(stateDB) @@ -633,7 +625,7 @@ func TestEmptyPrepareProposal(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, nil, @@ -680,12 +672,10 @@ func TestPrepareProposalErrorOnNonExistingRemoved(t *testing.T) { } app.On("PrepareProposal", mock.Anything, mock.Anything).Return(rpp, nil) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, evpool, nil, @@ -731,12 +721,10 @@ func TestPrepareProposalReorderTxs(t *testing.T) { TxRecords: trs, }, nil) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, evpool, nil, @@ -788,12 +776,10 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) { TxRecords: trs, }, nil) - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) - blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, evpool, nil, @@ -831,12 +817,11 @@ func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) { mp.On("ReapMaxBytesMaxGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(types.Txs(txs)) app := &failingPrepareProposalApp{} - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, evpool, nil, @@ -912,7 +897,6 @@ func TestCreateProposalBlockPanicRecovery(t *testing.T) { // Create the panicking app app := &panicApp{} - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) // Create test state and executor state, stateDB, _ := makeState(t, 1, 1) @@ -929,7 +913,7 @@ func TestCreateProposalBlockPanicRecovery(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, diff --git a/sei-tendermint/internal/state/validation_test.go b/sei-tendermint/internal/state/validation_test.go index e57de4f14c..e4f54af9ba 100644 --- a/sei-tendermint/internal/state/validation_test.go +++ b/sei-tendermint/internal/state/validation_test.go @@ -15,7 +15,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" mpmocks "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool/mocks" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/mocks" statefactory "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/test/factory" @@ -33,7 +32,7 @@ const validationTestsStopHeight int64 = 10 func TestValidateBlockHeader(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) + app := &testApp{} eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -57,7 +56,7 @@ func TestValidateBlockHeader(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -138,7 +137,7 @@ func TestValidateBlockCommit(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) + app := &testApp{} eventBus := eventbus.NewDefault(logger) require.NoError(t, eventBus.Start(ctx)) @@ -162,7 +161,7 @@ func TestValidateBlockCommit(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -279,7 +278,7 @@ func TestValidateBlockEvidence(t *testing.T) { ctx := t.Context() logger := log.NewNopLogger() - proxyApp := proxy.New(&testApp{}, logger, proxy.NopMetrics()) + app := &testApp{} state, stateDB, privVals := makeState(t, 4, 1) stateStore := sm.NewStore(stateDB) @@ -311,7 +310,7 @@ func TestValidateBlockEvidence(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, log.NewNopLogger(), - proxyApp, + app, mp, evpool, blockStore, diff --git a/sei-tendermint/node/node.go b/sei-tendermint/node/node.go index 99a5cf6ab7..e293304c31 100644 --- a/sei-tendermint/node/node.go +++ b/sei-tendermint/node/node.go @@ -118,7 +118,7 @@ func makeNode( return nil, combineCloseError(err, makeCloser(closers)) } - proxyApp := proxy.New(app, logger.With("module", "proxy"), nodeMetrics.proxy) + proxyApp := proxy.New(app, nodeMetrics.proxy) eventBus := eventbus.NewDefault(logger.With("module", "events")) var eventLog *eventlog.Log diff --git a/sei-tendermint/node/node_test.go b/sei-tendermint/node/node_test.go index cdcec8333e..8d3349432a 100644 --- a/sei-tendermint/node/node_test.go +++ b/sei-tendermint/node/node_test.go @@ -22,7 +22,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/evidence" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/mempool" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/pubsub" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/indexer" @@ -282,7 +281,6 @@ func TestCreateProposalBlock(t *testing.T) { logger := log.NewNopLogger() app := kvstore.NewApplication() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) const height int64 = 1 state, stateDB, privVals := state(t, 1, height) @@ -297,7 +295,7 @@ func TestCreateProposalBlock(t *testing.T) { mp := mempool.NewTxMempool( logger.With("module", "mempool"), cfg.Mempool, - proxyApp, + app, nil, ) @@ -335,7 +333,7 @@ func TestCreateProposalBlock(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, evidencePool, blockStore, @@ -381,7 +379,6 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { logger := log.NewNopLogger() app := kvstore.NewApplication() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) const height int64 = 1 state, stateDB, _ := state(t, 1, height) @@ -397,7 +394,7 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { mp := mempool.NewTxMempool( logger.With("module", "mempool"), cfg.Mempool, - proxyApp, + app, nil, ) @@ -413,7 +410,7 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, @@ -451,7 +448,6 @@ func TestMaxProposalBlockSize(t *testing.T) { logger := log.NewNopLogger() app := kvstore.NewApplication() - proxyApp := proxy.New(app, logger, proxy.NopMetrics()) state, stateDB, privVals := state(t, types.MaxVotesCount, int64(1)) @@ -465,7 +461,7 @@ func TestMaxProposalBlockSize(t *testing.T) { mp := mempool.NewTxMempool( logger.With("module", "mempool"), cfg.Mempool, - proxyApp, + app, nil, ) @@ -487,7 +483,7 @@ func TestMaxProposalBlockSize(t *testing.T) { blockExec := sm.NewBlockExecutor( stateStore, logger, - proxyApp, + app, mp, sm.EmptyEvidencePool{}, blockStore, diff --git a/sei-tendermint/node/seed.go b/sei-tendermint/node/seed.go index c653de0ee5..3dec75f26c 100644 --- a/sei-tendermint/node/seed.go +++ b/sei-tendermint/node/seed.go @@ -13,7 +13,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p/pex" - "github.com/sei-protocol/sei-chain/sei-tendermint/internal/proxy" rpccore "github.com/sei-protocol/sei-chain/sei-tendermint/internal/rpc/core" sm "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state" "github.com/sei-protocol/sei-chain/sei-tendermint/internal/state/indexer/sink" @@ -84,8 +83,6 @@ func makeSeedNode( return nil, fmt.Errorf("pex.NewReactor(): %w", err) } - proxyApp := proxy.New(abci.NewBaseApplication(), logger.With("module", "proxy"), nodeMetrics.proxy) - closers := make([]closer, 0, 2) blockStore, stateDB, dbCloser, err := initDBs(cfg, dbProvider) if err != nil { @@ -113,7 +110,7 @@ func makeSeedNode( pexReactor: pexReactor, rpcEnv: &rpccore.Environment{ - ProxyApp: proxyApp, + ProxyApp: abci.NewBaseApplication(), StateStore: stateStore, BlockStore: blockStore, From 5b105ba1b3aeb49c3c95a7e4524fbfcef24bb288 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Wed, 18 Feb 2026 16:20:51 +0100 Subject: [PATCH 11/16] rename --- sei-tendermint/internal/state/execution.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sei-tendermint/internal/state/execution.go b/sei-tendermint/internal/state/execution.go index 52c3d41565..04d59f431b 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 From a1585fcc0e4ac72c2f003022fe5cdbde4e74648a Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Wed, 18 Feb 2026 16:27:03 +0100 Subject: [PATCH 12/16] removed unused voteInfo field --- app/abci.go | 2 +- sei-cosmos/baseapp/abci.go | 7 ++---- sei-cosmos/baseapp/baseapp.go | 25 ++-------------------- sei-cosmos/baseapp/test_helpers.go | 4 ++-- sei-tendermint/internal/state/execution.go | 2 +- 5 files changed, 8 insertions(+), 32 deletions(-) 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/sei-cosmos/baseapp/abci.go b/sei-cosmos/baseapp/abci.go index 96c90367df..5705100cb6 100644 --- a/sei-cosmos/baseapp/abci.go +++ b/sei-cosmos/baseapp/abci.go @@ -207,7 +207,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 +755,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 { @@ -1107,9 +1107,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..22e01bf88d 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 { @@ -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/test_helpers.go b/sei-cosmos/baseapp/test_helpers.go index 85d6a9ddb7..5df960d384 100644 --- a/sei-cosmos/baseapp/test_helpers.go +++ b/sei-cosmos/baseapp/test_helpers.go @@ -16,7 +16,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 +27,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 diff --git a/sei-tendermint/internal/state/execution.go b/sei-tendermint/internal/state/execution.go index 04d59f431b..6d96dce3a3 100644 --- a/sei-tendermint/internal/state/execution.go +++ b/sei-tendermint/internal/state/execution.go @@ -64,7 +64,7 @@ func NewBlockExecutor( return &BlockExecutor{ eventBus: eventBus, store: stateStore, - app: app, + app: app, mempool: pool, evpool: evpool, logger: logger, From 339aaf19ef7e6831fde3a5fc1cef046d5f2883cf Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 19 Feb 2026 12:12:58 +0100 Subject: [PATCH 13/16] removed voteInfos from context --- sei-cosmos/types/context.go | 11 ----------- sei-cosmos/types/context_test.go | 7 +------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sei-cosmos/types/context.go b/sei-cosmos/types/context.go index 907d16eb50..ab10899bd7 100644 --- a/sei-cosmos/types/context.go +++ b/sei-cosmos/types/context.go @@ -34,7 +34,6 @@ type Context struct { 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 } @@ -345,12 +340,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..169cef80aa 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 } @@ -91,7 +90,6 @@ func (s *contextTestSuite) TestContextWithCustom() { 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()) @@ -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()) From c388f435d401a8a5f7dbc38f2b5cd4246cb69917 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 19 Feb 2026 13:04:55 +0100 Subject: [PATCH 14/16] detached tendermint header from cosmos header --- .../authz_nested_message_test.go | 2 +- app/antedecorators/gasless_test.go | 2 +- app/antedecorators/priority_test.go | 10 +- app/antedecorators/traced_test.go | 2 +- app/app.go | 2 +- app/apptesting/test_suite.go | 7 +- app/export.go | 6 +- app/optimistic_processing_test.go | 2 +- app/test_helpers.go | 8 +- app/upgrade_test.go | 4 +- giga/deps/testutil/keeper/epoch.go | 2 +- giga/deps/xbank/keeper/keeper_test.go | 8 +- giga/tests/giga_test.go | 2 +- giga/tests/state_harness_test.go | 2 +- occ_tests/utils/utils.go | 2 +- sei-cosmos/baseapp/abci.go | 23 ++- sei-cosmos/baseapp/baseapp.go | 18 +-- sei-cosmos/baseapp/baseapp_test.go | 2 +- sei-cosmos/baseapp/deliver_tx_batch_test.go | 5 +- sei-cosmos/baseapp/deliver_tx_test.go | 42 +++--- sei-cosmos/baseapp/grpcrouter_test.go | 3 +- sei-cosmos/baseapp/test_helpers.go | 5 +- sei-cosmos/store/rootmulti/rollback_test.go | 11 +- sei-cosmos/testutil/context.go | 3 +- sei-cosmos/types/context.go | 21 ++- sei-cosmos/types/context_test.go | 20 +-- sei-cosmos/types/header.go | 135 ++++++++++++++++++ sei-cosmos/types/module/module_test.go | 4 +- sei-cosmos/types/query/pagination_test.go | 3 +- sei-cosmos/types/result_test.go | 3 +- sei-cosmos/x/auth/ante/testutil_test.go | 3 +- sei-cosmos/x/auth/keeper/integration_test.go | 3 +- .../x/auth/legacy/legacytx/stdtx_test.go | 3 +- sei-cosmos/x/auth/module_test.go | 4 +- sei-cosmos/x/auth/signing/verify_test.go | 3 +- sei-cosmos/x/auth/vesting/handler_test.go | 3 +- sei-cosmos/x/authz/keeper/genesis_test.go | 3 +- sei-cosmos/x/authz/keeper/keeper_test.go | 5 +- sei-cosmos/x/bank/app_test.go | 43 +++--- sei-cosmos/x/bank/handler_test.go | 5 +- sei-cosmos/x/bank/keeper/keeper_test.go | 21 ++- .../x/bank/types/send_authorization_test.go | 3 +- sei-cosmos/x/capability/capability_test.go | 9 +- sei-cosmos/x/capability/genesis_test.go | 4 +- sei-cosmos/x/capability/keeper/keeper_test.go | 3 +- sei-cosmos/x/capability/spec/README.md | 2 +- sei-cosmos/x/crisis/handler_test.go | 3 +- sei-cosmos/x/crisis/keeper/keeper_test.go | 5 +- .../x/distribution/keeper/allocation_test.go | 7 +- .../x/distribution/keeper/delegation_test.go | 17 ++- .../x/distribution/keeper/grpc_query_test.go | 3 +- .../x/distribution/keeper/keeper_test.go | 9 +- .../x/distribution/keeper/querier_test.go | 3 +- sei-cosmos/x/distribution/module_test.go | 4 +- .../x/distribution/proposal_handler_test.go | 5 +- sei-cosmos/x/evidence/genesis_test.go | 3 +- sei-cosmos/x/evidence/handler_test.go | 3 +- sei-cosmos/x/evidence/keeper/keeper_test.go | 3 +- sei-cosmos/x/feegrant/basic_fee_test.go | 7 +- sei-cosmos/x/feegrant/filtered_fee_test.go | 7 +- sei-cosmos/x/feegrant/grant_test.go | 3 +- sei-cosmos/x/feegrant/keeper/genesis_test.go | 3 +- sei-cosmos/x/feegrant/keeper/keeper_test.go | 3 +- sei-cosmos/x/feegrant/periodic_fee_test.go | 5 +- sei-cosmos/x/genutil/gentx_test.go | 3 +- sei-cosmos/x/gov/abci_test.go | 19 ++- sei-cosmos/x/gov/genesis_test.go | 11 +- sei-cosmos/x/gov/handler_test.go | 3 +- sei-cosmos/x/gov/keeper/deposit_test.go | 3 +- sei-cosmos/x/gov/keeper/hooks_test.go | 3 +- sei-cosmos/x/gov/keeper/keeper_test.go | 7 +- sei-cosmos/x/gov/keeper/querier_test.go | 5 +- sei-cosmos/x/gov/keeper/tally_test.go | 33 +++-- sei-cosmos/x/gov/keeper/vote_test.go | 3 +- sei-cosmos/x/gov/module_test.go | 4 +- sei-cosmos/x/params/keeper/genesis_test.go | 3 +- sei-cosmos/x/params/keeper/keeper_test.go | 3 +- sei-cosmos/x/params/proposal_handler_test.go | 3 +- sei-cosmos/x/params/types/subspace_test.go | 3 +- sei-cosmos/x/simulation/mock_tendermint.go | 10 +- sei-cosmos/x/simulation/simulate.go | 7 +- sei-cosmos/x/slashing/abci_test.go | 15 +- sei-cosmos/x/slashing/app_test.go | 11 +- sei-cosmos/x/slashing/genesis_test.go | 3 +- sei-cosmos/x/slashing/handler_test.go | 13 +- .../x/slashing/keeper/grpc_query_test.go | 3 +- sei-cosmos/x/slashing/keeper/hooks_test.go | 3 +- .../x/slashing/keeper/infractions_test.go | 4 +- sei-cosmos/x/slashing/keeper/keeper_test.go | 11 +- .../x/slashing/keeper/migrations_test.go | 7 +- sei-cosmos/x/slashing/keeper/querier_test.go | 6 +- .../x/slashing/keeper/signing_info_test.go | 7 +- sei-cosmos/x/staking/app_test.go | 17 ++- sei-cosmos/x/staking/common_test.go | 3 +- sei-cosmos/x/staking/genesis_test.go | 3 +- sei-cosmos/x/staking/handler_test.go | 2 +- sei-cosmos/x/staking/keeper/common_test.go | 3 +- .../x/staking/keeper/historical_info_test.go | 21 ++- sei-cosmos/x/staking/keeper/keeper_test.go | 7 +- sei-cosmos/x/staking/keeper/querier_test.go | 5 +- sei-cosmos/x/staking/keeper/slash_test.go | 9 +- sei-cosmos/x/staking/keeper/validator_test.go | 3 +- sei-cosmos/x/staking/module_test.go | 4 +- sei-cosmos/x/staking/types/authz_test.go | 3 +- sei-cosmos/x/staking/types/historical_info.go | 5 +- .../x/staking/types/historical_info_test.go | 7 +- sei-cosmos/x/upgrade/abci_test.go | 17 ++- sei-cosmos/x/upgrade/client/testutil/suite.go | 3 +- .../x/upgrade/keeper/grpc_query_test.go | 3 +- sei-cosmos/x/upgrade/keeper/keeper_test.go | 3 +- sei-cosmos/x/upgrade/types/plan_test.go | 3 +- .../27-interchain-accounts/module_test.go | 4 +- .../modules/core/02-client/abci_test.go | 2 +- .../core/02-client/keeper/keeper_test.go | 2 +- .../core/05-port/keeper/keeper_test.go | 2 +- sei-ibc-go/modules/core/genesis_test.go | 2 +- .../07-tendermint/types/tendermint_test.go | 2 +- .../09-localhost/types/localhost_test.go | 2 +- sei-ibc-go/testing/chain.go | 6 +- sei-ibc-go/testing/simapp/export.go | 2 +- sei-ibc-go/testing/simapp/test_helpers.go | 4 +- sei-wasmd/app/app.go | 2 +- sei-wasmd/app/export.go | 4 +- sei-wasmd/app/test_helpers.go | 6 +- sei-wasmd/x/wasm/ibctesting/chain.go | 6 +- sei-wasmd/x/wasm/keeper/ante_test.go | 2 +- sei-wasmd/x/wasm/keeper/genesis_test.go | 2 +- sei-wasmd/x/wasm/keeper/keeper_test.go | 8 +- sei-wasmd/x/wasm/keeper/snapshotter.go | 5 +- .../keeper/snapshotter_integration_test.go | 4 +- sei-wasmd/x/wasm/keeper/test_common.go | 3 +- testutil/keeper/epoch.go | 2 +- x/epoch/handler_test.go | 2 +- x/epoch/keeper/epoch_test.go | 2 +- x/epoch/module_test.go | 4 +- x/epoch/types/hooks_test.go | 4 +- x/mint/keeper/genesis_test.go | 2 +- x/mint/keeper/grpc_query_test.go | 2 +- x/mint/keeper/hooks_test.go | 24 ++-- x/mint/keeper/integration_test.go | 2 +- x/mint/keeper/migrations_test.go | 2 +- x/mint/module_test.go | 2 +- x/mint/types/minter_test.go | 2 +- x/oracle/ante_test.go | 2 +- x/oracle/keeper/testutils/test_utils.go | 2 +- x/oracle/types/ballot_test.go | 2 +- x/tokenfactory/keeper/genesis_test.go | 2 +- x/tokenfactory/keeper/keeper_test.go | 2 +- x/tokenfactory/keeper/migrations_test.go | 4 +- 149 files changed, 537 insertions(+), 493 deletions(-) create mode 100644 sei-cosmos/types/header.go diff --git a/app/antedecorators/authz_nested_message_test.go b/app/antedecorators/authz_nested_message_test.go index fa2e77ec61..c7fd93998f 100644 --- a/app/antedecorators/authz_nested_message_test.go +++ b/app/antedecorators/authz_nested_message_test.go @@ -20,7 +20,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/gasless_test.go b/app/antedecorators/gasless_test.go index 914c51bfa2..4e2f7186ad 100644 --- a/app/antedecorators/gasless_test.go +++ b/app/antedecorators/gasless_test.go @@ -137,7 +137,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..b22046629f 100644 --- a/app/antedecorators/priority_test.go +++ b/app/antedecorators/priority_test.go @@ -24,7 +24,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 +41,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 +62,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 +90,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 +157,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..06318cb932 100644 --- a/app/antedecorators/traced_test.go +++ b/app/antedecorators/traced_test.go @@ -21,6 +21,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/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/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..65d25b7207 100644 --- a/app/optimistic_processing_test.go +++ b/app/optimistic_processing_test.go @@ -20,7 +20,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..a0ea15252c 100644 --- a/app/upgrade_test.go +++ b/app/upgrade_test.go @@ -39,7 +39,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 +60,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..e9a2fc066d 100644 --- a/giga/deps/testutil/keeper/epoch.go +++ b/giga/deps/testutil/keeper/epoch.go @@ -48,7 +48,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..612d1496d2 100644 --- a/giga/deps/xbank/keeper/keeper_test.go +++ b/giga/deps/xbank/keeper/keeper_test.go @@ -95,7 +95,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 +403,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 +434,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 +462,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..ec5dedfff3 100644 --- a/giga/tests/giga_test.go +++ b/giga/tests/giga_test.go @@ -91,7 +91,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..74f3293488 100644 --- a/giga/tests/state_harness_test.go +++ b/giga/tests/state_harness_test.go @@ -104,7 +104,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..db7f8aea0b 100644 --- a/occ_tests/utils/utils.go +++ b/occ_tests/utils/utils.go @@ -165,7 +165,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/sei-cosmos/baseapp/abci.go b/sei-cosmos/baseapp/abci.go index 5705100cb6..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 @@ -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, }, diff --git a/sei-cosmos/baseapp/baseapp.go b/sei-cosmos/baseapp/baseapp.go index 22e01bf88d..2aaa06226d 100644 --- a/sei-cosmos/baseapp/baseapp.go +++ b/sei-cosmos/baseapp/baseapp.go @@ -454,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 } @@ -474,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 @@ -540,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() @@ -561,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 { @@ -576,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 { @@ -591,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 { @@ -613,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)) } 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 5df960d384..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) { @@ -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/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 ab10899bd7..ae4f5bf1a7 100644 --- a/sei-cosmos/types/context.go +++ b/sei-cosmos/types/context.go @@ -28,7 +28,7 @@ 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 @@ -203,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 { @@ -249,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, @@ -278,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 } diff --git a/sei-cosmos/types/context_test.go b/sei-cosmos/types/context_test.go index 169cef80aa..1f43f7d5f4 100644 --- a/sei-cosmos/types/context_test.go +++ b/sei-cosmos/types/context_test.go @@ -83,7 +83,7 @@ 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 @@ -143,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") @@ -160,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", @@ -214,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..9efbfecd8f 100644 --- a/sei-cosmos/x/crisis/handler_test.go +++ b/sei-cosmos/x/crisis/handler_test.go @@ -3,7 +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" @@ -20,7 +19,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..cbfb3bc5c0 100644 --- a/sei-cosmos/x/distribution/module_test.go +++ b/sei-cosmos/x/distribution/module_test.go @@ -1,11 +1,11 @@ package distribution_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "context" "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..76adadd765 100644 --- a/sei-cosmos/x/gov/handler_test.go +++ b/sei-cosmos/x/gov/handler_test.go @@ -4,7 +4,6 @@ import ( "strings" "testing" - tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -19,7 +18,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..049aec83be 100644 --- a/sei-cosmos/x/params/proposal_handler_test.go +++ b/sei-cosmos/x/params/proposal_handler_test.go @@ -5,7 +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" @@ -25,7 +24,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..b894a3891c 100644 --- a/sei-cosmos/x/staking/common_test.go +++ b/sei-cosmos/x/staking/common_test.go @@ -4,7 +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" @@ -38,7 +37,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..3de534eee8 100644 --- a/sei-cosmos/x/staking/keeper/common_test.go +++ b/sei-cosmos/x/staking/keeper/common_test.go @@ -4,7 +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" @@ -25,7 +24,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..4a91231a80 100644 --- a/sei-cosmos/x/staking/keeper/keeper_test.go +++ b/sei-cosmos/x/staking/keeper/keeper_test.go @@ -6,7 +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" @@ -27,7 +26,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 +35,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 +51,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..3de8ecc929 100644 --- a/sei-cosmos/x/staking/module_test.go +++ b/sei-cosmos/x/staking/module_test.go @@ -1,11 +1,11 @@ package staking_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "context" "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..08e2010dbe 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 @@ -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..b3f3430747 100644 --- a/sei-ibc-go/modules/core/02-client/abci_test.go +++ b/sei-ibc-go/modules/core/02-client/abci_test.go @@ -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..824e6b7772 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 @@ -83,7 +83,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..2028f3751c 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 @@ -28,7 +28,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..b315ef5eb5 100644 --- a/sei-ibc-go/modules/core/genesis_test.go +++ b/sei-ibc-go/modules/core/genesis_test.go @@ -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..1c8cef9977 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 @@ -87,7 +87,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..191699cff4 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 @@ -32,7 +32,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..3481ceef9c 100644 --- a/sei-ibc-go/testing/simapp/export.go +++ b/sei-ibc-go/testing/simapp/export.go @@ -18,7 +18,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-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..077310660e 100644 --- a/sei-wasmd/x/wasm/keeper/genesis_test.go +++ b/sei-wasmd/x/wasm/keeper/genesis_test.go @@ -653,7 +653,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..70b3b3dcf1 100644 --- a/sei-wasmd/x/wasm/keeper/keeper_test.go +++ b/sei-wasmd/x/wasm/keeper/keeper_test.go @@ -289,7 +289,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 +321,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..1aa30858cf 100644 --- a/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go +++ b/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go @@ -44,7 +44,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 +85,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..e9a2fc066d 100644 --- a/testutil/keeper/epoch.go +++ b/testutil/keeper/epoch.go @@ -48,7 +48,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..44b7e4878b 100644 --- a/x/epoch/handler_test.go +++ b/x/epoch/handler_test.go @@ -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..2869a97f24 100644 --- a/x/epoch/keeper/epoch_test.go +++ b/x/epoch/keeper/epoch_test.go @@ -12,7 +12,7 @@ import ( 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..74833f094c 100644 --- a/x/epoch/module_test.go +++ b/x/epoch/module_test.go @@ -61,7 +61,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 +79,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..a0d703edaa 100644 --- a/x/epoch/types/hooks_test.go +++ b/x/epoch/types/hooks_test.go @@ -59,7 +59,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 +83,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/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index 66ba4530a4..e96a7566aa 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -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..12a6ade3bd 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -26,7 +26,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..fa89423578 100644 --- a/x/mint/keeper/hooks_test.go +++ b/x/mint/keeper/hooks_test.go @@ -34,9 +34,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 +46,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 +91,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 +137,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 +195,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 +269,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..41d3c2d024 100644 --- a/x/mint/keeper/integration_test.go +++ b/x/mint/keeper/integration_test.go @@ -14,7 +14,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..55ba5df4c9 100644 --- a/x/mint/keeper/migrations_test.go +++ b/x/mint/keeper/migrations_test.go @@ -57,7 +57,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..b6aa9a80ad 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -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..a8b4fa30a7 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -422,7 +422,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..524cc2a7e5 100644 --- a/x/oracle/ante_test.go +++ b/x/oracle/ante_test.go @@ -35,7 +35,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..dc9bb0ce3e 100644 --- a/x/oracle/keeper/testutils/test_utils.go +++ b/x/oracle/keeper/testutils/test_utils.go @@ -148,7 +148,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..e8938e4079 100755 --- a/x/oracle/types/ballot_test.go +++ b/x/oracle/types/ballot_test.go @@ -106,7 +106,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..24eb2bd6d3 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -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..3162fdc85c 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -50,7 +50,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..cae3fc01c4 100644 --- a/x/tokenfactory/keeper/migrations_test.go +++ b/x/tokenfactory/keeper/migrations_test.go @@ -48,7 +48,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 +98,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) }) From 87e5c600315fcbcf66777f80c3018c06325e9cc1 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 19 Feb 2026 14:30:32 +0100 Subject: [PATCH 15/16] tests fixed --- .../authz_nested_message_test.go | 1 - app/antedecorators/gas_test.go | 3 +- app/antedecorators/gasless_test.go | 1 - app/antedecorators/priority_test.go | 1 - app/antedecorators/traced_test.go | 1 - app/app_test.go | 4 +- app/benchmark_test.go | 3 +- app/optimistic_processing_test.go | 1 - app/upgrade_test.go | 1 - giga/deps/testutil/keeper/epoch.go | 1 - giga/deps/xbank/keeper/keeper_test.go | 1 - giga/tests/giga_test.go | 1 - giga/tests/state_harness_test.go | 1 - occ_tests/utils/utils.go | 1 - precompiles/addr/addr_test.go | 8 ++-- precompiles/bank/bank_test.go | 5 +- precompiles/distribution/distribution_test.go | 19 ++++---- precompiles/gov/gov_test.go | 5 +- precompiles/ibc/ibc_test.go | 5 +- precompiles/oracle/oracle_test.go | 5 +- precompiles/staking/staking_events_test.go | 3 +- precompiles/staking/staking_test.go | 46 +++++++++---------- .../27-interchain-accounts/module_test.go | 2 +- .../modules/core/02-client/abci_test.go | 2 +- .../core/02-client/keeper/keeper_test.go | 1 - .../core/05-port/keeper/keeper_test.go | 1 - sei-ibc-go/modules/core/genesis_test.go | 2 +- .../07-tendermint/types/tendermint_test.go | 1 - .../09-localhost/types/localhost_test.go | 1 - sei-ibc-go/testing/simapp/export.go | 1 - sei-wasmd/x/wasm/keeper/genesis_test.go | 1 - sei-wasmd/x/wasm/keeper/keeper_test.go | 2 - .../keeper/snapshotter_integration_test.go | 1 - testutil/keeper/epoch.go | 1 - x/epoch/handler_test.go | 2 +- x/epoch/keeper/epoch_test.go | 2 +- x/epoch/module_test.go | 1 - x/epoch/types/hooks_test.go | 1 - x/evm/artifacts/native/artifacts_test.go | 3 +- x/evm/keeper/evm_test.go | 11 ++--- .../add_new_param_migration_test.go | 4 +- .../disable_register_pointer_test.go | 4 +- .../migrate_deliver_tx_gas_limit_test.go | 4 +- .../migrate_eip_1559_max_base_fee_test.go | 3 +- .../migrate_eip_1559_params_test.go | 3 +- .../migrate_remove_tx_hashes_test.go | 4 +- x/mint/keeper/genesis_test.go | 2 +- x/mint/keeper/grpc_query_test.go | 1 - x/mint/keeper/hooks_test.go | 3 +- x/mint/keeper/integration_test.go | 1 - x/mint/keeper/migrations_test.go | 1 - x/mint/module_test.go | 2 +- x/mint/types/minter_test.go | 2 - x/oracle/ante_test.go | 1 - x/oracle/keeper/testutils/test_utils.go | 1 - x/oracle/types/ballot_test.go | 2 - x/tokenfactory/keeper/genesis_test.go | 2 +- x/tokenfactory/keeper/keeper_test.go | 3 +- x/tokenfactory/keeper/migrations_test.go | 1 - 59 files changed, 75 insertions(+), 122 deletions(-) diff --git a/app/antedecorators/authz_nested_message_test.go b/app/antedecorators/authz_nested_message_test.go index c7fd93998f..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" ) 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 4e2f7186ad..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" diff --git a/app/antedecorators/priority_test.go b/app/antedecorators/priority_test.go index b22046629f..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" diff --git a/app/antedecorators/traced_test.go b/app/antedecorators/traced_test.go index 06318cb932..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" ) 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/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/optimistic_processing_test.go b/app/optimistic_processing_test.go index 65d25b7207..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" ) diff --git a/app/upgrade_test.go b/app/upgrade_test.go index a0ea15252c..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" ) diff --git a/giga/deps/testutil/keeper/epoch.go b/giga/deps/testutil/keeper/epoch.go index e9a2fc066d..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" diff --git a/giga/deps/xbank/keeper/keeper_test.go b/giga/deps/xbank/keeper/keeper_test.go index 612d1496d2..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" ) diff --git a/giga/tests/giga_test.go b/giga/tests/giga_test.go index ec5dedfff3..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" diff --git a/giga/tests/state_harness_test.go b/giga/tests/state_harness_test.go index 74f3293488..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" ) diff --git a/occ_tests/utils/utils.go b/occ_tests/utils/utils.go index db7f8aea0b..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" 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-ibc-go/modules/apps/27-interchain-accounts/module_test.go b/sei-ibc-go/modules/apps/27-interchain-accounts/module_test.go index 08e2010dbe..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" 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 b3f3430747..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" 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 824e6b7772..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" 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 2028f3751c..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" diff --git a/sei-ibc-go/modules/core/genesis_test.go b/sei-ibc-go/modules/core/genesis_test.go index b315ef5eb5..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" 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 1c8cef9977..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" 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 191699cff4..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" diff --git a/sei-ibc-go/testing/simapp/export.go b/sei-ibc-go/testing/simapp/export.go index 3481ceef9c..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 diff --git a/sei-wasmd/x/wasm/keeper/genesis_test.go b/sei-wasmd/x/wasm/keeper/genesis_test.go index 077310660e..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" diff --git a/sei-wasmd/x/wasm/keeper/keeper_test.go b/sei-wasmd/x/wasm/keeper/keeper_test.go index 70b3b3dcf1..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" ) diff --git a/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go b/sei-wasmd/x/wasm/keeper/snapshotter_integration_test.go index 1aa30858cf..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" diff --git a/testutil/keeper/epoch.go b/testutil/keeper/epoch.go index e9a2fc066d..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" diff --git a/x/epoch/handler_test.go b/x/epoch/handler_test.go index 44b7e4878b..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" ) diff --git a/x/epoch/keeper/epoch_test.go b/x/epoch/keeper/epoch_test.go index 2869a97f24..17657326c1 100644 --- a/x/epoch/keeper/epoch_test.go +++ b/x/epoch/keeper/epoch_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/x/epoch/types" "github.com/stretchr/testify/require" ) diff --git a/x/epoch/module_test.go b/x/epoch/module_test.go index 74833f094c..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" diff --git a/x/epoch/types/hooks_test.go b/x/epoch/types/hooks_test.go index a0d703edaa..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" 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 e96a7566aa..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" diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index 12a6ade3bd..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" diff --git a/x/mint/keeper/hooks_test.go b/x/mint/keeper/hooks_test.go index fa89423578..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 { diff --git a/x/mint/keeper/integration_test.go b/x/mint/keeper/integration_test.go index 41d3c2d024..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" diff --git a/x/mint/keeper/migrations_test.go b/x/mint/keeper/migrations_test.go index 55ba5df4c9..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" diff --git a/x/mint/module_test.go b/x/mint/module_test.go index b6aa9a80ad..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" diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index a8b4fa30a7..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" diff --git a/x/oracle/ante_test.go b/x/oracle/ante_test.go index 524cc2a7e5..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" diff --git a/x/oracle/keeper/testutils/test_utils.go b/x/oracle/keeper/testutils/test_utils.go index dc9bb0ce3e..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" diff --git a/x/oracle/types/ballot_test.go b/x/oracle/types/ballot_test.go index e8938e4079..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" ) diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index 24eb2bd6d3..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" ) diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index 3162fdc85c..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" diff --git a/x/tokenfactory/keeper/migrations_test.go b/x/tokenfactory/keeper/migrations_test.go index cae3fc01c4..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" From 8e5b0cf252c70cb1e302f390cf9fc160e19b03fe Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 19 Feb 2026 14:47:35 +0100 Subject: [PATCH 16/16] go mod tidy --- sei-cosmos/go.mod | 28 ++++++- sei-cosmos/go.sum | 81 ++++++++++++++++---- sei-cosmos/x/crisis/handler_test.go | 1 - sei-cosmos/x/distribution/module_test.go | 2 +- sei-cosmos/x/gov/handler_test.go | 1 - sei-cosmos/x/params/proposal_handler_test.go | 1 - sei-cosmos/x/staking/common_test.go | 1 - sei-cosmos/x/staking/keeper/common_test.go | 1 - sei-cosmos/x/staking/keeper/keeper_test.go | 1 - sei-cosmos/x/staking/module_test.go | 2 +- 10 files changed, 93 insertions(+), 26 deletions(-) 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/x/crisis/handler_test.go b/sei-cosmos/x/crisis/handler_test.go index 9efbfecd8f..4fb1d66f16 100644 --- a/sei-cosmos/x/crisis/handler_test.go +++ b/sei-cosmos/x/crisis/handler_test.go @@ -3,7 +3,6 @@ package crisis_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/sei-cosmos/x/distribution/module_test.go b/sei-cosmos/x/distribution/module_test.go index cbfb3bc5c0..c6db3ba0c9 100644 --- a/sei-cosmos/x/distribution/module_test.go +++ b/sei-cosmos/x/distribution/module_test.go @@ -1,8 +1,8 @@ package distribution_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "context" + sdk "github.com/cosmos/cosmos-sdk/types" "testing" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" diff --git a/sei-cosmos/x/gov/handler_test.go b/sei-cosmos/x/gov/handler_test.go index 76adadd765..7f101d7f0f 100644 --- a/sei-cosmos/x/gov/handler_test.go +++ b/sei-cosmos/x/gov/handler_test.go @@ -4,7 +4,6 @@ import ( "strings" "testing" - "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/stretchr/testify/require" diff --git a/sei-cosmos/x/params/proposal_handler_test.go b/sei-cosmos/x/params/proposal_handler_test.go index 049aec83be..4fdb0beffa 100644 --- a/sei-cosmos/x/params/proposal_handler_test.go +++ b/sei-cosmos/x/params/proposal_handler_test.go @@ -5,7 +5,6 @@ import ( "github.com/stretchr/testify/suite" - sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/params" diff --git a/sei-cosmos/x/staking/common_test.go b/sei-cosmos/x/staking/common_test.go index b894a3891c..d919a280ac 100644 --- a/sei-cosmos/x/staking/common_test.go +++ b/sei-cosmos/x/staking/common_test.go @@ -4,7 +4,6 @@ import ( "math/big" "testing" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" diff --git a/sei-cosmos/x/staking/keeper/common_test.go b/sei-cosmos/x/staking/keeper/common_test.go index 3de534eee8..bf00d01f27 100644 --- a/sei-cosmos/x/staking/keeper/common_test.go +++ b/sei-cosmos/x/staking/keeper/common_test.go @@ -4,7 +4,6 @@ import ( "math/big" "testing" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/sei-cosmos/x/staking/keeper/keeper_test.go b/sei-cosmos/x/staking/keeper/keeper_test.go index 4a91231a80..246b649035 100644 --- a/sei-cosmos/x/staking/keeper/keeper_test.go +++ b/sei-cosmos/x/staking/keeper/keeper_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/sei-cosmos/x/staking/module_test.go b/sei-cosmos/x/staking/module_test.go index 3de8ecc929..b1bfb1df96 100644 --- a/sei-cosmos/x/staking/module_test.go +++ b/sei-cosmos/x/staking/module_test.go @@ -1,8 +1,8 @@ package staking_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "context" + sdk "github.com/cosmos/cosmos-sdk/types" "testing" abcitypes "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types"