refactor(server)!: continue server v1 removal (#23238)

This commit is contained in:
Julien Robert
2025-01-08 12:18:19 +00:00
committed by GitHub
parent 597c176900
commit c5b3033b3a
50 changed files with 182 additions and 3217 deletions
-23
View File
@@ -18,13 +18,8 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx"
@@ -221,22 +216,6 @@ func (a *App) RegisterTxService(clientCtx client.Context) {
authtx.RegisterTxService(a.GRPCQueryRouter(), clientCtx, a.Simulate, a.interfaceRegistry)
}
// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (a *App) RegisterTendermintService(clientCtx client.Context) {
cmtApp := server.NewCometABCIWrapper(a)
cmtservice.RegisterTendermintService(
clientCtx,
a.GRPCQueryRouter(),
a.interfaceRegistry,
cmtApp.Query,
)
}
// RegisterNodeService registers the node gRPC service on the app gRPC router.
func (a *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) {
nodeservice.RegisterNodeService(clientCtx, a.GRPCQueryRouter(), cfg)
}
// Configurator returns the app's configurator.
func (a *App) Configurator() module.Configurator { //nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1.
return a.configurator
@@ -288,8 +267,6 @@ func (a *App) UnsafeFindStoreKey(storeKey string) storetypes.StoreKey {
return a.storeKeys[i]
}
var _ servertypes.Application = &App{}
// hasServicesV1 is the interface for registering service in baseapp Cosmos SDK.
// This API is part of core/appmodule but commented out for dependencies.
type hasServicesV1 interface {
+2 -2
View File
@@ -8,12 +8,12 @@ import (
"github.com/spf13/cast"
"cosmossdk.io/core/server"
corestore "cosmossdk.io/core/store"
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx"
@@ -25,7 +25,7 @@ import (
type AppBuilder struct {
app *App
appOptions servertypes.AppOptions
appOptions server.DynamicConfig
}
// DefaultGenesis returns a default genesis from the registered modules.
+2 -2
View File
@@ -15,6 +15,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/comet"
"cosmossdk.io/core/registry"
"cosmossdk.io/core/server"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"
@@ -24,7 +25,6 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/types/msgservice"
@@ -161,7 +161,7 @@ type AppInputs struct {
BaseAppOptions []BaseAppOption
InterfaceRegistry codectypes.InterfaceRegistry
LegacyAmino registry.AminoRegistrar
AppOptions servertypes.AppOptions `optional:"true"` // can be nil in client wiring
AppOptions server.DynamicConfig `optional:"true"` // can be nil in client wiring
}
func SetupAppBuilder(inputs AppInputs) {
+17 -2
View File
@@ -1,9 +1,11 @@
package runtime
import (
"encoding/json"
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
"github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)
@@ -29,7 +31,20 @@ type AppI interface {
LoadHeight(height int64) error
// ExportAppStateAndValidators exports the state of the application for a genesis file.
ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (types.ExportedApp, error)
ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (ExportedApp, error)
}
// ExportedApp represents an exported app state, along with
// validators, consensus params and latest app height.
type ExportedApp struct {
// AppState is the application state as JSON.
AppState json.RawMessage
// Validators is the exported validator set.
Validators []sdk.GenesisValidator
// Height is the app's latest block height.
Height int64
// ConsensusParams are the exported consensus params for ABCI.
ConsensusParams cmtproto.ConsensusParams
}
// AppSimI implements the common methods for a Cosmos SDK-based application