From f58633d4c3bbcd6aa14a1be6ab0b6993f2e60104 Mon Sep 17 00:00:00 2001 From: Matt Witkowski Date: Tue, 7 May 2024 13:30:41 -0400 Subject: [PATCH] Removes sync-info command (#1952) * Update changelog. * First attempt at state-sync. * Temporary commit with changes. * Update changelog. * Revert to what is in main. * Remove sync-info. --- CHANGELOG.md | 1 + app/app.go | 4 ---- internal/statesync/statesync.go | 35 --------------------------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 internal/statesync/statesync.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6beebeb12d..9f08ec06a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930). * Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930). * Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931). +* Removes sync-info code for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). * Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943) ### Dependencies diff --git a/app/app.go b/app/app.go index ca045c2a13..0a7d688a05 100644 --- a/app/app.go +++ b/app/app.go @@ -129,7 +129,6 @@ import ( piohandlers "github.com/provenance-io/provenance/internal/handlers" "github.com/provenance-io/provenance/internal/pioconfig" "github.com/provenance-io/provenance/internal/provwasm" - "github.com/provenance-io/provenance/internal/statesync" "github.com/provenance-io/provenance/x/attribute" attributekeeper "github.com/provenance-io/provenance/x/attribute/keeper" attributetypes "github.com/provenance-io/provenance/x/attribute/types" @@ -402,9 +401,6 @@ func New( os.Exit(1) } - // Register helpers for state-sync status. - statesync.RegisterSyncStatus() - app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) // set the BaseApp's parameter store diff --git a/internal/statesync/statesync.go b/internal/statesync/statesync.go deleted file mode 100644 index 08b02fc923..0000000000 --- a/internal/statesync/statesync.go +++ /dev/null @@ -1,35 +0,0 @@ -package statesync - -import ( - // cmtrpccore "github.com/cometbft/cometbft/rpc/core" // TODO[1760]: sync-info - // cmtrpc "github.com/cometbft/cometbft/rpc/jsonrpc/server" // TODO[1760]: sync-info - cmtrpctypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - - "github.com/cosmos/cosmos-sdk/version" -) - -func RegisterSyncStatus() { - // TODO[1760]: sync-info: Figure out how to still set a custom route. - // cmtrpccore.Routes["sync_info"] = cmtrpc.NewRPCFunc(GetSyncInfoAtBlock, "height") -} - -func GetSyncInfoAtBlock(ctx *cmtrpctypes.Context, height *int64) (*GetSyncInfo, error) { - // TODO[1760]: sync-info: Figure out the new way to get the current block. - // block, err := cmtrpccore.Block(ctx, height) - // if err != nil { - // return nil, err - // } - versionInfo := version.NewInfo() - si := &GetSyncInfo{ - BlockHeight: 123, // block.Block.Header.Height, // TODO[1760]: sync-info - BlockHash: "finishme", // block.Block.Header.Hash().String(), // TODO[1760]: sync-info - Version: versionInfo.Version, - } - return si, nil -} - -type GetSyncInfo struct { - BlockHeight int64 `json:"block_height"` - BlockHash string `json:"block_hash"` - Version string `json:"version"` -}