chore: cleanup core/app (#21368)

This commit is contained in:
Marko
2024-08-27 09:55:16 +00:00
committed by GitHub
parent 58af7ee027
commit 355f748add
28 changed files with 296 additions and 232 deletions
+12 -4
View File
@@ -9,15 +9,23 @@ import (
"google.golang.org/protobuf/proto"
_ "cosmossdk.io/api/amino" // Import amino.proto file for reflection
appmanager "cosmossdk.io/core/app"
"cosmossdk.io/core/server"
"cosmossdk.io/core/transaction"
)
// protocdc defines the interface for marshaling and unmarshaling messages in server/v2
type protocdc interface {
Marshal(v transaction.Msg) ([]byte, error)
Unmarshal(data []byte, v transaction.Msg) error
Name() string
}
type protoCodec struct {
interfaceRegistry appmanager.InterfaceRegistry
interfaceRegistry server.InterfaceRegistry
}
// newProtoCodec returns a reference to a new ProtoCodec
func newProtoCodec(interfaceRegistry appmanager.InterfaceRegistry) *protoCodec {
func newProtoCodec(interfaceRegistry server.InterfaceRegistry) *protoCodec {
return &protoCodec{
interfaceRegistry: interfaceRegistry,
}
@@ -62,7 +70,7 @@ func (pc *protoCodec) GRPCCodec() encoding.Codec {
// grpcProtoCodec is the implementation of the gRPC proto codec.
type grpcProtoCodec struct {
cdc appmanager.ProtoCodec
cdc protocdc
}
var errUnknownProtoType = errors.New("codec: unknown proto type") // sentinel error