Skip to content

Commit

Permalink
refactor: move baseapp/AppVersionModifer -> core/app
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed May 12, 2024
1 parent ab1dbe1 commit 63313c1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
9 changes: 0 additions & 9 deletions baseapp/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@ type ParamStore interface {
Has(ctx context.Context) (bool, error)
Set(ctx context.Context, cp cmtproto.ConsensusParams) error
}

// AppVersionModifier defines the interface fulfilled by BaseApp
// which allows getting and setting it's appVersion field. This
// in turn updates the consensus params that are sent to the
// consensus engine in EndBlock
type AppVersionModifier interface {
SetAppVersion(context.Context, uint64) error
AppVersion(context.Context) (uint64, error)
}
10 changes: 10 additions & 0 deletions core/app/app.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app

import (
"context"
"time"

appmodulev2 "cosmossdk.io/core/appmodule/v2"
Expand Down Expand Up @@ -64,3 +65,12 @@ type TxResult struct {
GasUsed uint64
Codespace string
}

// AppVersionModifier defines the interface fulfilled by BaseApp
// which allows getting and setting it's appVersion field. This
// in turn updates the consensus params that are sent to the
// consensus engine in EndBlock
type AppVersionModifier interface {
SetAppVersion(context.Context, uint64) error
AppVersion(context.Context) (uint64, error)
}
3 changes: 2 additions & 1 deletion runtime/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package runtime

import (
"cosmossdk.io/core/app"
"fmt"
"os"

Expand Down Expand Up @@ -281,7 +282,7 @@ func ProvideTransientStoreService(key depinject.ModuleKey, app *AppBuilder) stor
return transientStoreService{key: storeKey}
}

func ProvideAppVersionModifier(app *AppBuilder) baseapp.AppVersionModifier {
func ProvideAppVersionModifier(app *AppBuilder) app.AppVersionModifier {
return app.app
}

Expand Down
4 changes: 2 additions & 2 deletions x/upgrade/depinject.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package upgrade

import (
"cosmossdk.io/core/app"
"github.com/spf13/cast"

modulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1"
Expand All @@ -12,7 +13,6 @@ import (
"cosmossdk.io/x/upgrade/keeper"
"cosmossdk.io/x/upgrade/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server"
Expand All @@ -39,7 +39,7 @@ type ModuleInputs struct {
Environment appmodule.Environment
Cdc codec.Codec
AddressCodec address.Codec
AppVersionModifier baseapp.AppVersionModifier
AppVersionModifier app.AppVersionModifier

AppOpts servertypes.AppOptions `optional:"true"`
}
Expand Down
4 changes: 2 additions & 2 deletions x/upgrade/exported/exported.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package exported

import (
"github.com/cosmos/cosmos-sdk/baseapp"
"cosmossdk.io/core/app"
)

// AppVersionModifier defines the interface fulfilled by BaseApp
// which allows getting and setting it's appVersion field. This
// in turn updates the consensus params that are sent to the
// consensus engine in EndBlock
type AppVersionModifier baseapp.AppVersionModifier
type AppVersionModifier app.AppVersionModifier

0 comments on commit 63313c1

Please sign in to comment.