Move codec.RegisterCrypto and codec.Cdc to new packages (#6330)
* Move codec.Cdc to legacy_global.Cdc * Update CHANGELOG.md * Updates * nit * Fix imports * Updates * Use cosmos multisig instead of tendermint multisig everywhere * Fix tests * Rename legacy_global -> legacy * Add doc.go * Linting, move all RegisterCrypto calls to crypto/codec * Update crypto/codec/amino.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
co-authored by
Federico Kunze
parent
dcbf152ae5
commit
81d647e505
+1
-1
@@ -14,13 +14,13 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/input"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/multisig"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package keys
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
)
|
||||
|
||||
// KeysCdc defines codec to be used with key operations
|
||||
@@ -9,7 +10,7 @@ var KeysCdc *codec.Codec
|
||||
|
||||
func init() {
|
||||
KeysCdc = codec.New()
|
||||
codec.RegisterCrypto(KeysCdc)
|
||||
cryptocodec.RegisterCrypto(KeysCdc)
|
||||
KeysCdc.Seal()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,12 +8,12 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
tmcrypto "github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/multisig"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/crypto"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/multisig"
|
||||
"github.com/tendermint/tendermint/crypto/secp256k1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
|
||||
"github.com/cosmos/cosmos-sdk/tests"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/codec/legacy"
|
||||
"github.com/cosmos/cosmos-sdk/types/rest"
|
||||
|
||||
tmliteProxy "github.com/tendermint/tendermint/lite/proxy"
|
||||
@@ -65,10 +65,10 @@ func getBlock(clientCtx client.Context, height *int64) ([]byte, error) {
|
||||
}
|
||||
|
||||
if clientCtx.Indent {
|
||||
return codec.Cdc.MarshalJSONIndent(res, "", " ")
|
||||
return legacy.Cdc.MarshalJSONIndent(res, "", " ")
|
||||
}
|
||||
|
||||
return codec.Cdc.MarshalJSON(res)
|
||||
return legacy.Cdc.MarshalJSON(res)
|
||||
}
|
||||
|
||||
// get the current blockchain height
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/codec/legacy"
|
||||
"github.com/cosmos/cosmos-sdk/types/rest"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
||||
@@ -55,9 +55,9 @@ func printNodeStatus(_ *cobra.Command, _ []string) error {
|
||||
|
||||
var output []byte
|
||||
if clientCtx.Indent {
|
||||
output, err = codec.Cdc.MarshalJSONIndent(status, "", " ")
|
||||
output, err = legacy.Cdc.MarshalJSONIndent(status, "", " ")
|
||||
} else {
|
||||
output, err = codec.Cdc.MarshalJSON(status)
|
||||
output, err = legacy.Cdc.MarshalJSON(status)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user