clean up, rm unused

This commit is contained in:
Roy Crihfield 2022-05-18 16:08:56 +08:00
parent 11e82761b4
commit 92295c3061
5 changed files with 6 additions and 30 deletions

View File

@ -27,9 +27,9 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
// ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
"github.com/cosmos/cosmos-sdk/db/memdb" "github.com/cosmos/cosmos-sdk/db/memdb"
storetypes "github.com/cosmos/cosmos-sdk/store/types" storetypes "github.com/cosmos/cosmos-sdk/store/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/log"
@ -190,7 +190,7 @@ func TestAppImportExport(t *testing.T) {
{app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}}, {app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}},
{app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}}, {app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}},
{app.keys[ibchost.StoreKey], newApp.keys[ibchost.StoreKey], [][]byte{}}, {app.keys[ibchost.StoreKey], newApp.keys[ibchost.StoreKey], [][]byte{}},
// {app.keys[ibctransfertypes.StoreKey], newApp.keys[ibctransfertypes.StoreKey], [][]byte{}}, {app.keys[ibctransfertypes.StoreKey], newApp.keys[ibctransfertypes.StoreKey], [][]byte{}},
} }
for _, skp := range storeKeysPrefixes { for _, skp := range storeKeysPrefixes {

View File

@ -156,7 +156,9 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf
return err return err
} }
pks[i], err = k.GetPubKey() if pks[i], err = k.GetPubKey(); err != nil {
return err
}
} }
if noSort, _ := cmd.Flags().GetBool(flagNoSort); !noSort { if noSort, _ := cmd.Flags().GetBool(flagNoSort); !noSort {

View File

@ -21,16 +21,6 @@ const (
type bechKeyOutFn func(keyInfo *cryptokeyring.Record) (cryptokeyring.KeyOutput, error) type bechKeyOutFn func(keyInfo *cryptokeyring.Record) (cryptokeyring.KeyOutput, error)
// // NewLegacyKeyBaseFromDir initializes a legacy keybase at the rootDir directory. Keybase
// // options can be applied when generating this new Keybase.
// func NewLegacyKeyBaseFromDir(rootDir string, opts ...cryptokeyring.KeybaseOption) (cryptokeyring.LegacyKeybase, error) {
// return getLegacyKeyBaseFromDir(rootDir, opts...)
// }
// func getLegacyKeyBaseFromDir(rootDir string, opts ...cryptokeyring.KeybaseOption) (cryptokeyring.LegacyKeybase, error) {
// return cryptokeyring.NewLegacy(defaultKeyDBName, filepath.Join(rootDir, "keys"), opts...)
// }
func printKeyInfo(w io.Writer, keyInfo *cryptokeyring.Record, bechKeyOut bechKeyOutFn, output string) { func printKeyInfo(w io.Writer, keyInfo *cryptokeyring.Record, bechKeyOut bechKeyOutFn, output string) {
ko, err := bechKeyOut(keyInfo) ko, err := bechKeyOut(keyInfo)
if err != nil { if err != nil {

View File

@ -148,7 +148,6 @@ which accepts a path for the resulting pprof file.
cmd.Flags().Bool(server.FlagTrace, false, "Provide full stack traces for errors in ABCI Log") cmd.Flags().Bool(server.FlagTrace, false, "Provide full stack traces for errors in ABCI Log")
cmd.Flags().String(server.FlagPruning, storetypes.PruningOptionDefault, "Pruning strategy (default|nothing|everything|custom)") cmd.Flags().String(server.FlagPruning, storetypes.PruningOptionDefault, "Pruning strategy (default|nothing|everything|custom)")
cmd.Flags().Uint64(server.FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(server.FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')")
// cmd.Flags().Uint64(server.FlagPruningKeepEvery, 0, "Offset heights to keep on disk after 'keep-every' (ignored if pruning is not 'custom')")
cmd.Flags().Uint64(server.FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(server.FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')")
cmd.Flags().Uint(server.FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") cmd.Flags().Uint(server.FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks")
cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune Tendermint blocks") cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune Tendermint blocks")

View File

@ -562,7 +562,7 @@ func (n *Network) LatestHeight() (int64, error) {
// committed after a given block. If that height is not reached within a timeout, // committed after a given block. If that height is not reached within a timeout,
// an error is returned. Regardless, the latest height queried is returned. // an error is returned. Regardless, the latest height queried is returned.
func (n *Network) WaitForHeight(h int64) (int64, error) { func (n *Network) WaitForHeight(h int64) (int64, error) {
return n.WaitForHeightWithTimeout(h, time.Duration(10*time.Second)) return n.WaitForHeightWithTimeout(h, 10*time.Second)
} }
// WaitForHeightWithTimeout is the same as WaitForHeight except the caller can // WaitForHeightWithTimeout is the same as WaitForHeight except the caller can
@ -638,21 +638,6 @@ func (n *Network) Cleanup() {
_ = v.grpcWeb.Close() _ = v.grpcWeb.Close()
} }
} }
// if v.jsonrpc != nil {
// shutdownCtx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second)
// defer cancelFn()
// if err := v.jsonrpc.Shutdown(shutdownCtx); err != nil {
// v.tmNode.Logger.Error("HTTP server shutdown produced a warning", "error", err.Error())
// } else {
// v.tmNode.Logger.Info("HTTP server shut down, waiting 5 sec")
// select {
// case <-time.Tick(5 * time.Second):
// case <-v.jsonrpcDone:
// }
// }
// }
} }
if n.Config.CleanupDir { if n.Config.CleanupDir {