Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rkollar committed Jul 16, 2024
1 parent 01c1449 commit 7e83784
Show file tree
Hide file tree
Showing 38 changed files with 614 additions and 497 deletions.
4 changes: 2 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
sagaante "github.com/sagaxyz/saga-sdk/ante"
)

Expand Down
356 changes: 222 additions & 134 deletions app/app.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions app/simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import (

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
storetypes "cosmossdk.io/store/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
evidencetypes "cosmossdk.io/x/evidence/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand Down
18 changes: 18 additions & 0 deletions app/upgrades/v1/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package v1

import (
"context"

upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
)

const Name = "0.x-to-1" //TODO replace x with the actual number

func UpgradeHandler(mm *module.Manager, configurator module.Configurator, paramsKeeper paramskeeper.Keeper, consensusKeeper *consensuskeeper.Keeper) upgradetypes.UpgradeHandler {
return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, vm)
}
}
40 changes: 32 additions & 8 deletions cmd/sscd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"path/filepath"
"strings"

"cosmossdk.io/log"
"cosmossdk.io/store"
dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand All @@ -22,9 +23,6 @@ import (
"github.com/cosmos/cosmos-sdk/server"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -91,6 +89,15 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) {
flags.FlagKeyringBackend: "test",
})

autoCliOpts := tempApp.AutoCliOpts()
initClientCtx, _ = config.ReadDefaultValuesFromDefaultClientConfig(initClientCtx)
//autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring)
autoCliOpts.ClientCtx = initClientCtx

if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil {
panic(err)
}

return rootCmd, encodingConfig
}

Expand Down Expand Up @@ -149,6 +156,19 @@ func initRootCmd(
txCommand(),
keys.Commands(app.DefaultNodeHome),
)

/* if !clientCtx.Offline {
txConfigOpts.EnabledSignModes = append(txConfigOpts.EnabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL)
txConfigOpts.TextualCoinMetadataQueryFn = txmodule.NewGRPCCoinMetadataQueryFn(clientCtx)
txConfigWithTextual, err := tx.NewTxConfigWithOptions(
codec.NewProtoCodec(clientCtx.InterfaceRegistry),
txConfigOpts,
)
if err != nil {
return err
}
clientCtx = clientCtx.WithTxConfig(txConfigWithTextual)
}*/ //TODO
}

// queryCommand returns the sub-command to send queries to the app
Expand All @@ -170,7 +190,7 @@ func queryCommand() *cobra.Command {
authcmd.QueryTxCmd(),
)

app.ModuleBasics.AddQueryCommands(cmd)
//app.ModuleBasics.AddQueryCommands(cmd) //TODO check all modules
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

return cmd
Expand All @@ -197,7 +217,7 @@ func txCommand() *cobra.Command {
authcmd.GetDecodeCommand(),
)

app.ModuleBasics.AddTxCommands(cmd)
//app.ModuleBasics.AddTxCommands(cmd) //TODO check all modules
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

return cmd
Expand Down Expand Up @@ -263,7 +283,7 @@ func (a appCreator) newApp(
chainID = appGenesis.ChainID
}

snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
/*snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir)
if err != nil {
panic(err)
Expand All @@ -276,7 +296,11 @@ func (a appCreator) newApp(
snapshotOptions := snapshottypes.NewSnapshotOptions(
cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)),
cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)),
)
)*/ //TODO

if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil {
panic(err)
}

return app.New(
logger,
Expand Down
Loading

0 comments on commit 7e83784

Please sign in to comment.