refactor(core): move amino registrar and drop legacy package (#21531)
This commit is contained in:
+2
-2
@@ -377,11 +377,11 @@ The signature of the extension interface `HasRegisterInterfaces` has been change
|
||||
+func (AppModule) RegisterInterfaces(registry registry.InterfaceRegistrar) {
|
||||
```
|
||||
|
||||
The signature of the extension interface `HasAminoCodec` has been changed to accept a `cosmossdk.io/core/legacy.Amino` instead of a `codec.LegacyAmino`. Modules should update their `HasAminoCodec` implementation to accept a `cosmossdk.io/core/legacy.Amino` interface.
|
||||
The signature of the extension interface `HasAminoCodec` has been changed to accept a `cosmossdk.io/core/registry.AminoRegistrar` instead of a `codec.LegacyAmino`. Modules should update their `HasAminoCodec` implementation to accept a `cosmossdk.io/core/registry.AminoRegistrar` interface.
|
||||
|
||||
```diff
|
||||
-func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
+func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
+func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
```
|
||||
|
||||
##### Simulation
|
||||
|
||||
+6
-6
@@ -10,7 +10,7 @@ import (
|
||||
cmttypes "github.com/cometbft/cometbft/types"
|
||||
"github.com/tendermint/go-amino"
|
||||
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
)
|
||||
@@ -25,7 +25,7 @@ func (cdc *LegacyAmino) Seal() {
|
||||
cdc.Amino.Seal()
|
||||
}
|
||||
|
||||
var _ legacy.Amino = &LegacyAmino{}
|
||||
var _ registry.AminoRegistrar = &LegacyAmino{}
|
||||
|
||||
func NewLegacyAmino() *LegacyAmino {
|
||||
return &LegacyAmino{amino.NewCodec()}
|
||||
@@ -33,9 +33,9 @@ func NewLegacyAmino() *LegacyAmino {
|
||||
|
||||
// RegisterEvidences registers CometBFT evidence types with the provided Amino
|
||||
// codec.
|
||||
func RegisterEvidences(cdc legacy.Amino) {
|
||||
cdc.RegisterInterface((*cmttypes.Evidence)(nil), nil)
|
||||
cdc.RegisterConcrete(&cmttypes.DuplicateVoteEvidence{}, "tendermint/DuplicateVoteEvidence")
|
||||
func RegisterEvidences(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*cmttypes.Evidence)(nil), nil)
|
||||
registrar.RegisterConcrete(&cmttypes.DuplicateVoteEvidence{}, "tendermint/DuplicateVoteEvidence")
|
||||
}
|
||||
|
||||
// MarshalJSONIndent provides a utility for indented JSON encoding of an object
|
||||
@@ -179,7 +179,7 @@ func (*LegacyAmino) UnpackAny(*types.Any, interface{}) error {
|
||||
return errors.New("AminoCodec can't handle unpack protobuf Any's")
|
||||
}
|
||||
|
||||
func (cdc *LegacyAmino) RegisterInterface(ptr interface{}, iopts *legacy.InterfaceOptions) {
|
||||
func (cdc *LegacyAmino) RegisterInterface(ptr interface{}, iopts *registry.AminoInterfaceOptions) {
|
||||
if iopts == nil {
|
||||
cdc.Amino.RegisterInterface(ptr, nil)
|
||||
} else {
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ import (
|
||||
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
|
||||
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/x/tx/signing"
|
||||
@@ -45,7 +44,7 @@ func ProvideInterfaceRegistry(
|
||||
return interfaceRegistry, interfaceRegistry, nil
|
||||
}
|
||||
|
||||
func ProvideLegacyAmino() legacy.Amino {
|
||||
func ProvideLegacyAmino() registry.AminoRegistrar {
|
||||
return NewLegacyAmino()
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package legacy
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// RegisterAminoMsg first checks that the msgName is <40 chars
|
||||
// (else this would break ledger nano signing: https://github.com/cosmos/cosmos-sdk/issues/10870),
|
||||
// then registers the concrete msg type with amino.
|
||||
func RegisterAminoMsg(cdc legacy.Amino, msg sdk.Msg, msgName string) {
|
||||
func RegisterAminoMsg(registrar registry.AminoRegistrar, msg sdk.Msg, msgName string) {
|
||||
if len(msgName) > 39 {
|
||||
panic(fmt.Errorf("msg name %s is too long to be registered with amino", msgName))
|
||||
}
|
||||
cdc.RegisterConcrete(msg, msgName)
|
||||
registrar.RegisterConcrete(msg, msgName)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
appmodulev2 "cosmossdk.io/core/appmodule/v2"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
)
|
||||
|
||||
// AppModule is a tag interface for app module implementations to use as a basis
|
||||
@@ -68,5 +68,5 @@ type HasPrecommit interface {
|
||||
// HasAminoCodec is an extension interface that module must implement to support JSON encoding and decoding of its types
|
||||
// through amino. This is used in genesis & the CLI client.
|
||||
type HasAminoCodec interface {
|
||||
RegisterLegacyAminoCodec(legacy.Amino)
|
||||
RegisterLegacyAminoCodec(registry.AminoRegistrar)
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package legacy
|
||||
|
||||
// Amino is an interface that allow to register concrete types and interfaces with the Amino codec.
|
||||
type Amino interface {
|
||||
// RegisterInterface registers an interface and its concrete type with the Amino codec.
|
||||
RegisterInterface(interfacePtr any, iopts *InterfaceOptions)
|
||||
|
||||
// RegisterConcrete registers a concrete type with the Amino codec.
|
||||
RegisterConcrete(cdcType interface{}, name string)
|
||||
}
|
||||
|
||||
// InterfaceOptions defines options for registering an interface with the Amino codec.
|
||||
type InterfaceOptions struct {
|
||||
Priority []string // Disamb priority.
|
||||
AlwaysDisambiguate bool // If true, include disamb for all types.
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package registry
|
||||
|
||||
// AminoRegistrar is an interface that allow to register concrete types and interfaces with the Amino codec.
|
||||
type AminoRegistrar interface {
|
||||
// RegisterInterface registers an interface and its concrete type with the Amino codec.
|
||||
RegisterInterface(interfacePtr any, iopts *AminoInterfaceOptions)
|
||||
|
||||
// RegisterConcrete registers a concrete type with the Amino codec.
|
||||
RegisterConcrete(cdcType interface{}, name string)
|
||||
}
|
||||
|
||||
// AminoInterfaceOptions defines options for registering an interface with the Amino codec.
|
||||
type AminoInterfaceOptions struct {
|
||||
Priority []string // Disamb priority.
|
||||
AlwaysDisambiguate bool // If true, include disamb for all types.
|
||||
}
|
||||
+13
-14
@@ -3,7 +3,7 @@ package codec
|
||||
import (
|
||||
"github.com/cometbft/cometbft/crypto/sr25519"
|
||||
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
bls12_381 "github.com/cosmos/cosmos-sdk/crypto/keys/bls12_381"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
@@ -14,24 +14,23 @@ import (
|
||||
|
||||
// RegisterCrypto registers all crypto dependency types with the provided Amino
|
||||
// codec.
|
||||
func RegisterCrypto(cdc legacy.Amino) {
|
||||
cdc.RegisterInterface((*cryptotypes.PubKey)(nil), nil)
|
||||
cdc.RegisterConcrete(sr25519.PubKey{},
|
||||
func RegisterCrypto(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*cryptotypes.PubKey)(nil), nil)
|
||||
registrar.RegisterConcrete(sr25519.PubKey{},
|
||||
sr25519.PubKeyName)
|
||||
cdc.RegisterConcrete(&ed25519.PubKey{},
|
||||
registrar.RegisterConcrete(&ed25519.PubKey{},
|
||||
ed25519.PubKeyName)
|
||||
cdc.RegisterConcrete(&secp256k1.PubKey{},
|
||||
registrar.RegisterConcrete(&secp256k1.PubKey{},
|
||||
secp256k1.PubKeyName)
|
||||
cdc.RegisterConcrete(&bls12_381.PubKey{}, bls12_381.PubKeyName)
|
||||
cdc.RegisterConcrete(&kmultisig.LegacyAminoPubKey{},
|
||||
registrar.RegisterConcrete(&bls12_381.PubKey{}, bls12_381.PubKeyName)
|
||||
registrar.RegisterConcrete(&kmultisig.LegacyAminoPubKey{},
|
||||
kmultisig.PubKeyAminoRoute)
|
||||
|
||||
cdc.RegisterInterface((*cryptotypes.PrivKey)(nil), nil)
|
||||
cdc.RegisterConcrete(sr25519.PrivKey{},
|
||||
registrar.RegisterInterface((*cryptotypes.PrivKey)(nil), nil)
|
||||
registrar.RegisterConcrete(sr25519.PrivKey{},
|
||||
sr25519.PrivKeyName)
|
||||
cdc.RegisterConcrete(&ed25519.PrivKey{},
|
||||
registrar.RegisterConcrete(&ed25519.PrivKey{},
|
||||
ed25519.PrivKeyName)
|
||||
cdc.RegisterConcrete(&secp256k1.PrivKey{},
|
||||
registrar.RegisterConcrete(&secp256k1.PrivKey{},
|
||||
secp256k1.PrivKeyName)
|
||||
cdc.RegisterConcrete(&bls12_381.PrivKey{}, bls12_381.PrivKeyName)
|
||||
registrar.RegisterConcrete(&bls12_381.PrivKey{}, bls12_381.PrivKeyName)
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ The usage of extension interfaces allows modules to define only the functionalit
|
||||
https://github.com/cosmos/cosmos-sdk/blob/eee5e21e1c8d0995b6d4f83b7f55ec0b58d27ba7/core/appmodule/module.go#L74-L78
|
||||
```
|
||||
|
||||
* `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`.
|
||||
* `RegisterLegacyAminoCodec(registry.AminoRegistrar)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`.
|
||||
|
||||
### `HasRegisterInterfaces`
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
|
||||
@@ -50,7 +50,7 @@ type App struct {
|
||||
storeKeys []storetypes.StoreKey
|
||||
interfaceRegistry codectypes.InterfaceRegistry
|
||||
cdc codec.Codec
|
||||
amino legacy.Amino
|
||||
amino registry.AminoRegistrar
|
||||
baseAppOptions []BaseAppOption
|
||||
msgServiceRouter *baseapp.MsgServiceRouter
|
||||
grpcQueryRouter *baseapp.GRPCQueryRouter
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ import (
|
||||
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/server"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
@@ -112,7 +112,7 @@ func init() {
|
||||
|
||||
func ProvideApp(
|
||||
interfaceRegistry codectypes.InterfaceRegistry,
|
||||
amino legacy.Amino,
|
||||
amino registry.AminoRegistrar,
|
||||
protoCodec *codec.ProtoCodec,
|
||||
) (
|
||||
*AppBuilder,
|
||||
@@ -159,7 +159,7 @@ type AppInputs struct {
|
||||
ModuleManager *module.Manager
|
||||
BaseAppOptions []BaseAppOption
|
||||
InterfaceRegistry codectypes.InterfaceRegistry
|
||||
LegacyAmino legacy.Amino
|
||||
LegacyAmino registry.AminoRegistrar
|
||||
AppOptions servertypes.AppOptions `optional:"true"` // can be nil in client wiring
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ import (
|
||||
gogoproto "github.com/cosmos/gogoproto/proto"
|
||||
|
||||
runtimev2 "cosmossdk.io/api/cosmos/app/runtime/v2"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/log"
|
||||
@@ -41,7 +40,7 @@ type App[T transaction.Tx] struct {
|
||||
// modules configuration
|
||||
storeKeys []string
|
||||
interfaceRegistrar registry.InterfaceRegistrar
|
||||
amino legacy.Amino
|
||||
amino registry.AminoRegistrar
|
||||
moduleManager *MM[T]
|
||||
|
||||
// GRPCMethodsToMessageMap maps gRPC method name to a function that decodes the request
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
cosmosmsg "cosmossdk.io/api/cosmos/msg/v1"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
appmodulev2 "cosmossdk.io/core/appmodule/v2"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/log"
|
||||
@@ -85,10 +84,10 @@ func (m *MM[T]) Modules() map[string]appmodulev2.AppModule {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers all module codecs
|
||||
func (m *MM[T]) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
func (m *MM[T]) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
for _, b := range m.modules {
|
||||
if mod, ok := b.(appmodule.HasAminoCodec); ok {
|
||||
mod.RegisterLegacyAminoCodec(cdc)
|
||||
mod.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
|
||||
appmodulev2 "cosmossdk.io/core/appmodule/v2"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/server"
|
||||
"cosmossdk.io/core/store"
|
||||
@@ -107,7 +106,7 @@ func init() {
|
||||
|
||||
func ProvideAppBuilder[T transaction.Tx](
|
||||
interfaceRegistrar registry.InterfaceRegistrar,
|
||||
amino legacy.Amino,
|
||||
amino registry.AminoRegistrar,
|
||||
) (
|
||||
*AppBuilder[T],
|
||||
*stf.MsgRouterBuilder,
|
||||
@@ -146,7 +145,7 @@ type AppInputs struct {
|
||||
AppBuilder *AppBuilder[transaction.Tx]
|
||||
ModuleManager *MM[transaction.Tx]
|
||||
InterfaceRegistrar registry.InterfaceRegistrar
|
||||
LegacyAmino legacy.Amino
|
||||
LegacyAmino registry.AminoRegistrar
|
||||
Logger log.Logger
|
||||
Viper *viper.Viper `optional:"true"` // can be nil in client wiring
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import (
|
||||
clienthelpers "cosmossdk.io/client/v2/helpers"
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
corestore "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
@@ -65,7 +65,7 @@ var (
|
||||
// capabilities aren't needed for testing.
|
||||
type SimApp struct {
|
||||
*runtime.App
|
||||
legacyAmino legacy.Amino
|
||||
legacyAmino registry.AminoRegistrar
|
||||
appCodec codec.Codec
|
||||
txConfig client.TxConfig
|
||||
interfaceRegistry codectypes.InterfaceRegistry
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
stakingv1 "cosmossdk.io/api/cosmos/staking/module/v1"
|
||||
"cosmossdk.io/client/v2/autocli"
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/simapp"
|
||||
@@ -100,7 +100,7 @@ func ProvideClientContext(
|
||||
appCodec codec.Codec,
|
||||
interfaceRegistry codectypes.InterfaceRegistry,
|
||||
txConfigOpts tx.ConfigOptions,
|
||||
legacyAmino legacy.Amino,
|
||||
legacyAmino registry.AminoRegistrar,
|
||||
addressCodec address.Codec,
|
||||
validatorAddressCodec address.ValidatorAddressCodec,
|
||||
consensusAddressCodec address.ConsensusAddressCodec,
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
clienthelpers "cosmossdk.io/client/v2/helpers"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/server"
|
||||
"cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/depinject"
|
||||
@@ -47,7 +47,7 @@ var DefaultNodeHome string
|
||||
// capabilities aren't needed for testing.
|
||||
type SimApp[T transaction.Tx] struct {
|
||||
*runtime.App[T]
|
||||
legacyAmino legacy.Amino
|
||||
legacyAmino registry.AminoRegistrar
|
||||
appCodec codec.Codec
|
||||
txConfig client.TxConfig
|
||||
interfaceRegistry codectypes.InterfaceRegistry
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
"cosmossdk.io/client/v2/autocli"
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
@@ -99,7 +99,7 @@ func ProvideClientContext(
|
||||
appCodec codec.Codec,
|
||||
interfaceRegistry codectypes.InterfaceRegistry,
|
||||
txConfigOpts tx.ConfigOptions,
|
||||
legacyAmino legacy.Amino,
|
||||
legacyAmino registry.AminoRegistrar,
|
||||
addressCodec address.Codec,
|
||||
validatorAddressCodec address.ValidatorAddressCodec,
|
||||
consensusAddressCodec address.ConsensusAddressCodec,
|
||||
@@ -108,7 +108,7 @@ func ProvideClientContext(
|
||||
|
||||
amino, ok := legacyAmino.(*codec.LegacyAmino)
|
||||
if !ok {
|
||||
panic("legacy.Amino must be an *codec.LegacyAmino instance for legacy ClientContext")
|
||||
panic("registry.AminoRegistrar must be an *codec.LegacyAmino instance for legacy ClientContext")
|
||||
}
|
||||
|
||||
clientCtx := client.Context{}.
|
||||
|
||||
+4
-5
@@ -1,7 +1,6 @@
|
||||
package std
|
||||
|
||||
import (
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@@ -11,10 +10,10 @@ import (
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers types with the Amino codec.
|
||||
func RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
sdk.RegisterLegacyAminoCodec(cdc)
|
||||
cryptocodec.RegisterCrypto(cdc)
|
||||
codec.RegisterEvidences(cdc)
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
sdk.RegisterLegacyAminoCodec(registrar)
|
||||
cryptocodec.RegisterCrypto(registrar)
|
||||
codec.RegisterEvidences(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers Interfaces from sdk/types, vesting, crypto, tx.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
WAIT_TIME ?= 45s
|
||||
|
||||
all: test
|
||||
all: test format
|
||||
|
||||
test:
|
||||
go test -mod=readonly -failfast -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose $(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),--binary=simdv2)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
legacy "cosmossdk.io/core/legacy"
|
||||
registry "cosmossdk.io/core/registry"
|
||||
client "github.com/cosmos/cosmos-sdk/client"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
module "github.com/cosmos/cosmos-sdk/types/module"
|
||||
@@ -53,7 +53,7 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 i
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec mocks base method.
|
||||
func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 legacy.Amino) {
|
||||
func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 registry.AminoRegistrar) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0)
|
||||
}
|
||||
@@ -149,7 +149,7 @@ func (m *MockHasAminoCodec) EXPECT() *MockHasAminoCodecMockRecorder {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec mocks base method.
|
||||
func (m *MockHasAminoCodec) RegisterLegacyAminoCodec(arg0 legacy.Amino) {
|
||||
func (m *MockHasAminoCodec) RegisterLegacyAminoCodec(arg0 registry.AminoRegistrar) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
@@ -168,7 +168,7 @@ func DefaultConfigWithAppConfig(appConfig depinject.Config, baseappOpts ...func(
|
||||
var (
|
||||
appBuilder *runtime.AppBuilder
|
||||
txConfig client.TxConfig
|
||||
legacyAmino legacy.Amino
|
||||
legacyAmino registry.AminoRegistrar
|
||||
cdc codec.Codec
|
||||
interfaceRegistry codectypes.InterfaceRegistry
|
||||
addressCodec address.Codec
|
||||
|
||||
+4
-5
@@ -1,9 +1,8 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/core/transaction"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -12,9 +11,9 @@ const (
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers the sdk message type.
|
||||
func RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
cdc.RegisterInterface((*coretransaction.Msg)(nil), nil)
|
||||
cdc.RegisterInterface((*Tx)(nil), nil)
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*transaction.Msg)(nil), nil)
|
||||
registrar.RegisterInterface((*Tx)(nil), nil)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the sdk message type.
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/genesis"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
|
||||
@@ -198,9 +197,9 @@ func (c coreAppModuleAdaptor) RegisterInterfaces(reg registry.InterfaceRegistrar
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec implements HasAminoCodec
|
||||
func (c coreAppModuleAdaptor) RegisterLegacyAminoCodec(amino legacy.Amino) {
|
||||
func (c coreAppModuleAdaptor) RegisterLegacyAminoCodec(amino registry.AminoRegistrar) {
|
||||
if mod, ok := c.module.(interface {
|
||||
RegisterLegacyAminoCodec(amino legacy.Amino)
|
||||
RegisterLegacyAminoCodec(amino registry.AminoRegistrar)
|
||||
}); ok {
|
||||
mod.RegisterLegacyAminoCodec(amino)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import (
|
||||
"cosmossdk.io/core/appmodule"
|
||||
appmodulev2 "cosmossdk.io/core/appmodule/v2"
|
||||
"cosmossdk.io/core/genesis"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
@@ -69,7 +68,7 @@ type HasGenesisBasics = appmodule.HasGenesisBasics
|
||||
// HasAminoCodec is the interface for modules that have amino codec registration.
|
||||
// Deprecated: modules should not need to register their own amino codecs.
|
||||
type HasAminoCodec interface {
|
||||
RegisterLegacyAminoCodec(legacy.Amino)
|
||||
RegisterLegacyAminoCodec(registry.AminoRegistrar)
|
||||
}
|
||||
|
||||
// HasGRPCGateway is the interface for modules to register their gRPC gateway routes.
|
||||
@@ -294,14 +293,14 @@ func (m *Manager) SetOrderMigrations(moduleNames ...string) {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers all module codecs
|
||||
func (m *Manager) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
func (m *Manager) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
for name, b := range m.Modules {
|
||||
if _, ok := b.(interface{ RegisterLegacyAminoCodec(*codec.LegacyAmino) }); ok {
|
||||
panic(fmt.Sprintf("%s uses a deprecated amino registration api, implement HasAminoCodec instead if necessary", name))
|
||||
}
|
||||
|
||||
if mod, ok := b.(HasAminoCodec); ok {
|
||||
mod.RegisterLegacyAminoCodec(cdc)
|
||||
mod.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package legacytx
|
||||
|
||||
import (
|
||||
"cosmossdk.io/core/legacy"
|
||||
)
|
||||
import "cosmossdk.io/core/registry"
|
||||
|
||||
func RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
cdc.RegisterConcrete(StdTx{}, "cosmos-sdk/StdTx")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterConcrete(StdTx{}, "cosmos-sdk/StdTx")
|
||||
}
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
appmodulev2 "cosmossdk.io/core/appmodule/v2"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -75,8 +74,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the auth module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the auth module.
|
||||
|
||||
+10
-11
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -13,18 +12,18 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the
|
||||
// provided LegacyAmino codec. These types are used for Amino JSON serialization
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterInterface((*sdk.ModuleAccountI)(nil), nil)
|
||||
cdc.RegisterInterface((*GenesisAccount)(nil), nil)
|
||||
cdc.RegisterInterface((*sdk.AccountI)(nil), nil)
|
||||
cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount")
|
||||
cdc.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount")
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/auth/Params")
|
||||
cdc.RegisterConcrete(&ModuleCredential{}, "cosmos-sdk/GroupAccountCredential")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*sdk.ModuleAccountI)(nil), nil)
|
||||
registrar.RegisterInterface((*GenesisAccount)(nil), nil)
|
||||
registrar.RegisterInterface((*sdk.AccountI)(nil), nil)
|
||||
registrar.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount")
|
||||
registrar.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount")
|
||||
registrar.RegisterConcrete(Params{}, "cosmos-sdk/x/auth/Params")
|
||||
registrar.RegisterConcrete(&ModuleCredential{}, "cosmos-sdk/GroupAccountCredential")
|
||||
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/auth/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/auth/MsgUpdateParams")
|
||||
|
||||
legacytx.RegisterLegacyAminoCodec(cdc)
|
||||
legacytx.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces associates protoName with AccountI interface
|
||||
|
||||
@@ -2,7 +2,6 @@ package vesting
|
||||
|
||||
import (
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
@@ -34,8 +33,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the module's types with the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the module's interfaces and implementations with
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@@ -11,13 +10,13 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the
|
||||
// provided LegacyAmino codec. These types are used for Amino JSON serialization
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterInterface((*exported.VestingAccount)(nil), nil)
|
||||
cdc.RegisterConcrete(&BaseVestingAccount{}, "cosmos-sdk/BaseVestingAccount")
|
||||
cdc.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount")
|
||||
cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount")
|
||||
cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount")
|
||||
cdc.RegisterConcrete(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*exported.VestingAccount)(nil), nil)
|
||||
registrar.RegisterConcrete(&BaseVestingAccount{}, "cosmos-sdk/BaseVestingAccount")
|
||||
registrar.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount")
|
||||
registrar.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount")
|
||||
registrar.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount")
|
||||
registrar.RegisterConcrete(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount")
|
||||
}
|
||||
|
||||
// RegisterInterfaces associates protoName with AccountI and VestingAccount
|
||||
|
||||
+6
-7
@@ -1,7 +1,6 @@
|
||||
package authz
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
bank "cosmossdk.io/x/bank/types"
|
||||
@@ -13,13 +12,13 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types
|
||||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgGrant{}, "cosmos-sdk/MsgGrant")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgRevoke{}, "cosmos-sdk/MsgRevoke")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgExec{}, "cosmos-sdk/MsgExec")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgGrant{}, "cosmos-sdk/MsgGrant")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgRevoke{}, "cosmos-sdk/MsgRevoke")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgExec{}, "cosmos-sdk/MsgExec")
|
||||
|
||||
cdc.RegisterInterface((*Authorization)(nil), nil)
|
||||
cdc.RegisterConcrete(&GenericAuthorization{}, "cosmos-sdk/GenericAuthorization")
|
||||
registrar.RegisterInterface((*Authorization)(nil), nil)
|
||||
registrar.RegisterConcrete(&GenericAuthorization{}, "cosmos-sdk/GenericAuthorization")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the interface registry
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/errors"
|
||||
"cosmossdk.io/x/authz"
|
||||
@@ -93,8 +92,8 @@ func (am AppModule) RegisterMigrations(mr appmodule.MigrationRegistrar) error {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the authz module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
authz.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
authz.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the authz module's interface types
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/bank/client/cli"
|
||||
"cosmossdk.io/x/bank/keeper"
|
||||
@@ -63,8 +62,8 @@ func (am AppModule) IsAppModule() {}
|
||||
func (AppModule) Name() string { return types.ModuleName }
|
||||
|
||||
// RegisterLegacyAminoCodec registers the bank module's types on the LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the bank module.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -11,14 +10,14 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the necessary x/bank interfaces and concrete types
|
||||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSend{}, "cosmos-sdk/MsgSend")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgMultiSend{}, "cosmos-sdk/MsgMultiSend")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/bank/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSetSendEnabled{}, "cosmos-sdk/MsgSetSendEnabled")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSend{}, "cosmos-sdk/MsgSend")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgMultiSend{}, "cosmos-sdk/MsgMultiSend")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/bank/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSetSendEnabled{}, "cosmos-sdk/MsgSetSendEnabled")
|
||||
|
||||
cdc.RegisterConcrete(&SendAuthorization{}, "cosmos-sdk/SendAuthorization")
|
||||
cdc.RegisterConcrete(&Params{}, "cosmos-sdk/x/bank/Params")
|
||||
registrar.RegisterConcrete(&SendAuthorization{}, "cosmos-sdk/SendAuthorization")
|
||||
registrar.RegisterConcrete(&Params{}, "cosmos-sdk/x/bank/Params")
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/consensus/keeper"
|
||||
"cosmossdk.io/x/consensus/types"
|
||||
@@ -72,8 +71,8 @@ func (AppModule) IsAppModule() {}
|
||||
func (AppModule) Name() string { return types.ModuleName }
|
||||
|
||||
// RegisterLegacyAminoCodec registers the consensus module's types on the LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -21,6 +20,6 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
|
||||
// RegisterLegacyAminoCodec registers the necessary x/consensus interfaces and concrete types
|
||||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/consensus/MsgUpdateParams")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/consensus/MsgUpdateParams")
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/distribution/client/cli"
|
||||
"cosmossdk.io/x/distribution/keeper"
|
||||
@@ -73,8 +72,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the distribution module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the distribution module.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -12,14 +11,14 @@ import (
|
||||
// RegisterLegacyAminoCodec registers the necessary x/distribution interfaces
|
||||
// and concrete types on the provided LegacyAmino codec. These types are used
|
||||
// for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValCommission")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgDepositValidatorRewardsPool{}, "cosmos-sdk/distr/MsgDepositValRewards")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValCommission")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgDepositValidatorRewardsPool{}, "cosmos-sdk/distr/MsgDepositValRewards")
|
||||
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params")
|
||||
registrar.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params")
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/epochs/keeper"
|
||||
"cosmossdk.io/x/epochs/simulation"
|
||||
"cosmossdk.io/x/epochs/types"
|
||||
@@ -56,7 +56,7 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the epochs module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {}
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the epochs module.
|
||||
func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
eviclient "cosmossdk.io/x/evidence/client"
|
||||
"cosmossdk.io/x/evidence/client/cli"
|
||||
@@ -66,8 +65,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the evidence module's types to the LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the evidence module.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/x/evidence/exported"
|
||||
@@ -12,10 +11,10 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
|
||||
// evidence module.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterInterface((*exported.Evidence)(nil), nil)
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSubmitEvidence{}, "cosmos-sdk/MsgSubmitEvidence")
|
||||
cdc.RegisterConcrete(&Equivocation{}, "cosmos-sdk/Equivocation")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*exported.Evidence)(nil), nil)
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSubmitEvidence{}, "cosmos-sdk/MsgSubmitEvidence")
|
||||
registrar.RegisterConcrete(&Equivocation{}, "cosmos-sdk/Equivocation")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the interface registry.
|
||||
|
||||
+7
-8
@@ -1,7 +1,6 @@
|
||||
package feegrant
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -11,14 +10,14 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the necessary x/feegrant interfaces and concrete types
|
||||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgGrantAllowance{}, "cosmos-sdk/MsgGrantAllowance")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgRevokeAllowance{}, "cosmos-sdk/MsgRevokeAllowance")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgGrantAllowance{}, "cosmos-sdk/MsgGrantAllowance")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgRevokeAllowance{}, "cosmos-sdk/MsgRevokeAllowance")
|
||||
|
||||
cdc.RegisterInterface((*FeeAllowanceI)(nil), nil)
|
||||
cdc.RegisterConcrete(&BasicAllowance{}, "cosmos-sdk/BasicAllowance")
|
||||
cdc.RegisterConcrete(&PeriodicAllowance{}, "cosmos-sdk/PeriodicAllowance")
|
||||
cdc.RegisterConcrete(&AllowedMsgAllowance{}, "cosmos-sdk/AllowedMsgAllowance")
|
||||
registrar.RegisterInterface((*FeeAllowanceI)(nil), nil)
|
||||
registrar.RegisterConcrete(&BasicAllowance{}, "cosmos-sdk/BasicAllowance")
|
||||
registrar.RegisterConcrete(&PeriodicAllowance{}, "cosmos-sdk/PeriodicAllowance")
|
||||
registrar.RegisterConcrete(&AllowedMsgAllowance{}, "cosmos-sdk/AllowedMsgAllowance")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the interface registry
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/errors"
|
||||
"cosmossdk.io/x/feegrant"
|
||||
@@ -68,8 +67,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the feegrant module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
feegrant.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
feegrant.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the feegrant module's interface types
|
||||
|
||||
+3
-4
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
govclient "cosmossdk.io/x/gov/client"
|
||||
"cosmossdk.io/x/gov/client/cli"
|
||||
@@ -79,9 +78,9 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the gov module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
v1beta1.RegisterLegacyAminoCodec(cdc)
|
||||
v1.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
v1beta1.RegisterLegacyAminoCodec(registrar)
|
||||
v1.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the gov module.
|
||||
|
||||
+10
-11
@@ -1,7 +1,6 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -11,16 +10,16 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
|
||||
// governance module.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSubmitProposal{}, "cosmos-sdk/v1/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSubmitMultipleChoiceProposal{}, "gov/MsgSubmitMultipleChoiceProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgDeposit{}, "cosmos-sdk/v1/MsgDeposit")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/v1/MsgVote")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "cosmos-sdk/v1/MsgVoteWeighted")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgExecLegacyContent{}, "cosmos-sdk/v1/MsgExecLegacyContent")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/gov/v1/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateMessageParams{}, "x/gov/v1/MsgUpdateMessageParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSudoExec{}, "cosmos-sdk/x/gov/v1/MsgSudoExec")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSubmitProposal{}, "cosmos-sdk/v1/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSubmitMultipleChoiceProposal{}, "gov/MsgSubmitMultipleChoiceProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgDeposit{}, "cosmos-sdk/v1/MsgDeposit")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgVote{}, "cosmos-sdk/v1/MsgVote")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgVoteWeighted{}, "cosmos-sdk/v1/MsgVoteWeighted")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgExecLegacyContent{}, "cosmos-sdk/v1/MsgExecLegacyContent")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/gov/v1/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateMessageParams{}, "x/gov/v1/MsgUpdateMessageParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSudoExec{}, "cosmos-sdk/x/gov/v1/MsgSudoExec")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the Interface Registry.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -11,13 +10,13 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
|
||||
// governance module.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterInterface((*Content)(nil), nil)
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgDeposit{}, "cosmos-sdk/MsgDeposit")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/MsgVote")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted")
|
||||
cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*Content)(nil), nil)
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgDeposit{}, "cosmos-sdk/MsgDeposit")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgVote{}, "cosmos-sdk/MsgVote")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted")
|
||||
registrar.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the Interface Registry.
|
||||
|
||||
+18
-19
@@ -1,7 +1,6 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -12,25 +11,25 @@ import (
|
||||
// RegisterLegacyAminoCodec registers all the necessary group module concrete
|
||||
// types and interfaces with the provided codec reference.
|
||||
// These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterInterface((*DecisionPolicy)(nil), nil)
|
||||
cdc.RegisterConcrete(&ThresholdDecisionPolicy{}, "cosmos-sdk/ThresholdDecisionPolicy")
|
||||
cdc.RegisterConcrete(&PercentageDecisionPolicy{}, "cosmos-sdk/PercentageDecisionPolicy")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterInterface((*DecisionPolicy)(nil), nil)
|
||||
registrar.RegisterConcrete(&ThresholdDecisionPolicy{}, "cosmos-sdk/ThresholdDecisionPolicy")
|
||||
registrar.RegisterConcrete(&PercentageDecisionPolicy{}, "cosmos-sdk/PercentageDecisionPolicy")
|
||||
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCreateGroup{}, "cosmos-sdk/MsgCreateGroup")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupMembers{}, "cosmos-sdk/MsgUpdateGroupMembers")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupAdmin{}, "cosmos-sdk/MsgUpdateGroupAdmin")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupMetadata{}, "cosmos-sdk/MsgUpdateGroupMetadata")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCreateGroupWithPolicy{}, "cosmos-sdk/MsgCreateGroupWithPolicy")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCreateGroupPolicy{}, "cosmos-sdk/MsgCreateGroupPolicy")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupPolicyAdmin{}, "cosmos-sdk/MsgUpdateGroupPolicyAdmin")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupPolicyDecisionPolicy{}, "cosmos-sdk/MsgUpdateGroupDecisionPolicy")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateGroupPolicyMetadata{}, "cosmos-sdk/MsgUpdateGroupPolicyMetadata")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSubmitProposal{}, "cosmos-sdk/group/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgWithdrawProposal{}, "cosmos-sdk/group/MsgWithdrawProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/group/MsgVote")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgExec{}, "cosmos-sdk/group/MsgExec")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgLeaveGroup{}, "cosmos-sdk/group/MsgLeaveGroup")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCreateGroup{}, "cosmos-sdk/MsgCreateGroup")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupMembers{}, "cosmos-sdk/MsgUpdateGroupMembers")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupAdmin{}, "cosmos-sdk/MsgUpdateGroupAdmin")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupMetadata{}, "cosmos-sdk/MsgUpdateGroupMetadata")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCreateGroupWithPolicy{}, "cosmos-sdk/MsgCreateGroupWithPolicy")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCreateGroupPolicy{}, "cosmos-sdk/MsgCreateGroupPolicy")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupPolicyAdmin{}, "cosmos-sdk/MsgUpdateGroupPolicyAdmin")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupPolicyDecisionPolicy{}, "cosmos-sdk/MsgUpdateGroupDecisionPolicy")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateGroupPolicyMetadata{}, "cosmos-sdk/MsgUpdateGroupPolicyMetadata")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSubmitProposal{}, "cosmos-sdk/group/MsgSubmitProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgWithdrawProposal{}, "cosmos-sdk/group/MsgWithdrawProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgVote{}, "cosmos-sdk/group/MsgVote")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgExec{}, "cosmos-sdk/group/MsgExec")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgLeaveGroup{}, "cosmos-sdk/group/MsgLeaveGroup")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the interface registry.
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/group"
|
||||
"cosmossdk.io/x/group/client/cli"
|
||||
@@ -88,8 +87,8 @@ func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the group module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
group.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
group.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInvariants does nothing, there are no invariants to enforce
|
||||
|
||||
+2
-3
@@ -9,7 +9,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/mint/keeper"
|
||||
"cosmossdk.io/x/mint/simulation"
|
||||
@@ -80,8 +79,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the mint module's types on the given LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the module's interface types
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -10,9 +9,9 @@ import (
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/mint/Params")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/mint/MsgUpdateParams")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterConcrete(Params{}, "cosmos-sdk/x/mint/Params")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/mint/MsgUpdateParams")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the interface registry.
|
||||
|
||||
+2
-3
@@ -7,7 +7,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/params/keeper"
|
||||
"cosmossdk.io/x/params/types/proposal"
|
||||
@@ -51,8 +50,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the params module's types on the given LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
proposal.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
proposal.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the params module.
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package proposal
|
||||
|
||||
import (
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
govtypes "cosmossdk.io/x/gov/types/v1beta1"
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers all necessary param module types with a given LegacyAmino codec.
|
||||
func RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
cdc.RegisterConcrete(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterConcrete(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal")
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
@@ -81,8 +80,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the slashing module's types for the given codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the slashing module's interface types
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -10,10 +9,10 @@ import (
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers concrete types on LegacyAmino codec
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/slashing/Params")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUnjail{}, "cosmos-sdk/MsgUnjail")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/slashing/MsgUpdateParams")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterConcrete(Params{}, "cosmos-sdk/x/slashing/Params")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUnjail{}, "cosmos-sdk/MsgUnjail")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/slashing/MsgUpdateParams")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the Interface Registry.
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/x/staking/client/cli"
|
||||
@@ -75,8 +74,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the staking module's types on the given LegacyAmino codec.
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the module's interface types
|
||||
|
||||
+14
-15
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -11,21 +10,21 @@ import (
|
||||
|
||||
// RegisterLegacyAminoCodec registers the necessary x/staking interfaces and concrete types
|
||||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgEditValidator{}, "cosmos-sdk/MsgEditValidator")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgDelegate{}, "cosmos-sdk/MsgDelegate")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUndelegate{}, "cosmos-sdk/MsgUndelegate")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/staking/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgRotateConsPubKey{}, "cosmos-sdk/MsgRotateConsPubKey")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgEditValidator{}, "cosmos-sdk/MsgEditValidator")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgDelegate{}, "cosmos-sdk/MsgDelegate")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUndelegate{}, "cosmos-sdk/MsgUndelegate")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgUpdateParams{}, "cosmos-sdk/x/staking/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgRotateConsPubKey{}, "cosmos-sdk/MsgRotateConsPubKey")
|
||||
|
||||
cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil)
|
||||
cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList")
|
||||
cdc.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList")
|
||||
cdc.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization")
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/staking/Params")
|
||||
registrar.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil)
|
||||
registrar.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList")
|
||||
registrar.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList")
|
||||
registrar.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization")
|
||||
registrar.RegisterConcrete(Params{}, "cosmos-sdk/x/staking/Params")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the x/staking interfaces types with the interface registry
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
"cosmossdk.io/x/upgrade/client/cli"
|
||||
"cosmossdk.io/x/upgrade/keeper"
|
||||
@@ -56,8 +55,8 @@ func (AppModule) Name() string {
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec registers the upgrade types on the LegacyAmino codec
|
||||
func (AppModule) RegisterLegacyAminoCodec(cdc legacy.Amino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
types.RegisterLegacyAminoCodec(registrar)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the upgrade module.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
corelegacy "cosmossdk.io/core/legacy"
|
||||
"cosmossdk.io/core/registry"
|
||||
coretransaction "cosmossdk.io/core/transaction"
|
||||
|
||||
@@ -10,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
||||
func RegisterLegacyAminoCodec(cdc corelegacy.Amino) {
|
||||
cdc.RegisterConcrete(Plan{}, "cosmos-sdk/Plan")
|
||||
cdc.RegisterConcrete(&SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal")
|
||||
cdc.RegisterConcrete(&CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgSoftwareUpgrade{}, "cosmos-sdk/MsgSoftwareUpgrade")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCancelUpgrade{}, "cosmos-sdk/MsgCancelUpgrade")
|
||||
func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) {
|
||||
registrar.RegisterConcrete(Plan{}, "cosmos-sdk/Plan")
|
||||
registrar.RegisterConcrete(&SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal")
|
||||
registrar.RegisterConcrete(&CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgSoftwareUpgrade{}, "cosmos-sdk/MsgSoftwareUpgrade")
|
||||
legacy.RegisterAminoMsg(registrar, &MsgCancelUpgrade{}, "cosmos-sdk/MsgCancelUpgrade")
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the interfaces types with the Interface Registry.
|
||||
|
||||
Reference in New Issue
Block a user