github.com/cosmos/cosmos-sdk@v0.50.10/x/authz/codec.go (about) 1 package authz 2 3 import ( 4 "github.com/cosmos/cosmos-sdk/codec" 5 "github.com/cosmos/cosmos-sdk/codec/legacy" 6 types "github.com/cosmos/cosmos-sdk/codec/types" 7 sdk "github.com/cosmos/cosmos-sdk/types" 8 "github.com/cosmos/cosmos-sdk/types/msgservice" 9 ) 10 11 // RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types 12 // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. 13 func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { 14 legacy.RegisterAminoMsg(cdc, &MsgGrant{}, "cosmos-sdk/MsgGrant") 15 legacy.RegisterAminoMsg(cdc, &MsgRevoke{}, "cosmos-sdk/MsgRevoke") 16 legacy.RegisterAminoMsg(cdc, &MsgExec{}, "cosmos-sdk/MsgExec") 17 18 cdc.RegisterInterface((*Authorization)(nil), nil) 19 cdc.RegisterConcrete(&GenericAuthorization{}, "cosmos-sdk/GenericAuthorization", nil) 20 } 21 22 // RegisterInterfaces registers the interfaces types with the interface registry 23 func RegisterInterfaces(registry types.InterfaceRegistry) { 24 registry.RegisterImplementations((*sdk.Msg)(nil), 25 &MsgGrant{}, 26 &MsgRevoke{}, 27 &MsgExec{}, 28 ) 29 30 registry.RegisterInterface( 31 "cosmos.authz.v1beta1.Authorization", 32 (*Authorization)(nil), 33 &GenericAuthorization{}, 34 ) 35 36 msgservice.RegisterMsgServiceDesc(registry, MsgServiceDesc()) 37 }