chore: add a logged warning for merged proto registry when creating baseapp (#24450)
This commit is contained in:
@@ -33,6 +33,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/types/mempool"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -251,6 +252,18 @@ func NewBaseApp(
|
||||
// Unless SetInterfaceRegistry is called with an interface registry with proper address codecs baseapp will panic.
|
||||
app.cdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
|
||||
|
||||
protoFiles, err := proto.MergedRegistry()
|
||||
if err != nil {
|
||||
logger.Warn("error creating merged proto registry", "error", err)
|
||||
} else {
|
||||
err = msgservice.ValidateProtoAnnotations(protoFiles)
|
||||
if err != nil {
|
||||
// Once we switch to using protoreflect-based antehandlers, we might
|
||||
// want to panic here instead of logging a warning.
|
||||
logger.Warn("error validating merged proto registry annotations", "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user