Skip to content

Commit

Permalink
Use Storetypes in place of sdk types & add streaming services check a…
Browse files Browse the repository at this point in the history
…t app.go
  • Loading branch information
RaulBernal committed Jul 12, 2023
1 parent e422f8f commit d25d0fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 6 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/store/streaming"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -318,6 +319,11 @@ func New(
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)

if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil {
logger.Error("failed to load state streaming", "err", err)
os.Exit(1)
}

app := &App{
BaseApp: bApp,
cdc: cdc,
Expand Down
3 changes: 2 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

servertypes "github.com/cosmos/cosmos-sdk/server/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
Expand Down Expand Up @@ -166,7 +167,7 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str
// Iterate through validators by power descending, reset bond heights, and
// update bond intra-tx counters.
store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey))
iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey)
iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey)
counter := int16(0)

for ; iter.Valid(); iter.Next() {
Expand Down
10 changes: 0 additions & 10 deletions cmd/bcnad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,6 @@ func initRootCmd(
// DELETE gentxModule := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic)
rootCmd.AddCommand(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
// genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, gentxModule.GenTxValidator),
// genutilcli.MigrateGenesisCmd(),
// genutilcli.GenTxCmd(
// app.ModuleBasics,
// encodingConfig.TxConfig,
// banktypes.GenesisBalancesIterator{},
// app.DefaultNodeHome,
// ),
// genutilcli.ValidateGenesisCmd(app.ModuleBasics),
// AddGenesisAccountCmd(app.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
config.Cmd(),
Expand Down

0 comments on commit d25d0fb

Please sign in to comment.